From 821aae4a624c86cea03c723ec16a85d5eb188788 Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Sun, 26 Nov 2023 13:33:17 +0200 Subject: [PATCH] logs refactoring --- CHANGELOG.md | 32 + apis/admin.go | 6 +- apis/backup.go | 11 +- apis/backup_test.go | 8 +- apis/base.go | 53 +- apis/collection_test.go | 2 +- apis/health.go | 2 +- apis/logs.go | 36 +- apis/logs_test.go | 42 +- apis/middlewares.go | 147 +- apis/realtime.go | 111 +- apis/record_auth.go | 28 +- apis/record_auth_test.go | 2 +- apis/record_crud.go | 33 +- apis/record_helpers.go | 5 +- apis/serve.go | 2 +- core/app.go | 13 +- core/base.go | 184 +- core/base_backup.go | 63 +- core/base_backup_test.go | 8 +- core/base_test.go | 104 +- daos/base.go | 9 +- daos/log.go | 67 + daos/{request_test.go => log_test.go} | 64 +- daos/request.go | 70 - forms/collections_import.go | 6 +- forms/collections_import_test.go | 2 +- forms/record_email_change_confirm.go | 2 + forms/record_email_change_request.go | 2 +- forms/record_upsert.go | 17 +- forms/settings_upsert.go | 34 +- go.mod | 62 +- go.sum | 198 +- migrations/logs/1640988000_init.go | 4 +- .../logs/1699187560_logs_generalization.go | 58 + models/log.go | 19 + models/settings/settings.go | 5 +- plugins/ghupdate/ghupdate.go | 11 +- plugins/jsvm/binds.go | 10 +- .../jsvm/internal/types/generated/types.d.ts | 7172 +++++++++++------ plugins/jsvm/internal/types/types.go | 2 +- plugins/migratecmd/automigrate.go | 12 +- pocketbase.go | 28 +- pocketbase_test.go | 14 - tests/app.go | 1 - tests/data/data.db | Bin 249856 -> 249856 bytes tests/data/logs.db | Bin 69632 -> 69632 bytes tests/logs.go | 42 +- tools/logger/batch_handler.go | 264 + tools/logger/batch_handler_test.go | 324 + tools/logger/log.go | 17 + tools/osutils/dir.go | 7 +- tools/routine/routine.go | 4 +- tools/search/filter_test.go | 40 +- tools/search/simple_field_resolver.go | 31 +- tools/search/simple_field_resolver_test.go | 3 +- tools/store/store.go | 2 +- ui/.env | 2 +- ...3f5e9f2.js => AuthMethodsDocs-932fac77.js} | 2 +- ...35aea06.js => AuthRefreshDocs-cba47500.js} | 2 +- ...6efb.js => AuthWithOAuth2Docs-c73de73c.js} | 2 +- ...ee.js => AuthWithPasswordDocs-0a927386.js} | 2 +- ui/dist/assets/CodeEditor-c4a370cf.js | 14 + ui/dist/assets/CodeEditor-c648ece6.js | 14 - ....js => ConfirmEmailChangeDocs-88a7323c.js} | 2 +- ...s => ConfirmPasswordResetDocs-0d3db4a6.js} | 2 +- ...js => ConfirmVerificationDocs-4e703cc5.js} | 2 +- ...-0d934784.js => CreateApiDocs-585fc5d4.js} | 2 +- ...-fd29a801.js => DeleteApiDocs-d2d1d4be.js} | 2 +- ...b769d1.js => FieldsQueryParam-2d478986.js} | 2 +- ...js => FilterAutocompleteInput-c936572d.js} | 2 +- ...cs-3cd045c1.js => ListApiDocs-8893d294.js} | 2 +- ...a.js => ListExternalAuthsDocs-baf81d9b.js} | 2 +- ...PageAdminConfirmPasswordReset-84f4610d.js} | 2 +- ...PageAdminRequestPasswordReset-b72b7a4a.js} | 2 +- ...e5c9.js => PageOAuth2Redirect-999aaede.js} | 2 +- ... PageRecordConfirmEmailChange-02c3e953.js} | 2 +- ...ageRecordConfirmPasswordReset-0229c5a8.js} | 2 +- ...PageRecordConfirmVerification-6165faf3.js} | 2 +- ...31c981c.js => RealtimeApiDocs-614048dc.js} | 2 +- ....js => RequestEmailChangeDocs-b1c5a122.js} | 2 +- ...s => RequestPasswordResetDocs-c3812420.js} | 2 +- ...js => RequestVerificationDocs-ac34ed9e.js} | 2 +- ...dkTabs-f0532e58.js => SdkTabs-821a5c7e.js} | 2 +- ....js => UnlinkExternalAuthDocs-1e98af12.js} | 2 +- ...-ae87c615.js => UpdateApiDocs-fc34c4b8.js} | 2 +- ...cs-7f75b66b.js => ViewApiDocs-23e66fca.js} | 2 +- ui/dist/assets/index-0a754981.css | 1 + ui/dist/assets/index-102ce751.js | 13 + ui/dist/assets/index-30dee195.js | 13 - ui/dist/assets/index-6c8f1731.js | 161 + ui/dist/assets/index-7d33ef4c.js | 160 - ui/dist/assets/index-aca38a7a.css | 1 - ui/dist/index.html | 4 +- ui/package-lock.json | 199 +- ui/package.json | 4 +- ui/src/components/logs/LogDate.svelte | 18 + ui/src/components/logs/LogLevel.svelte | 40 + ui/src/components/logs/LogViewPanel.svelte | 161 +- ui/src/components/logs/LogsChart.svelte | 78 +- ui/src/components/logs/LogsLevelsInfo.svelte | 15 + ui/src/components/logs/LogsList.svelte | 300 +- .../components/logs/LogsSettingsPanel.svelte | 138 + ui/src/components/logs/PageLogs.svelte | 77 +- ui/src/components/records/RecordsList.svelte | 13 +- .../settings/PageApplication.svelte | 7 +- ui/src/scss/_base.scss | 11 + ui/src/scss/_table.scss | 3 - ui/src/utils/CommonHelper.js | 52 +- 109 files changed, 7320 insertions(+), 3728 deletions(-) create mode 100644 daos/log.go rename daos/{request_test.go => log_test.go} (58%) delete mode 100644 daos/request.go create mode 100644 migrations/logs/1699187560_logs_generalization.go create mode 100644 models/log.go create mode 100644 tools/logger/batch_handler.go create mode 100644 tools/logger/batch_handler_test.go create mode 100644 tools/logger/log.go rename ui/dist/assets/{AuthMethodsDocs-33f5e9f2.js => AuthMethodsDocs-932fac77.js} (97%) rename ui/dist/assets/{AuthRefreshDocs-335aea06.js => AuthRefreshDocs-cba47500.js} (97%) rename ui/dist/assets/{AuthWithOAuth2Docs-a6296efb.js => AuthWithOAuth2Docs-c73de73c.js} (98%) rename ui/dist/assets/{AuthWithPasswordDocs-107160ee.js => AuthWithPasswordDocs-0a927386.js} (98%) create mode 100644 ui/dist/assets/CodeEditor-c4a370cf.js delete mode 100644 ui/dist/assets/CodeEditor-c648ece6.js rename ui/dist/assets/{ConfirmEmailChangeDocs-0dc32323.js => ConfirmEmailChangeDocs-88a7323c.js} (97%) rename ui/dist/assets/{ConfirmPasswordResetDocs-ea85ce68.js => ConfirmPasswordResetDocs-0d3db4a6.js} (98%) rename ui/dist/assets/{ConfirmVerificationDocs-a6b36296.js => ConfirmVerificationDocs-4e703cc5.js} (97%) rename ui/dist/assets/{CreateApiDocs-0d934784.js => CreateApiDocs-585fc5d4.js} (98%) rename ui/dist/assets/{DeleteApiDocs-fd29a801.js => DeleteApiDocs-d2d1d4be.js} (97%) rename ui/dist/assets/{FieldsQueryParam-f6b769d1.js => FieldsQueryParam-2d478986.js} (95%) rename ui/dist/assets/{FilterAutocompleteInput-288f3849.js => FilterAutocompleteInput-c936572d.js} (98%) rename ui/dist/assets/{ListApiDocs-3cd045c1.js => ListApiDocs-8893d294.js} (99%) rename ui/dist/assets/{ListExternalAuthsDocs-2258a5ea.js => ListExternalAuthsDocs-baf81d9b.js} (97%) rename ui/dist/assets/{PageAdminConfirmPasswordReset-8e3ad9f6.js => PageAdminConfirmPasswordReset-84f4610d.js} (98%) rename ui/dist/assets/{PageAdminRequestPasswordReset-9bb5b8fc.js => PageAdminRequestPasswordReset-b72b7a4a.js} (98%) rename ui/dist/assets/{PageOAuth2Redirect-42a9e5c9.js => PageOAuth2Redirect-999aaede.js} (87%) rename ui/dist/assets/{PageRecordConfirmEmailChange-9d9126f6.js => PageRecordConfirmEmailChange-02c3e953.js} (98%) rename ui/dist/assets/{PageRecordConfirmPasswordReset-bfd8a556.js => PageRecordConfirmPasswordReset-0229c5a8.js} (98%) rename ui/dist/assets/{PageRecordConfirmVerification-44fc3c9e.js => PageRecordConfirmVerification-6165faf3.js} (97%) rename ui/dist/assets/{RealtimeApiDocs-531c981c.js => RealtimeApiDocs-614048dc.js} (98%) rename ui/dist/assets/{RequestEmailChangeDocs-67bd3d32.js => RequestEmailChangeDocs-b1c5a122.js} (98%) rename ui/dist/assets/{RequestPasswordResetDocs-c6b478f9.js => RequestPasswordResetDocs-c3812420.js} (97%) rename ui/dist/assets/{RequestVerificationDocs-7606398a.js => RequestVerificationDocs-ac34ed9e.js} (97%) rename ui/dist/assets/{SdkTabs-f0532e58.js => SdkTabs-821a5c7e.js} (98%) rename ui/dist/assets/{UnlinkExternalAuthDocs-d7bb55bc.js => UnlinkExternalAuthDocs-1e98af12.js} (98%) rename ui/dist/assets/{UpdateApiDocs-ae87c615.js => UpdateApiDocs-fc34c4b8.js} (98%) rename ui/dist/assets/{ViewApiDocs-7f75b66b.js => ViewApiDocs-23e66fca.js} (97%) create mode 100644 ui/dist/assets/index-0a754981.css create mode 100644 ui/dist/assets/index-102ce751.js delete mode 100644 ui/dist/assets/index-30dee195.js create mode 100644 ui/dist/assets/index-6c8f1731.js delete mode 100644 ui/dist/assets/index-7d33ef4c.js delete mode 100644 ui/dist/assets/index-aca38a7a.css create mode 100644 ui/src/components/logs/LogDate.svelte create mode 100644 ui/src/components/logs/LogLevel.svelte create mode 100644 ui/src/components/logs/LogsLevelsInfo.svelte create mode 100644 ui/src/components/logs/LogsSettingsPanel.svelte diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ca8e3e..72d46e41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,35 @@ +## v0.20.0-rc4 + +- Bumped the minimum required Go version to 1.21.0 in order to integrate with the builtin `slog` package. + +- removed _requests table in favor of _logs + +- Renamed: + ``` + Dao.RequestQuery(...) -> Dao.LogQuery(...) + Dao.FindRequestById(...) -> Dao.FindLogById(...) + Dao.RequestsStats(...) -> Dao.LogsStats(...) + Dao.RequestsStats(...) -> Dao.LogsStats(...) + Dao.DeleteOldRequests(...) -> Dao.DeleteOldLogs(...) + Dao.SaveRequest(...) -> Dao.SaveLog(...) + ``` + +- removed app.IsDebug() and the `--debug` flag + +- (@todo docs) Implemented `slog.Logger` via `app.Logger()`. + Logs db writes are debounced and batched. DB write happens on + - 3sec after the last debounced log write + - when the batch threshold, currently 200, is reached (this is primarily to prevent the memory to grow unrestricted) + - right before app termination to attempt saving the current logs queue + Several minor log improvements: + - Log the requests execution times. + - Added option to toggle IP request logging. + - Added option to specify a minimum log level. + - Added option to export individual or bulk selected logs as json. + +- Soft-deprecated and renamed `app.Cache()` with `app.Store()`. + + ## v0.20.0-rc3 - Synced with the recent fixes in v0.19.4. diff --git a/apis/admin.go b/apis/admin.go index f2640d0e..629b2162 100644 --- a/apis/admin.go +++ b/apis/admin.go @@ -1,7 +1,6 @@ package apis import ( - "log" "net/http" "github.com/labstack/echo/v5" @@ -129,9 +128,8 @@ func (api *adminApi) requestPasswordReset(c echo.Context) error { return api.app.OnAdminBeforeRequestPasswordResetRequest().Trigger(event, func(e *core.AdminRequestPasswordResetEvent) error { // run in background because we don't need to show the result to the client routine.FireAndForget(func() { - if err := next(e.Admin); err != nil && api.app.IsDebug() { - // @todo replace after logs generalization - log.Println(err) + if err := next(e.Admin); err != nil { + api.app.Logger().Error("Failed to send admin password reset request.", "error", err) } }) diff --git a/apis/backup.go b/apis/backup.go index 87693672..a100e56b 100644 --- a/apis/backup.go +++ b/apis/backup.go @@ -2,7 +2,6 @@ package apis import ( "context" - "log" "net/http" "path/filepath" "time" @@ -69,7 +68,7 @@ func (api *backupApi) list(c echo.Context) error { } func (api *backupApi) create(c echo.Context) error { - if api.app.Cache().Has(core.CacheKeyActiveBackup) { + if api.app.Store().Has(core.StoreKeyActiveBackup) { return NewBadRequestError("Try again later - another backup/restore process has already been started", nil) } @@ -152,7 +151,7 @@ func (api *backupApi) download(c echo.Context) error { } func (api *backupApi) restore(c echo.Context) error { - if api.app.Cache().Has(core.CacheKeyActiveBackup) { + if api.app.Store().Has(core.StoreKeyActiveBackup) { return NewBadRequestError("Try again later - another backup/restore process has already been started.", nil) } @@ -181,8 +180,8 @@ func (api *backupApi) restore(c echo.Context) error { // give some optimistic time to write the response time.Sleep(1 * time.Second) - if err := api.app.RestoreBackup(ctx, key); err != nil && api.app.IsDebug() { - log.Println(err) + if err := api.app.RestoreBackup(ctx, key); err != nil { + api.app.Logger().Error("Failed to restore backup", "key", key, "error", err.Error()) } }() @@ -203,7 +202,7 @@ func (api *backupApi) delete(c echo.Context) error { key := c.PathParam("key") - if key != "" && cast.ToString(api.app.Cache().Get(core.CacheKeyActiveBackup)) == key { + if key != "" && cast.ToString(api.app.Store().Get(core.StoreKeyActiveBackup)) == key { return NewBadRequestError("The backup is currently being used and cannot be deleted.", nil) } diff --git a/apis/backup_test.go b/apis/backup_test.go index 18a3cc2c..0fe17f7b 100644 --- a/apis/backup_test.go +++ b/apis/backup_test.go @@ -116,7 +116,7 @@ func TestBackupsCreate(t *testing.T) { "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8", }, BeforeTestFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) { - app.Cache().Set(core.CacheKeyActiveBackup, "") + app.Store().Set(core.StoreKeyActiveBackup, "") }, AfterTestFunc: func(t *testing.T, app *tests.TestApp, res *http.Response) { ensureNoBackups(t, app) @@ -562,7 +562,7 @@ func TestBackupsDelete(t *testing.T) { } // mock active backup with the same name to delete - app.Cache().Set(core.CacheKeyActiveBackup, "test1.zip") + app.Store().Set(core.StoreKeyActiveBackup, "test1.zip") }, AfterTestFunc: func(t *testing.T, app *tests.TestApp, res *http.Response) { noTestBackupFilesChanges(t, app) @@ -583,7 +583,7 @@ func TestBackupsDelete(t *testing.T) { } // mock active backup with different name - app.Cache().Set(core.CacheKeyActiveBackup, "new.zip") + app.Store().Set(core.StoreKeyActiveBackup, "new.zip") }, AfterTestFunc: func(t *testing.T, app *tests.TestApp, res *http.Response) { files, err := getBackupFiles(app) @@ -700,7 +700,7 @@ func TestBackupsRestore(t *testing.T) { t.Fatal(err) } - app.Cache().Set(core.CacheKeyActiveBackup, "") + app.Store().Set(core.StoreKeyActiveBackup, "") }, ExpectedStatus: 400, ExpectedContent: []string{`"data":{}`}, diff --git a/apis/base.go b/apis/base.go index 36fabe6a..3e53f0bc 100644 --- a/apis/base.go +++ b/apis/base.go @@ -6,11 +6,12 @@ import ( "errors" "fmt" "io/fs" - "log" + "log/slog" "net/http" "net/url" "path/filepath" "strings" + "time" "github.com/labstack/echo/v5" "github.com/labstack/echo/v5/middleware" @@ -26,7 +27,7 @@ const trailedAdminPath = "/_/" // system and app specific routes and middlewares. func InitApi(app core.App) (*echo.Echo, error) { e := echo.New() - e.Debug = app.IsDebug() + e.Debug = false e.JSONSerializer = &rest.Serializer{ FieldsParam: fieldsQueryParam, } @@ -49,6 +50,13 @@ func InitApi(app core.App) (*echo.Echo, error) { e.Pre(LoadAuthContext(app)) e.Use(middleware.Recover()) e.Use(middleware.Secure()) + e.Use(func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + c.Set(ContextExecStartKey, time.Now()) + + return next(c) + } + }) // custom error handler e.HTTPErrorHandler = func(c echo.Context, err error) { @@ -56,30 +64,14 @@ func InitApi(app core.App) (*echo.Echo, error) { return // no error } - if c.Response().Committed { - if app.IsDebug() { - log.Println("HTTPErrorHandler response was already committed:", err) - } - return - } - var apiErr *ApiError if errors.As(err, &apiErr) { - if app.IsDebug() && apiErr.RawData() != nil { - log.Println(apiErr.RawData()) - } + // already an api error... } else if v := new(echo.HTTPError); errors.As(err, &v) { - if v.Internal != nil && app.IsDebug() { - log.Println(v.Internal) - } msg := fmt.Sprintf("%v", v.Message) apiErr = NewApiError(v.Code, msg, v) } else { - if app.IsDebug() { - log.Println(err) - } - if errors.Is(err, sql.ErrNoRows) { apiErr = NewNotFoundError("", err) } else { @@ -87,13 +79,19 @@ func InitApi(app core.App) (*echo.Echo, error) { } } + logRequest(app, c, apiErr) + + if c.Response().Committed { + return // already commited + } + event := new(core.ApiErrorEvent) event.HttpContext = c event.Error = apiErr // send error response hookErr := app.OnBeforeApiError().Trigger(event, func(e *core.ApiErrorEvent) error { - if c.Response().Committed { + if e.HttpContext.Response().Committed { return nil } @@ -106,12 +104,11 @@ func InitApi(app core.App) (*echo.Echo, error) { }) if hookErr == nil { - if err := app.OnAfterApiError().Trigger(event); err != nil && app.IsDebug() { - log.Println(hookErr) + if err := app.OnAfterApiError().Trigger(event); err != nil { + app.Logger().Debug("OnAfterApiError failure", slog.String("error", hookErr.Error())) } - } else if app.IsDebug() { - // truly rare case; eg. client already disconnected - log.Println(hookErr) + } else { + app.Logger().Debug("OnBeforeApiError error (truly rare case, eg. client already disconnected)", slog.String("error", hookErr.Error())) } } @@ -215,7 +212,7 @@ func updateHasAdminsCache(app core.App) error { return err } - app.Cache().Set(hasAdminsCacheKey, total > 0) + app.Store().Set(hasAdminsCacheKey, total > 0) return nil } @@ -240,14 +237,14 @@ func installerRedirect(app core.App) echo.MiddlewareFunc { return next(c) } - hasAdmins := cast.ToBool(app.Cache().Get(hasAdminsCacheKey)) + hasAdmins := cast.ToBool(app.Store().Get(hasAdminsCacheKey)) if !hasAdmins { // update the cache to make sure that the admin wasn't created by another process if err := updateHasAdminsCache(app); err != nil { return err } - hasAdmins = cast.ToBool(app.Cache().Get(hasAdminsCacheKey)) + hasAdmins = cast.ToBool(app.Store().Get(hasAdminsCacheKey)) } _, hasInstallerParam := c.Request().URL.Query()["installer"] diff --git a/apis/collection_test.go b/apis/collection_test.go index 4b8777a1..758c0276 100644 --- a/apis/collection_test.go +++ b/apis/collection_test.go @@ -1141,7 +1141,7 @@ func TestCollectionsImport(t *testing.T) { }, ExpectedEvents: map[string]int{ "OnCollectionsBeforeImportRequest": 1, - "OnModelBeforeDelete": 4, + "OnModelBeforeDelete": 3, }, AfterTestFunc: func(t *testing.T, app *tests.TestApp, res *http.Response) { collections := []*models.Collection{} diff --git a/apis/health.go b/apis/health.go index fef22c39..9b6e0c88 100644 --- a/apis/health.go +++ b/apis/health.go @@ -32,7 +32,7 @@ func (api *healthApi) healthCheck(c echo.Context) error { resp := new(healthCheckResponse) resp.Code = http.StatusOK resp.Message = "API is healthy." - resp.Data.CanBackup = !api.app.Cache().Has(core.CacheKeyActiveBackup) + resp.Data.CanBackup = !api.app.Store().Has(core.StoreKeyActiveBackup) return c.JSON(http.StatusOK, resp) } diff --git a/apis/logs.go b/apis/logs.go index 079cd7ca..34b7aaee 100644 --- a/apis/logs.go +++ b/apis/logs.go @@ -15,27 +15,27 @@ func bindLogsApi(app core.App, rg *echo.Group) { api := logsApi{app: app} subGroup := rg.Group("/logs", RequireAdminAuth()) - subGroup.GET("/requests", api.requestsList) - subGroup.GET("/requests/stats", api.requestsStats) - subGroup.GET("/requests/:id", api.requestView) + subGroup.GET("", api.list) + subGroup.GET("/stats", api.stats) + subGroup.GET("/:id", api.view) } type logsApi struct { app core.App } -var requestFilterFields = []string{ +var logFilterFields = []string{ "rowid", "id", "created", "updated", - "url", "method", "status", "auth", - "remoteIp", "userIp", "referer", "userAgent", + "level", "message", "data", + `^data\.[\w\.\:]*\w+$`, } -func (api *logsApi) requestsList(c echo.Context) error { - fieldResolver := search.NewSimpleFieldResolver(requestFilterFields...) +func (api *logsApi) list(c echo.Context) error { + fieldResolver := search.NewSimpleFieldResolver(logFilterFields...) result, err := search.NewProvider(fieldResolver). - Query(api.app.LogsDao().RequestQuery()). - ParseAndExec(c.QueryParams().Encode(), &[]*models.Request{}) + Query(api.app.LogsDao().LogQuery()). + ParseAndExec(c.QueryParams().Encode(), &[]*models.Log{}) if err != nil { return NewBadRequestError("", err) @@ -44,8 +44,8 @@ func (api *logsApi) requestsList(c echo.Context) error { return c.JSON(http.StatusOK, result) } -func (api *logsApi) requestsStats(c echo.Context) error { - fieldResolver := search.NewSimpleFieldResolver(requestFilterFields...) +func (api *logsApi) stats(c echo.Context) error { + fieldResolver := search.NewSimpleFieldResolver(logFilterFields...) filter := c.QueryParam(search.FilterQueryParam) @@ -58,24 +58,24 @@ func (api *logsApi) requestsStats(c echo.Context) error { } } - stats, err := api.app.LogsDao().RequestsStats(expr) + stats, err := api.app.LogsDao().LogsStats(expr) if err != nil { - return NewBadRequestError("Failed to generate requests stats.", err) + return NewBadRequestError("Failed to generate logs stats.", err) } return c.JSON(http.StatusOK, stats) } -func (api *logsApi) requestView(c echo.Context) error { +func (api *logsApi) view(c echo.Context) error { id := c.PathParam("id") if id == "" { return NewNotFoundError("", nil) } - request, err := api.app.LogsDao().FindRequestById(id) - if err != nil || request == nil { + log, err := api.app.LogsDao().FindLogById(id) + if err != nil || log == nil { return NewNotFoundError("", err) } - return c.JSON(http.StatusOK, request) + return c.JSON(http.StatusOK, log) } diff --git a/apis/logs_test.go b/apis/logs_test.go index 648fb0e2..2336ba0c 100644 --- a/apis/logs_test.go +++ b/apis/logs_test.go @@ -8,19 +8,19 @@ import ( "github.com/pocketbase/pocketbase/tests" ) -func TestRequestsList(t *testing.T) { +func TestLogsList(t *testing.T) { scenarios := []tests.ApiScenario{ { Name: "unauthorized", Method: http.MethodGet, - Url: "/api/logs/requests", + Url: "/api/logs", ExpectedStatus: 401, ExpectedContent: []string{`"data":{}`}, }, { Name: "authorized as auth record", Method: http.MethodGet, - Url: "/api/logs/requests", + Url: "/api/logs", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjRxMXhsY2xtZmxva3UzMyIsInR5cGUiOiJhdXRoUmVjb3JkIiwiY29sbGVjdGlvbklkIjoiX3BiX3VzZXJzX2F1dGhfIiwiZXhwIjoyMjA4OTg1MjYxfQ.UwD8JvkbQtXpymT09d7J6fdA0aP9g4FJ1GPh_ggEkzc", }, @@ -30,12 +30,12 @@ func TestRequestsList(t *testing.T) { { Name: "authorized as admin", Method: http.MethodGet, - Url: "/api/logs/requests", + Url: "/api/logs", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8", }, BeforeTestFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) { - if err := tests.MockRequestLogsData(app); err != nil { + if err := tests.MockLogsData(app); err != nil { t.Fatal(err) } }, @@ -52,12 +52,12 @@ func TestRequestsList(t *testing.T) { { Name: "authorized as admin + filter", Method: http.MethodGet, - Url: "/api/logs/requests?filter=status>200", + Url: "/api/logs?filter=data.status>200", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8", }, BeforeTestFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) { - if err := tests.MockRequestLogsData(app); err != nil { + if err := tests.MockLogsData(app); err != nil { t.Fatal(err) } }, @@ -77,19 +77,19 @@ func TestRequestsList(t *testing.T) { } } -func TestRequestView(t *testing.T) { +func TestLogView(t *testing.T) { scenarios := []tests.ApiScenario{ { Name: "unauthorized", Method: http.MethodGet, - Url: "/api/logs/requests/873f2133-9f38-44fb-bf82-c8f53b310d91", + Url: "/api/logs/873f2133-9f38-44fb-bf82-c8f53b310d91", ExpectedStatus: 401, ExpectedContent: []string{`"data":{}`}, }, { Name: "authorized as auth record", Method: http.MethodGet, - Url: "/api/logs/requests/873f2133-9f38-44fb-bf82-c8f53b310d91", + Url: "/api/logs/873f2133-9f38-44fb-bf82-c8f53b310d91", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjRxMXhsY2xtZmxva3UzMyIsInR5cGUiOiJhdXRoUmVjb3JkIiwiY29sbGVjdGlvbklkIjoiX3BiX3VzZXJzX2F1dGhfIiwiZXhwIjoyMjA4OTg1MjYxfQ.UwD8JvkbQtXpymT09d7J6fdA0aP9g4FJ1GPh_ggEkzc", }, @@ -99,12 +99,12 @@ func TestRequestView(t *testing.T) { { Name: "authorized as admin (nonexisting request log)", Method: http.MethodGet, - Url: "/api/logs/requests/missing1-9f38-44fb-bf82-c8f53b310d91", + Url: "/api/logs/missing1-9f38-44fb-bf82-c8f53b310d91", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8", }, BeforeTestFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) { - if err := tests.MockRequestLogsData(app); err != nil { + if err := tests.MockLogsData(app); err != nil { t.Fatal(err) } }, @@ -114,12 +114,12 @@ func TestRequestView(t *testing.T) { { Name: "authorized as admin (existing request log)", Method: http.MethodGet, - Url: "/api/logs/requests/873f2133-9f38-44fb-bf82-c8f53b310d91", + Url: "/api/logs/873f2133-9f38-44fb-bf82-c8f53b310d91", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8", }, BeforeTestFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) { - if err := tests.MockRequestLogsData(app); err != nil { + if err := tests.MockLogsData(app); err != nil { t.Fatal(err) } }, @@ -135,19 +135,19 @@ func TestRequestView(t *testing.T) { } } -func TestRequestsStats(t *testing.T) { +func TestLogsStats(t *testing.T) { scenarios := []tests.ApiScenario{ { Name: "unauthorized", Method: http.MethodGet, - Url: "/api/logs/requests/stats", + Url: "/api/logs/stats", ExpectedStatus: 401, ExpectedContent: []string{`"data":{}`}, }, { Name: "authorized as auth record", Method: http.MethodGet, - Url: "/api/logs/requests/stats", + Url: "/api/logs/stats", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiJ9.eyJpZCI6IjRxMXhsY2xtZmxva3UzMyIsInR5cGUiOiJhdXRoUmVjb3JkIiwiY29sbGVjdGlvbklkIjoiX3BiX3VzZXJzX2F1dGhfIiwiZXhwIjoyMjA4OTg1MjYxfQ.UwD8JvkbQtXpymT09d7J6fdA0aP9g4FJ1GPh_ggEkzc", }, @@ -157,12 +157,12 @@ func TestRequestsStats(t *testing.T) { { Name: "authorized as admin", Method: http.MethodGet, - Url: "/api/logs/requests/stats", + Url: "/api/logs/stats", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8", }, BeforeTestFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) { - if err := tests.MockRequestLogsData(app); err != nil { + if err := tests.MockLogsData(app); err != nil { t.Fatal(err) } }, @@ -174,12 +174,12 @@ func TestRequestsStats(t *testing.T) { { Name: "authorized as admin + filter", Method: http.MethodGet, - Url: "/api/logs/requests/stats?filter=status>200", + Url: "/api/logs/stats?filter=data.status>200", RequestHeaders: map[string]string{ "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InN5d2JoZWNuaDQ2cmhtMCIsInR5cGUiOiJhZG1pbiIsImV4cCI6MjIwODk4NTI2MX0.M1m--VOqGyv0d23eeUc0r9xE8ZzHaYVmVFw1VZW6gT8", }, BeforeTestFunc: func(t *testing.T, app *tests.TestApp, e *echo.Echo) { - if err := tests.MockRequestLogsData(app); err != nil { + if err := tests.MockLogsData(app); err != nil { t.Fatal(err) } }, diff --git a/apis/middlewares.go b/apis/middlewares.go index 087d236a..a0d2ce89 100644 --- a/apis/middlewares.go +++ b/apis/middlewares.go @@ -2,7 +2,7 @@ package apis import ( "fmt" - "log" + "log/slog" "net" "net/http" "strings" @@ -15,7 +15,6 @@ import ( "github.com/pocketbase/pocketbase/tools/list" "github.com/pocketbase/pocketbase/tools/routine" "github.com/pocketbase/pocketbase/tools/security" - "github.com/pocketbase/pocketbase/tools/types" "github.com/spf13/cast" ) @@ -24,6 +23,7 @@ const ( ContextAdminKey string = "admin" ContextAuthRecordKey string = "authRecord" ContextCollectionKey string = "collection" + ContextExecStartKey string = "execStart" ) // RequireGuestOnly middleware requires a request to NOT have a valid @@ -285,86 +285,85 @@ func LoadCollectionContext(app core.App, optCollectionTypes ...string) echo.Midd func ActivityLogger(app core.App) echo.MiddlewareFunc { return func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { - err := next(c) - - logsMaxDays := app.Settings().Logs.MaxDays - - // no logs retention - if logsMaxDays == 0 { + if err := next(c); err != nil { return err } - httpRequest := c.Request() - httpResponse := c.Response() - status := httpResponse.Status - meta := types.JsonMap{} + logRequest(app, c, nil) - if err != nil { - switch v := err.(type) { - case *echo.HTTPError: - status = v.Code - meta["errorMessage"] = v.Message - meta["errorDetails"] = fmt.Sprint(v.Internal) - case *ApiError: - status = v.Code - meta["errorMessage"] = v.Message - meta["errorDetails"] = fmt.Sprint(v.RawData()) - default: - status = http.StatusBadRequest - meta["errorMessage"] = v.Error() - } - } - - requestAuth := models.RequestAuthGuest - if c.Get(ContextAuthRecordKey) != nil { - requestAuth = models.RequestAuthRecord - } else if c.Get(ContextAdminKey) != nil { - requestAuth = models.RequestAuthAdmin - } - - ip, _, _ := net.SplitHostPort(httpRequest.RemoteAddr) - - model := &models.Request{ - Url: httpRequest.URL.RequestURI(), - Method: strings.ToUpper(httpRequest.Method), - Status: status, - Auth: requestAuth, - UserIp: realUserIp(httpRequest, ip), - RemoteIp: ip, - Referer: httpRequest.Referer(), - UserAgent: httpRequest.UserAgent(), - Meta: meta, - } - // set timestamp fields before firing a new go routine - model.RefreshCreated() - model.RefreshUpdated() - - routine.FireAndForget(func() { - if err := app.LogsDao().SaveRequest(model); err != nil && app.IsDebug() { - log.Println("Log save failed:", err) - } - - // Delete old request logs - // --- - now := time.Now() - lastLogsDeletedAt := cast.ToTime(app.Cache().Get("lastLogsDeletedAt")) - daysDiff := now.Sub(lastLogsDeletedAt).Hours() * 24 - - if daysDiff > float64(logsMaxDays) { - deleteErr := app.LogsDao().DeleteOldRequests(now.AddDate(0, 0, -1*logsMaxDays)) - if deleteErr == nil { - app.Cache().Set("lastLogsDeletedAt", now) - } else if app.IsDebug() { - log.Println("Logs delete failed:", deleteErr) - } - } - }) - - return err + return nil } } } +func logRequest(app core.App, c echo.Context, err *ApiError) { + // no logs retention + if app.Settings().Logs.MaxDays == 0 { + return + } + + attrs := make([]any, 0, 15) + + attrs = append(attrs, slog.String("type", "request")) + + started := cast.ToTime(c.Get(ContextExecStartKey)) + if !started.IsZero() { + attrs = append(attrs, slog.Float64("execTime", float64(time.Since(started))/float64(time.Millisecond))) + } + + httpRequest := c.Request() + httpResponse := c.Response() + method := strings.ToUpper(httpRequest.Method) + status := httpResponse.Status + url := httpRequest.URL.RequestURI() + + // parse the request error + if err != nil { + status = err.Code + attrs = append( + attrs, + slog.String("error", err.Message), + slog.Any("details", err.RawData()), + ) + } + + requestAuth := models.RequestAuthGuest + if c.Get(ContextAuthRecordKey) != nil { + requestAuth = models.RequestAuthRecord + } else if c.Get(ContextAdminKey) != nil { + requestAuth = models.RequestAuthAdmin + } + + attrs = append( + attrs, + slog.String("url", url), + slog.String("method", method), + slog.Int("status", status), + slog.String("auth", requestAuth), + slog.String("referer", httpRequest.Referer()), + slog.String("userAgent", httpRequest.UserAgent()), + ) + + if app.Settings().Logs.LogIp { + ip, _, _ := net.SplitHostPort(httpRequest.RemoteAddr) + attrs = append( + attrs, + slog.String("userIp", realUserIp(httpRequest, ip)), + slog.String("remoteIp", ip), + ) + } + + // don't block on logs write + routine.FireAndForget(func() { + message := method + " " + url + if err != nil { + app.Logger().Error("(Failed) "+message, attrs...) + } else { + app.Logger().Info(message, attrs...) + } + }) +} + // Returns the "real" user IP from common proxy headers (or fallbackIp if none is found). // // The returned IP value shouldn't be trusted if not behind a trusted reverse proxy! diff --git a/apis/realtime.go b/apis/realtime.go index fc7a2734..abc3c2b6 100644 --- a/apis/realtime.go +++ b/apis/realtime.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "errors" - "log" + "log/slog" "net/http" "strings" "time" @@ -51,8 +51,12 @@ func (api *realtimeApi) connect(c echo.Context) error { Client: client, } - if err := api.app.OnRealtimeDisconnectRequest().Trigger(disconnectEvent); err != nil && api.app.IsDebug() { - log.Println(err) + if err := api.app.OnRealtimeDisconnectRequest().Trigger(disconnectEvent); err != nil { + api.app.Logger().Debug( + "OnRealtimeDisconnectRequest error", + slog.String("clientId", client.Id()), + slog.String("error", err.Error()), + ) } api.app.SubscriptionsBroker().Unregister(client.Id()) @@ -74,9 +78,7 @@ func (api *realtimeApi) connect(c echo.Context) error { return err } - if api.app.IsDebug() { - log.Printf("Realtime connection established: %s\n", client.Id()) - } + api.app.Logger().Debug("Realtime connection established.", slog.String("clientId", client.Id())) // signalize established connection (aka. fire "connect" message) connectMsgEvent := &core.RealtimeMessageEvent{ @@ -98,9 +100,11 @@ func (api *realtimeApi) connect(c echo.Context) error { return api.app.OnRealtimeAfterMessageSend().Trigger(e) }) if connectMsgErr != nil { - if api.app.IsDebug() { - log.Println("Realtime connection closed (failed to deliver PB_CONNECT):", client.Id(), connectMsgErr) - } + api.app.Logger().Debug( + "Realtime connection closed (failed to deliver PB_CONNECT)", + slog.String("clientId", client.Id()), + slog.String("error", connectMsgErr.Error()), + ) return nil } @@ -116,9 +120,10 @@ func (api *realtimeApi) connect(c echo.Context) error { case msg, ok := <-client.Channel(): if !ok { // channel is closed - if api.app.IsDebug() { - log.Println("Realtime connection closed (closed channel):", client.Id()) - } + api.app.Logger().Debug( + "Realtime connection closed (closed channel)", + slog.String("clientId", client.Id()), + ) return nil } @@ -138,9 +143,11 @@ func (api *realtimeApi) connect(c echo.Context) error { return api.app.OnRealtimeAfterMessageSend().Trigger(msgEvent) }) if msgErr != nil { - if api.app.IsDebug() { - log.Println("Realtime connection closed (failed to deliver message):", client.Id(), msgErr) - } + api.app.Logger().Debug( + "Realtime connection closed (failed to deliver message)", + slog.String("clientId", client.Id()), + slog.String("error", msgErr.Error()), + ) return nil } @@ -148,9 +155,10 @@ func (api *realtimeApi) connect(c echo.Context) error { idleTimer.Reset(idleTimeout) case <-c.Request().Context().Done(): // connection is closed - if api.app.IsDebug() { - log.Println("Realtime connection closed (cancelled request):", client.Id()) - } + api.app.Logger().Debug( + "Realtime connection closed (cancelled request)", + slog.String("clientId", client.Id()), + ) return nil } } @@ -267,8 +275,13 @@ func (api *realtimeApi) bindEvents() { api.app.OnModelAfterCreate().PreAdd(func(e *core.ModelEvent) error { if record := api.resolveRecord(e.Model); record != nil { - if err := api.broadcastRecord("create", record, false); err != nil && api.app.IsDebug() { - log.Println(err) + if err := api.broadcastRecord("create", record, false); err != nil { + api.app.Logger().Debug( + "Failed to broadcast record create", + slog.String("id", record.Id), + slog.String("collectionName", record.Collection().Name), + slog.String("error", err.Error()), + ) } } return nil @@ -276,8 +289,13 @@ func (api *realtimeApi) bindEvents() { api.app.OnModelAfterUpdate().PreAdd(func(e *core.ModelEvent) error { if record := api.resolveRecord(e.Model); record != nil { - if err := api.broadcastRecord("update", record, false); err != nil && api.app.IsDebug() { - log.Println(err) + if err := api.broadcastRecord("update", record, false); err != nil { + api.app.Logger().Debug( + "Failed to broadcast record update", + slog.String("id", record.Id), + slog.String("collectionName", record.Collection().Name), + slog.String("error", err.Error()), + ) } } return nil @@ -285,8 +303,13 @@ func (api *realtimeApi) bindEvents() { api.app.OnModelBeforeDelete().Add(func(e *core.ModelEvent) error { if record := api.resolveRecord(e.Model); record != nil { - if err := api.broadcastRecord("delete", record, true); err != nil && api.app.IsDebug() { - log.Println(err) + if err := api.broadcastRecord("delete", record, true); err != nil { + api.app.Logger().Debug( + "Failed to dry cache record delete", + slog.String("id", record.Id), + slog.String("collectionName", record.Collection().Name), + slog.String("error", err.Error()), + ) } } return nil @@ -294,8 +317,13 @@ func (api *realtimeApi) bindEvents() { api.app.OnModelAfterDelete().Add(func(e *core.ModelEvent) error { if record := api.resolveRecord(e.Model); record != nil { - if err := api.broadcastDryCachedRecord("delete", record); err != nil && api.app.IsDebug() { - log.Println(err) + if err := api.broadcastDryCachedRecord("delete", record); err != nil { + api.app.Logger().Debug( + "Failed to broadcast record delete", + slog.String("id", record.Id), + slog.String("collectionName", record.Collection().Name), + slog.String("error", err.Error()), + ) } } return nil @@ -389,8 +417,15 @@ func (api *realtimeApi) broadcastRecord(action string, record *models.Record, dr rawExpand := cast.ToString(options.Query[expandQueryParam]) if rawExpand != "" { expandErrs := api.app.Dao().ExpandRecord(cleanRecord, strings.Split(rawExpand, ","), expandFetch(api.app.Dao(), requestInfo)) - if api.app.IsDebug() && len(expandErrs) > 0 { - log.Println("[broadcastRecord] expand errors", expandErrs) + if len(expandErrs) > 0 { + api.app.Logger().Debug( + "[broadcastRecord] expand errors", + slog.String("id", cleanRecord.Id), + slog.String("collectionName", cleanRecord.Collection().Name), + slog.String("sub", sub), + slog.String("expand", rawExpand), + slog.Any("errors", expandErrs), + ) } } @@ -416,14 +451,26 @@ func (api *realtimeApi) broadcastRecord(action string, record *models.Record, dr decoded, err := rest.PickFields(cleanRecord, rawFields) if err == nil { data.Record = decoded - } else if api.app.IsDebug() { - log.Println(err) + } else { + api.app.Logger().Debug( + "[broadcastRecord] pick fields error", + slog.String("id", cleanRecord.Id), + slog.String("collectionName", cleanRecord.Collection().Name), + slog.String("sub", sub), + slog.String("fields", rawFields), + slog.String("error", err.Error()), + ) } } dataBytes, err := json.Marshal(data) - if err != nil && api.app.IsDebug() { - log.Println("[broadcastRecord] data marshal error", err) + if err != nil { + api.app.Logger().Debug( + "[broadcastRecord] data marshal error", + slog.String("id", cleanRecord.Id), + slog.String("collectionName", cleanRecord.Collection().Name), + slog.String("error", err.Error()), + ) continue } diff --git a/apis/record_auth.go b/apis/record_auth.go index c2b7b84e..444c94a6 100644 --- a/apis/record_auth.go +++ b/apis/record_auth.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" "fmt" - "log" + "log/slog" "net/http" "github.com/labstack/echo/v5" @@ -111,16 +111,16 @@ func (api *recordAuthApi) authMethods(c echo.Context) error { provider, err := auth.NewProviderByName(name) if err != nil { - if api.app.IsDebug() { - log.Println(err) - } + api.app.Logger().Debug("Missing or invalid provier name", slog.String("name", name)) continue // skip provider } if err := config.SetupProvider(provider); err != nil { - if api.app.IsDebug() { - log.Println(err) - } + api.app.Logger().Debug( + "Failed to setup provider", + slog.String("name", name), + slog.String("error", err.Error()), + ) continue // skip provider } @@ -327,8 +327,11 @@ func (api *recordAuthApi) requestPasswordReset(c echo.Context) error { return api.app.OnRecordBeforeRequestPasswordResetRequest().Trigger(event, func(e *core.RecordRequestPasswordResetEvent) error { // run in background because we don't need to show the result to the client routine.FireAndForget(func() { - if err := next(e.Record); err != nil && api.app.IsDebug() { - log.Println(err) + if err := next(e.Record); err != nil { + api.app.Logger().Debug( + "Failed to send password reset email", + slog.String("error", err.Error()), + ) } }) @@ -416,8 +419,11 @@ func (api *recordAuthApi) requestVerification(c echo.Context) error { return api.app.OnRecordBeforeRequestVerificationRequest().Trigger(event, func(e *core.RecordRequestVerificationEvent) error { // run in background because we don't need to show the result to the client routine.FireAndForget(func() { - if err := next(e.Record); err != nil && api.app.IsDebug() { - log.Println(err) + if err := next(e.Record); err != nil { + api.app.Logger().Debug( + "Failed to send verification email", + slog.String("error", err.Error()), + ) } }) diff --git a/apis/record_auth_test.go b/apis/record_auth_test.go index 8cdad322..b09d931a 100644 --- a/apis/record_auth_test.go +++ b/apis/record_auth_test.go @@ -898,7 +898,7 @@ func TestRecordAuthRequestEmailChange(t *testing.T) { ExpectedStatus: 400, ExpectedContent: []string{ `"data":`, - `"newEmail":{"code":"validation_record_email_exists"`, + `"newEmail":{"code":"validation_record_email_invalid"`, }, }, { diff --git a/apis/record_crud.go b/apis/record_crud.go index 600148e3..3568557a 100644 --- a/apis/record_crud.go +++ b/apis/record_crud.go @@ -2,7 +2,7 @@ package apis import ( "fmt" - "log" + "log/slog" "net/http" "strings" @@ -88,8 +88,8 @@ func (api *recordApi) list(c echo.Context) error { return nil } - if err := EnrichRecords(e.HttpContext, api.app.Dao(), e.Records); err != nil && api.app.IsDebug() { - log.Println(err) + if err := EnrichRecords(e.HttpContext, api.app.Dao(), e.Records); err != nil { + api.app.Logger().Debug("Failed to enrich list records", slog.String("error", err.Error())) } return e.HttpContext.JSON(http.StatusOK, e.Result) @@ -142,8 +142,13 @@ func (api *recordApi) view(c echo.Context) error { return nil } - if err := EnrichRecord(e.HttpContext, api.app.Dao(), e.Record); err != nil && api.app.IsDebug() { - log.Println(err) + if err := EnrichRecord(e.HttpContext, api.app.Dao(), e.Record); err != nil { + api.app.Logger().Debug( + "Failed to enrich view record", + slog.String("id", e.Record.Id), + slog.String("collectionName", e.Record.Collection().Name), + slog.String("error", err.Error()), + ) } return e.HttpContext.JSON(http.StatusOK, e.Record) @@ -235,8 +240,13 @@ func (api *recordApi) create(c echo.Context) error { return NewBadRequestError("Failed to create record.", err) } - if err := EnrichRecord(e.HttpContext, api.app.Dao(), e.Record); err != nil && api.app.IsDebug() { - log.Println(err) + if err := EnrichRecord(e.HttpContext, api.app.Dao(), e.Record); err != nil { + api.app.Logger().Debug( + "Failed to enrich create record", + slog.String("id", e.Record.Id), + slog.String("collectionName", e.Record.Collection().Name), + slog.String("error", err.Error()), + ) } return api.app.OnRecordAfterCreateRequest().Trigger(event, func(e *core.RecordCreateEvent) error { @@ -322,8 +332,13 @@ func (api *recordApi) update(c echo.Context) error { return NewBadRequestError("Failed to update record.", err) } - if err := EnrichRecord(e.HttpContext, api.app.Dao(), e.Record); err != nil && api.app.IsDebug() { - log.Println(err) + if err := EnrichRecord(e.HttpContext, api.app.Dao(), e.Record); err != nil { + api.app.Logger().Debug( + "Failed to enrich update record", + slog.String("id", e.Record.Id), + slog.String("collectionName", e.Record.Collection().Name), + slog.String("error", err.Error()), + ) } return api.app.OnRecordAfterUpdateRequest().Trigger(event, func(e *core.RecordUpdateEvent) error { diff --git a/apis/record_helpers.go b/apis/record_helpers.go index 3c8d3205..bf3f4cbd 100644 --- a/apis/record_helpers.go +++ b/apis/record_helpers.go @@ -3,6 +3,7 @@ package apis import ( "fmt" "log" + "log/slog" "net/http" "strings" @@ -108,8 +109,8 @@ func RecordAuthResponse( expands, expandFetch(app.Dao(), &requestInfo), ) - if len(failed) > 0 && app.IsDebug() { - log.Println("Failed to expand relations: ", failed) + if len(failed) > 0 { + app.Logger().Debug("[RecordAuthResponse] Failed to expand relations", slog.Any("errors", failed)) } } diff --git a/apis/serve.go b/apis/serve.go index c5d6384d..81fac6be 100644 --- a/apis/serve.go +++ b/apis/serve.go @@ -191,7 +191,7 @@ func Serve(app core.App, config ServeConfig) (*http.Server, error) { // try to gracefully shutdown the server on app termination app.OnTerminate().Add(func(e *core.TerminateEvent) error { - ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() server.Shutdown(ctx) return nil diff --git a/core/app.go b/core/app.go index 6e1e6616..1db2381f 100644 --- a/core/app.go +++ b/core/app.go @@ -5,6 +5,7 @@ package core import ( "context" + "log/slog" "github.com/pocketbase/dbx" "github.com/pocketbase/pocketbase/daos" @@ -48,6 +49,9 @@ type App interface { // the users table from LogsDao will result in error. LogsDao() *daos.Dao + // Logger returns the active app logger. + Logger() *slog.Logger + // DataDir returns the app data directory path. DataDir() string @@ -55,16 +59,15 @@ type App interface { // (used for settings encryption). EncryptionEnv() string - // IsDebug returns whether the app is in debug mode - // (showing more detailed error logs, executed sql statements, etc.). - IsDebug() bool - // Settings returns the loaded app settings. Settings() *settings.Settings - // Cache returns the app internal cache store. + // Deprecated: Use app.Store() instead. Cache() *store.Store[any] + // Store returns the app runtime store. + Store() *store.Store[any] + // SubscriptionsBroker returns the app realtime subscriptions broker instance. SubscriptionsBroker() *subscriptions.Broker diff --git a/core/base.go b/core/base.go index 4ed8f099..c55edcd5 100644 --- a/core/base.go +++ b/core/base.go @@ -5,6 +5,7 @@ import ( "database/sql" "errors" "log" + "log/slog" "os" "path/filepath" "runtime" @@ -18,10 +19,14 @@ import ( "github.com/pocketbase/pocketbase/models/settings" "github.com/pocketbase/pocketbase/tools/filesystem" "github.com/pocketbase/pocketbase/tools/hook" + "github.com/pocketbase/pocketbase/tools/logger" "github.com/pocketbase/pocketbase/tools/mailer" "github.com/pocketbase/pocketbase/tools/routine" + "github.com/pocketbase/pocketbase/tools/security" "github.com/pocketbase/pocketbase/tools/store" "github.com/pocketbase/pocketbase/tools/subscriptions" + "github.com/pocketbase/pocketbase/tools/types" + "github.com/spf13/cast" ) const ( @@ -39,8 +44,9 @@ var _ App = (*BaseApp)(nil) // BaseApp implements core.App and defines the base PocketBase app structure. type BaseApp struct { + // @todo consider introducing a mutex to allow safe concurrent config changes during runtime + // configurable parameters - isDebug bool dataDir string encryptionEnv string dataMaxOpenConns int @@ -49,11 +55,12 @@ type BaseApp struct { logsMaxIdleConns int // internals - cache *store.Store[any] + store *store.Store[any] settings *settings.Settings dao *daos.Dao logsDao *daos.Dao subscriptionsBroker *subscriptions.Broker + logger *slog.Logger // app event hooks onBeforeBootstrap *hook.Hook[*BootstrapEvent] @@ -169,7 +176,6 @@ type BaseApp struct { type BaseAppConfig struct { DataDir string EncryptionEnv string - IsDebug bool DataMaxOpenConns int // default to 500 DataMaxIdleConns int // default 20 LogsMaxOpenConns int // default to 100 @@ -183,13 +189,12 @@ type BaseAppConfig struct { func NewBaseApp(config BaseAppConfig) *BaseApp { app := &BaseApp{ dataDir: config.DataDir, - isDebug: config.IsDebug, encryptionEnv: config.EncryptionEnv, dataMaxOpenConns: config.DataMaxOpenConns, dataMaxIdleConns: config.DataMaxIdleConns, logsMaxOpenConns: config.LogsMaxOpenConns, logsMaxIdleConns: config.LogsMaxIdleConns, - cache: store.New[any](nil), + store: store.New[any](nil), settings: settings.New(), subscriptionsBroker: subscriptions.NewBroker(), @@ -314,6 +319,17 @@ func (app *BaseApp) IsBootstrapped() bool { return app.dao != nil && app.logsDao != nil && app.settings != nil } +// Logger returns the default app logger. +// +// If the application is not bootstrapped yet, fallbacks to slog.Default(). +func (app *BaseApp) Logger() *slog.Logger { + if app.logger == nil { + return slog.Default() + } + + return app.logger +} + // Bootstrap initializes the application // (aka. create data dir, open db connections, load settings, etc.). // @@ -343,6 +359,10 @@ func (app *BaseApp) Bootstrap() error { return err } + if err := app.initLogger(); err != nil { + return err + } + // we don't check for an error because the db migrations may have not been executed yet app.RefreshSettings() @@ -438,20 +458,20 @@ func (app *BaseApp) EncryptionEnv() string { return app.encryptionEnv } -// IsDebug returns whether the app is in debug mode -// (showing more detailed error logs, executed sql statements, etc.). -func (app *BaseApp) IsDebug() bool { - return app.isDebug -} - // Settings returns the loaded app settings. func (app *BaseApp) Settings() *settings.Settings { return app.settings } -// Cache returns the app internal cache store. +// Deprecated: Use app.Store() instead. func (app *BaseApp) Cache() *store.Store[any] { - return app.cache + color.Yellow("app.Store() is soft-deprecated. Please replace it with app.Store().") + return app.Store() +} + +// Store returns the app internal runtime store. +func (app *BaseApp) Store() *store.Store[any] { + return app.store } // SubscriptionsBroker returns the app realtime subscriptions broker instance. @@ -569,6 +589,11 @@ func (app *BaseApp) RefreshSettings() error { return err } + // reload handler level (if initialized) + if h, ok := app.Logger().Handler().(*logger.BatchHandler); ok { + h.SetLevel(slog.Level(app.settings.Logs.MinLevel)) + } + return nil } @@ -988,7 +1013,7 @@ func (app *BaseApp) initLogsDB() error { } concurrentDB.DB().SetMaxOpenConns(maxOpenConns) concurrentDB.DB().SetMaxIdleConns(maxIdleConns) - concurrentDB.DB().SetConnMaxIdleTime(5 * time.Minute) + concurrentDB.DB().SetConnMaxIdleTime(3 * time.Minute) nonconcurrentDB, err := connectDB(filepath.Join(app.DataDir(), "logs.db")) if err != nil { @@ -996,7 +1021,7 @@ func (app *BaseApp) initLogsDB() error { } nonconcurrentDB.DB().SetMaxOpenConns(1) nonconcurrentDB.DB().SetMaxIdleConns(1) - nonconcurrentDB.DB().SetConnMaxIdleTime(5 * time.Minute) + nonconcurrentDB.DB().SetConnMaxIdleTime(3 * time.Minute) app.logsDao = daos.NewMultiDB(concurrentDB, nonconcurrentDB) @@ -1019,7 +1044,7 @@ func (app *BaseApp) initDataDB() error { } concurrentDB.DB().SetMaxOpenConns(maxOpenConns) concurrentDB.DB().SetMaxIdleConns(maxIdleConns) - concurrentDB.DB().SetConnMaxIdleTime(5 * time.Minute) + concurrentDB.DB().SetConnMaxIdleTime(3 * time.Minute) nonconcurrentDB, err := connectDB(filepath.Join(app.DataDir(), "data.db")) if err != nil { @@ -1027,19 +1052,17 @@ func (app *BaseApp) initDataDB() error { } nonconcurrentDB.DB().SetMaxOpenConns(1) nonconcurrentDB.DB().SetMaxIdleConns(1) - nonconcurrentDB.DB().SetConnMaxIdleTime(5 * time.Minute) + nonconcurrentDB.DB().SetConnMaxIdleTime(3 * time.Minute) - if app.IsDebug() { - nonconcurrentDB.QueryLogFunc = func(ctx context.Context, t time.Duration, sql string, rows *sql.Rows, err error) { - color.HiBlack("[%.2fms] %v\n", float64(t.Milliseconds()), sql) - } - concurrentDB.QueryLogFunc = nonconcurrentDB.QueryLogFunc - - nonconcurrentDB.ExecLogFunc = func(ctx context.Context, t time.Duration, sql string, result sql.Result, err error) { - color.HiBlack("[%.2fms] %v\n", float64(t.Milliseconds()), sql) - } - concurrentDB.ExecLogFunc = nonconcurrentDB.ExecLogFunc - } + // @todo benchmark whether it will have an impact if always enabled as TRACE log + // nonconcurrentDB.QueryLogFunc = func(ctx context.Context, t time.Duration, sql string, rows *sql.Rows, err error) { + // color.HiBlack("[%.2fms] %v\n", float64(t.Milliseconds()), sql) + // } + // concurrentDB.QueryLogFunc = nonconcurrentDB.QueryLogFunc + // nonconcurrentDB.ExecLogFunc = func(ctx context.Context, t time.Duration, sql string, result sql.Result, err error) { + // color.HiBlack("[%.2fms] %v\n", float64(t.Milliseconds()), sql) + // } + // concurrentDB.ExecLogFunc = nonconcurrentDB.ExecLogFunc app.dao = app.createDaoWithHooks(concurrentDB, nonconcurrentDB) @@ -1129,14 +1152,13 @@ func (app *BaseApp) registerDefaultHooks() { // run in the background for "optimistic" delete to avoid // blocking the delete transaction - // - // @todo consider creating a bg process queue so that the - // call could be "retried" in case of a failure. routine.FireAndForget(func() { - if err := deletePrefix(prefix); err != nil && app.IsDebug() { - // non critical error - only log for debug - // (usually could happen because of S3 api limits) - log.Println(err) + if err := deletePrefix(prefix); err != nil { + app.Logger().Error( + "Failed to delete storage prefix (non critical error; usually could happen because of S3 api limits)", + slog.String("prefix", prefix), + slog.String("error", err.Error()), + ) } }) } @@ -1144,12 +1166,94 @@ func (app *BaseApp) registerDefaultHooks() { return nil }) - app.OnTerminate().Add(func(e *TerminateEvent) error { - app.ResetBootstrapState() + if err := app.initAutobackupHooks(); err != nil { + app.Logger().Error("Failed to init auto backup hooks", slog.String("error", err.Error())) + } +} + +func (app *BaseApp) initLogger() error { + duration := 3 * time.Second + ticker := time.NewTicker(duration) + done := make(chan bool) + + level := slog.LevelInfo + if app.Settings() != nil { + level = slog.Level(app.Settings().Logs.MinLevel) + } + + handler := logger.NewBatchHandler(logger.BatchOptions{ + Level: level, + BatchSize: 200, + BeforeAddFunc: func(ctx context.Context, log *logger.Log) bool { + ticker.Reset(duration) + return true + }, + WriteFunc: func(ctx context.Context, logs []*logger.Log) error { + if !app.IsBootstrapped() { + return nil + } + + // write the accumulated logs + // (note: based on several local tests there is no significant performance difference between small number of separate write queries vs 1 big INSERT) + app.LogsDao().RunInTransaction(func(txDao *daos.Dao) error { + model := &models.Log{} + for _, l := range logs { + model.MarkAsNew() + // note: using pseudorandom for a slightly better performance + model.Id = security.PseudorandomStringWithAlphabet(models.DefaultIdLength, models.DefaultIdAlphabet) + model.Level = int(l.Level) + model.Message = l.Message + model.Data = l.Data + model.Created, _ = types.ParseDateTime(l.Time) + model.Updated = model.Created + + if err := txDao.SaveLog(model); err != nil { + log.Println("Failed to write log", model, err) + } + } + + return nil + }) + + // delete old logs + // --- + logsMaxDays := app.Settings().Logs.MaxDays + now := time.Now() + lastLogsDeletedAt := cast.ToTime(app.Store().Get("lastLogsDeletedAt")) + daysDiff := now.Sub(lastLogsDeletedAt).Hours() * 24 + if daysDiff > float64(logsMaxDays) { + deleteErr := app.LogsDao().DeleteOldLogs(now.AddDate(0, 0, -1*logsMaxDays)) + if deleteErr == nil { + app.Store().Set("lastLogsDeletedAt", now) + } else { + log.Println("Logs delete failed", deleteErr) + } + } + + return nil + }, + }) + + ctx := context.Background() + + go func() { + for { + select { + case <-done: + handler.WriteAll(ctx) + case <-ticker.C: + handler.WriteAll(ctx) + } + } + }() + + app.logger = slog.New(handler) + + app.OnTerminate().PreAdd(func(e *TerminateEvent) error { + ticker.Stop() + done <- true return nil }) - if err := app.initAutobackupHooks(); err != nil && app.IsDebug() { - log.Println(err) - } + return nil } diff --git a/core/base_backup.go b/core/base_backup.go index 48fad17d..c624d28c 100644 --- a/core/base_backup.go +++ b/core/base_backup.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" "io" - "log" + "log/slog" "os" "path/filepath" "runtime" @@ -22,8 +22,11 @@ import ( "github.com/pocketbase/pocketbase/tools/security" ) +// Deprecated: Replaced with StoreKeyActiveBackup. const CacheKeyActiveBackup string = "@activeBackup" +const StoreKeyActiveBackup string = "@activeBackup" + // CreateBackup creates a new backup of the current app pb_data directory. // // If name is empty, it will be autogenerated. @@ -43,7 +46,7 @@ const CacheKeyActiveBackup string = "@activeBackup" // // Backups can be stored on S3 if it is configured in app.Settings().Backups. func (app *BaseApp) CreateBackup(ctx context.Context, name string) error { - if app.Cache().Has(CacheKeyActiveBackup) { + if app.Store().Has(StoreKeyActiveBackup) { return errors.New("try again later - another backup/restore operation has already been started") } @@ -51,8 +54,8 @@ func (app *BaseApp) CreateBackup(ctx context.Context, name string) error { name = app.generateBackupName("pb_backup_") } - app.Cache().Set(CacheKeyActiveBackup, name) - defer app.Cache().Remove(CacheKeyActiveBackup) + app.Store().Set(StoreKeyActiveBackup, name) + defer app.Store().Remove(StoreKeyActiveBackup) // root dir entries to exclude from the backup generation exclude := []string{LocalBackupsDirName, LocalTempDirName} @@ -135,12 +138,12 @@ func (app *BaseApp) RestoreBackup(ctx context.Context, name string) error { return errors.New("restore is not supported on windows") } - if app.Cache().Has(CacheKeyActiveBackup) { + if app.Store().Has(StoreKeyActiveBackup) { return errors.New("try again later - another backup/restore operation has already been started") } - app.Cache().Set(CacheKeyActiveBackup, name) - defer app.Cache().Remove(CacheKeyActiveBackup) + app.Store().Set(StoreKeyActiveBackup, name) + defer app.Store().Remove(StoreKeyActiveBackup) fsys, err := app.NewBackupsFilesystem() if err != nil { @@ -189,8 +192,12 @@ func (app *BaseApp) RestoreBackup(ctx context.Context, name string) error { // remove the extracted zip file since we no longer need it // (this is in case the app restarts and the defer calls are not called) - if err := os.Remove(tempZip.Name()); err != nil && app.IsDebug() { - log.Println(err) + if err := os.Remove(tempZip.Name()); err != nil { + app.Logger().Debug( + "[RestoreBackup] Failed to remove the temp zip backup file", + slog.String("file", tempZip.Name()), + slog.String("error", err.Error()), + ) } // root dir entries to exclude from the backup restore @@ -223,8 +230,8 @@ func (app *BaseApp) RestoreBackup(ctx context.Context, name string) error { // restart the app if err := app.Restart(); err != nil { - if err := revertDataDirChanges(); err != nil { - panic(err) + if revertErr := revertDataDirChanges(); revertErr != nil { + panic(revertErr) } return fmt.Errorf("failed to restart the app process: %w", err) @@ -251,9 +258,12 @@ func (app *BaseApp) initAutobackupHooks() error { name := app.generateBackupName(autoPrefix) - if err := app.CreateBackup(context.Background(), name); err != nil && app.IsDebug() { - // @todo replace after logs generalization - log.Println(err) + if err := app.CreateBackup(context.Background(), name); err != nil { + app.Logger().Debug( + "[Backup cron] Failed to create backup", + slog.String("name", name), + slog.String("error", err.Error()), + ) } maxKeep := app.Settings().Backups.CronMaxKeep @@ -263,17 +273,21 @@ func (app *BaseApp) initAutobackupHooks() error { } fsys, err := app.NewBackupsFilesystem() - if err != nil && app.IsDebug() { - // @todo replace after logs generalization - log.Println(err) + if err != nil { + app.Logger().Debug( + "[Backup cron] Failed to initialize the backup filesystem", + slog.String("error", err.Error()), + ) return } defer fsys.Close() files, err := fsys.List(autoPrefix) - if err != nil && app.IsDebug() { - // @todo replace after logs generalization - log.Println(err) + if err != nil { + app.Logger().Debug( + "[Backup cron] Failed to list autogenerated backups", + slog.String("error", err.Error()), + ) return } @@ -290,9 +304,12 @@ func (app *BaseApp) initAutobackupHooks() error { toRemove := files[maxKeep:] for _, f := range toRemove { - if err := fsys.Delete(f.Key); err != nil && app.IsDebug() { - // @todo replace after logs generalization - log.Println(err) + if err := fsys.Delete(f.Key); err != nil { + app.Logger().Debug( + "[Backup cron] Failed to remove old autogenerated backup", + slog.String("key", f.Key), + slog.String("error", err.Error()), + ) } } }) diff --git a/core/base_backup_test.go b/core/base_backup_test.go index 5125c6fd..da4f93b5 100644 --- a/core/base_backup_test.go +++ b/core/base_backup_test.go @@ -25,11 +25,11 @@ func TestCreateBackup(t *testing.T) { expectedAppNamePrefix := "test_" + strings.Repeat("a", 45) // test pending error - app.Cache().Set(core.CacheKeyActiveBackup, "") + app.Store().Set(core.StoreKeyActiveBackup, "") if err := app.CreateBackup(context.Background(), "test.zip"); err == nil { t.Fatal("Expected pending error, got nil") } - app.Cache().Remove(core.CacheKeyActiveBackup) + app.Store().Remove(core.StoreKeyActiveBackup) // create with auto generated name if err := app.CreateBackup(context.Background(), ""); err != nil { @@ -98,11 +98,11 @@ func TestRestoreBackup(t *testing.T) { } // test pending error - app.Cache().Set(core.CacheKeyActiveBackup, "") + app.Store().Set(core.StoreKeyActiveBackup, "") if err := app.RestoreBackup(context.Background(), "test"); err == nil { t.Fatal("Expected pending error, got nil") } - app.Cache().Remove(core.CacheKeyActiveBackup) + app.Store().Remove(core.StoreKeyActiveBackup) // missing backup if err := app.RestoreBackup(context.Background(), "missing"); err == nil { diff --git a/core/base_test.go b/core/base_test.go index 1c7f1f01..714a7151 100644 --- a/core/base_test.go +++ b/core/base_test.go @@ -3,8 +3,12 @@ package core import ( "os" "testing" + "time" + "github.com/pocketbase/pocketbase/migrations/logs" + "github.com/pocketbase/pocketbase/tools/logger" "github.com/pocketbase/pocketbase/tools/mailer" + "github.com/pocketbase/pocketbase/tools/migrate" ) func TestNewBaseApp(t *testing.T) { @@ -14,7 +18,6 @@ func TestNewBaseApp(t *testing.T) { app := NewBaseApp(BaseAppConfig{ DataDir: testDataDir, EncryptionEnv: "test_env", - IsDebug: true, }) if app.dataDir != testDataDir { @@ -25,12 +28,8 @@ func TestNewBaseApp(t *testing.T) { t.Fatalf("expected encryptionEnv test_env, got %q", app.dataDir) } - if !app.isDebug { - t.Fatalf("expected isDebug true, got %v", app.isDebug) - } - - if app.cache == nil { - t.Fatal("expected cache to be set, got nil") + if app.store == nil { + t.Fatal("expected store to be set, got nil") } if app.settings == nil { @@ -49,7 +48,6 @@ func TestBaseAppBootstrap(t *testing.T) { app := NewBaseApp(BaseAppConfig{ DataDir: testDataDir, EncryptionEnv: "pb_test_env", - IsDebug: false, }) defer app.ResetBootstrapState() @@ -57,7 +55,6 @@ func TestBaseAppBootstrap(t *testing.T) { t.Fatal("Didn't expect the application to be bootstrapped.") } - // bootstrap if err := app.Bootstrap(); err != nil { t.Fatal(err) } @@ -106,6 +103,14 @@ func TestBaseAppBootstrap(t *testing.T) { t.Fatal("Expected app.settings to be initialized, got nil.") } + if app.logger == nil { + t.Fatal("Expected app.logger to be initialized, got nil.") + } + + if _, ok := app.logger.Handler().(*logger.BatchHandler); !ok { + t.Fatal("Expected app.logger handler to be initialized.") + } + // reset if err := app.ResetBootstrapState(); err != nil { t.Fatal(err) @@ -127,7 +132,6 @@ func TestBaseAppGetters(t *testing.T) { app := NewBaseApp(BaseAppConfig{ DataDir: testDataDir, EncryptionEnv: "pb_test_env", - IsDebug: false, }) defer app.ResetBootstrapState() @@ -159,16 +163,16 @@ func TestBaseAppGetters(t *testing.T) { t.Fatalf("Expected app.EncryptionEnv %v, got %v", app.EncryptionEnv(), app.encryptionEnv) } - if app.isDebug != app.IsDebug() { - t.Fatalf("Expected app.IsDebug %v, got %v", app.IsDebug(), app.isDebug) - } - if app.settings != app.Settings() { t.Fatalf("Expected app.Settings %v, got %v", app.Settings(), app.settings) } - if app.cache != app.Cache() { - t.Fatalf("Expected app.Cache %v, got %v", app.Cache(), app.cache) + if app.store != app.Store() { + t.Fatalf("Expected app.Store %v, got %v", app.Store(), app.store) + } + + if app.logger != app.Logger() { + t.Fatalf("Expected app.Logger %v, got %v", app.Logger(), app.logger) } if app.subscriptionsBroker != app.SubscriptionsBroker() { @@ -187,7 +191,6 @@ func TestBaseAppNewMailClient(t *testing.T) { app := NewBaseApp(BaseAppConfig{ DataDir: testDataDir, EncryptionEnv: "pb_test_env", - IsDebug: false, }) client1 := app.NewMailClient() @@ -210,7 +213,6 @@ func TestBaseAppNewFilesystem(t *testing.T) { app := NewBaseApp(BaseAppConfig{ DataDir: testDataDir, EncryptionEnv: "pb_test_env", - IsDebug: false, }) // local @@ -240,7 +242,6 @@ func TestBaseAppNewBackupsFilesystem(t *testing.T) { app := NewBaseApp(BaseAppConfig{ DataDir: testDataDir, EncryptionEnv: "pb_test_env", - IsDebug: false, }) // local @@ -262,3 +263,68 @@ func TestBaseAppNewBackupsFilesystem(t *testing.T) { t.Fatalf("Expected nil s3 backups filesystem, got %v", s3) } } + +func TestBaseAppLoggerWrites(t *testing.T) { + testDataDir, err := os.MkdirTemp("", "logger_writes") + if err != nil { + t.Fatal(err) + } + defer os.RemoveAll(testDataDir) + + app := NewBaseApp(BaseAppConfig{ + DataDir: testDataDir, + }) + + if err := app.Bootstrap(); err != nil { + t.Fatal(err) + } + + // init logs migrations + runner, err := migrate.NewRunner(app.LogsDB(), logs.LogsMigrations) + if err != nil { + t.Fatalf("Logs runner error: %v", err) + } + if _, err := runner.Up(); err != nil { + t.Fatalf("Logs migration execution error: %v", err) + } + + // test batch logs writes + { + threshold := 200 + + for i := 0; i < threshold-1; i++ { + app.Logger().Error("test") + } + + if total := totalLogs(app, t); total != 0 { + t.Fatalf("Expected %d logs, got %d", 0, total) + } + + // should trigger batch write + app.Logger().Error("test") + + // should be added for the next batch write + app.Logger().Error("test") + + if total := totalLogs(app, t); total != threshold { + t.Fatalf("Expected %d logs, got %d", threshold, total) + } + + // wait for ~3 secs to check the timer trigger + time.Sleep(3200 * time.Millisecond) + if total := totalLogs(app, t); total != threshold+1 { + t.Fatalf("Expected %d logs, got %d", threshold+1, total) + } + } +} + +func totalLogs(app App, t *testing.T) int { + var total int + + err := app.LogsDao().LogQuery().Select("count(*)").Row(&total) + if err != nil { + t.Fatalf("Failed to fetch total logs: %v", err) + } + + return total +} diff --git a/daos/base.go b/daos/base.go index 48303f23..373d1eba 100644 --- a/daos/base.go +++ b/daos/base.go @@ -6,7 +6,6 @@ package daos import ( "errors" "fmt" - "strings" "time" "github.com/pocketbase/dbx" @@ -212,13 +211,7 @@ func (dao *Dao) RunInTransaction(fn func(txDao *Dao) error) error { } } if len(errs) > 0 { - // @todo after go 1.20+ upgrade consider replacing with errors.Join() - var errsMsg strings.Builder - for _, err := range errs { - errsMsg.WriteString(err.Error()) - errsMsg.WriteString("; ") - } - return fmt.Errorf("after transaction errors: %s", errsMsg.String()) + return fmt.Errorf("after transaction errors: %w", errors.Join(errs...)) } return nil diff --git a/daos/log.go b/daos/log.go new file mode 100644 index 00000000..eaa11a07 --- /dev/null +++ b/daos/log.go @@ -0,0 +1,67 @@ +package daos + +import ( + "time" + + "github.com/pocketbase/dbx" + "github.com/pocketbase/pocketbase/models" + "github.com/pocketbase/pocketbase/tools/types" +) + +// LogQuery returns a new Log select query. +func (dao *Dao) LogQuery() *dbx.SelectQuery { + return dao.ModelQuery(&models.Log{}) +} + +// FindLogById finds a single Log entry by its id. +func (dao *Dao) FindLogById(id string) (*models.Log, error) { + model := &models.Log{} + + err := dao.LogQuery(). + AndWhere(dbx.HashExp{"id": id}). + Limit(1). + One(model) + + if err != nil { + return nil, err + } + + return model, nil +} + +type LogsStatsItem struct { + Total int `db:"total" json:"total"` + Date types.DateTime `db:"date" json:"date"` +} + +// LogsStats returns hourly grouped requests logs statistics. +func (dao *Dao) LogsStats(expr dbx.Expression) ([]*LogsStatsItem, error) { + result := []*LogsStatsItem{} + + query := dao.LogQuery(). + Select("count(id) as total", "strftime('%Y-%m-%d %H:00:00', created) as date"). + GroupBy("date") + + if expr != nil { + query.AndWhere(expr) + } + + err := query.All(&result) + + return result, err +} + +// DeleteOldLogs delete all requests that are created before createdBefore. +func (dao *Dao) DeleteOldLogs(createdBefore time.Time) error { + formattedDate := createdBefore.UTC().Format(types.DefaultDateLayout) + expr := dbx.NewExp("[[created]] <= {:date}", dbx.Params{"date": formattedDate}) + + _, err := dao.NonconcurrentDB().Delete((&models.Log{}).TableName(), expr).Execute() + + return err +} + +// SaveLog upserts the provided Log model. +func (dao *Dao) SaveLog(log *models.Log) error { + return dao.Save(log) +} diff --git a/daos/request_test.go b/daos/log_test.go similarity index 58% rename from daos/request_test.go rename to daos/log_test.go index e41b8e39..b31f8a43 100644 --- a/daos/request_test.go +++ b/daos/log_test.go @@ -11,23 +11,23 @@ import ( "github.com/pocketbase/pocketbase/tools/types" ) -func TestRequestQuery(t *testing.T) { +func TestLogQuery(t *testing.T) { app, _ := tests.NewTestApp() defer app.Cleanup() - expected := "SELECT {{_requests}}.* FROM `_requests`" + expected := "SELECT {{_logs}}.* FROM `_logs`" - sql := app.Dao().RequestQuery().Build().SQL() + sql := app.Dao().LogQuery().Build().SQL() if sql != expected { t.Errorf("Expected sql %s, got %s", expected, sql) } } -func TestFindRequestById(t *testing.T) { +func TestFindLogById(t *testing.T) { app, _ := tests.NewTestApp() defer app.Cleanup() - tests.MockRequestLogsData(app) + tests.MockLogsData(app) scenarios := []struct { id string @@ -40,7 +40,7 @@ func TestFindRequestById(t *testing.T) { } for i, scenario := range scenarios { - admin, err := app.LogsDao().FindRequestById(scenario.id) + admin, err := app.LogsDao().FindLogById(scenario.id) hasErr := err != nil if hasErr != scenario.expectError { @@ -53,17 +53,17 @@ func TestFindRequestById(t *testing.T) { } } -func TestRequestsStats(t *testing.T) { +func TestLogsStats(t *testing.T) { app, _ := tests.NewTestApp() defer app.Cleanup() - tests.MockRequestLogsData(app) + tests.MockLogsData(app) expected := `[{"total":1,"date":"2022-05-01 10:00:00.000Z"},{"total":1,"date":"2022-05-02 10:00:00.000Z"}]` now := time.Now().UTC().Format(types.DefaultDateLayout) exp := dbx.NewExp("[[created]] <= {:date}", dbx.Params{"date": now}) - result, err := app.LogsDao().RequestsStats(exp) + result, err := app.LogsDao().LogsStats(exp) if err != nil { t.Fatal(err) } @@ -74,20 +74,20 @@ func TestRequestsStats(t *testing.T) { } } -func TestDeleteOldRequests(t *testing.T) { +func TestDeleteOldLogs(t *testing.T) { app, _ := tests.NewTestApp() defer app.Cleanup() - tests.MockRequestLogsData(app) + tests.MockLogsData(app) scenarios := []struct { date string expectedTotal int }{ - {"2022-01-01 10:00:00.000Z", 2}, // no requests to delete before that time - {"2022-05-01 11:00:00.000Z", 1}, // only 1 request should have left - {"2022-05-03 11:00:00.000Z", 0}, // no more requests should have left - {"2022-05-04 11:00:00.000Z", 0}, // no more requests should have left + {"2022-01-01 10:00:00.000Z", 2}, // no logs to delete before that time + {"2022-05-01 11:00:00.000Z", 1}, // only 1 log should have left + {"2022-05-03 11:00:00.000Z", 0}, // no more logs should have left + {"2022-05-04 11:00:00.000Z", 0}, // no more logs should have left } for i, scenario := range scenarios { @@ -96,53 +96,53 @@ func TestDeleteOldRequests(t *testing.T) { t.Errorf("(%d) Date error %v", i, dateErr) } - deleteErr := app.LogsDao().DeleteOldRequests(date) + deleteErr := app.LogsDao().DeleteOldLogs(date) if deleteErr != nil { t.Errorf("(%d) Delete error %v", i, deleteErr) } - // check total remaining requests + // check total remaining logs var total int - countErr := app.LogsDao().RequestQuery().Select("count(*)").Row(&total) + countErr := app.LogsDao().LogQuery().Select("count(*)").Row(&total) if countErr != nil { t.Errorf("(%d) Count error %v", i, countErr) } if total != scenario.expectedTotal { - t.Errorf("(%d) Expected %d remaining requests, got %d", i, scenario.expectedTotal, total) + t.Errorf("(%d) Expected %d remaining logs, got %d", i, scenario.expectedTotal, total) } } } -func TestSaveRequest(t *testing.T) { +func TestSaveLog(t *testing.T) { app, _ := tests.NewTestApp() defer app.Cleanup() - tests.MockRequestLogsData(app) + tests.MockLogsData(app) - // create new request - newRequest := &models.Request{} - newRequest.Method = "get" - newRequest.Meta = types.JsonMap{} - createErr := app.LogsDao().SaveRequest(newRequest) + // create new log + newLog := &models.Log{} + newLog.Level = -4 + newLog.Data = types.JsonMap{} + createErr := app.LogsDao().SaveLog(newLog) if createErr != nil { t.Fatal(createErr) } // check if it was really created - existingRequest, fetchErr := app.LogsDao().FindRequestById(newRequest.Id) + existingLog, fetchErr := app.LogsDao().FindLogById(newLog.Id) if fetchErr != nil { t.Fatal(fetchErr) } - existingRequest.Method = "post" - updateErr := app.LogsDao().SaveRequest(existingRequest) + existingLog.Level = 4 + updateErr := app.LogsDao().SaveLog(existingLog) if updateErr != nil { t.Fatal(updateErr) } // refresh instance to check if it was really updated - existingRequest, _ = app.LogsDao().FindRequestById(existingRequest.Id) - if existingRequest.Method != "post" { - t.Fatalf("Expected request method to be %s, got %s", "post", existingRequest.Method) + existingLog, _ = app.LogsDao().FindLogById(existingLog.Id) + if existingLog.Level != 4 { + t.Fatalf("Expected log level to be %d, got %d", 4, existingLog.Level) } } diff --git a/daos/request.go b/daos/request.go deleted file mode 100644 index 573b8100..00000000 --- a/daos/request.go +++ /dev/null @@ -1,70 +0,0 @@ -package daos - -import ( - "time" - - "github.com/pocketbase/dbx" - "github.com/pocketbase/pocketbase/models" - "github.com/pocketbase/pocketbase/tools/types" -) - -// RequestQuery returns a new Request logs select query. -func (dao *Dao) RequestQuery() *dbx.SelectQuery { - return dao.ModelQuery(&models.Request{}) -} - -// FindRequestById finds a single Request log by its id. -func (dao *Dao) FindRequestById(id string) (*models.Request, error) { - model := &models.Request{} - - err := dao.RequestQuery(). - AndWhere(dbx.HashExp{"id": id}). - Limit(1). - One(model) - - if err != nil { - return nil, err - } - - return model, nil -} - -type RequestsStatsItem struct { - Total int `db:"total" json:"total"` - Date types.DateTime `db:"date" json:"date"` -} - -// RequestsStats returns hourly grouped requests logs statistics. -func (dao *Dao) RequestsStats(expr dbx.Expression) ([]*RequestsStatsItem, error) { - result := []*RequestsStatsItem{} - - query := dao.RequestQuery(). - Select("count(id) as total", "strftime('%Y-%m-%d %H:00:00', created) as date"). - GroupBy("date") - - if expr != nil { - query.AndWhere(expr) - } - - err := query.All(&result) - - return result, err -} - -// DeleteOldRequests delete all requests that are created before createdBefore. -func (dao *Dao) DeleteOldRequests(createdBefore time.Time) error { - m := models.Request{} - tableName := m.TableName() - - formattedDate := createdBefore.UTC().Format(types.DefaultDateLayout) - expr := dbx.NewExp("[[created]] <= {:date}", dbx.Params{"date": formattedDate}) - - _, err := dao.NonconcurrentDB().Delete(tableName, expr).Execute() - - return err -} - -// SaveRequest upserts the provided Request model. -func (dao *Dao) SaveRequest(request *models.Request) error { - return dao.Save(request) -} diff --git a/forms/collections_import.go b/forms/collections_import.go index 70d8be82..bd17833a 100644 --- a/forms/collections_import.go +++ b/forms/collections_import.go @@ -3,7 +3,6 @@ package forms import ( "encoding/json" "fmt" - "log" validation "github.com/go-ozzo/ozzo-validation/v4" "github.com/pocketbase/pocketbase/core" @@ -78,12 +77,9 @@ func (form *CollectionsImport) Submit(interceptors ...InterceptorFunc[[]*models. } // generic/db failure - if form.app.IsDebug() { - log.Println("Internal import failure:", importErr) - } return validation.Errors{"collections": validation.NewError( "collections_import_failure", - "Failed to import the collections configuration.", + "Failed to import the collections configuration. Raw error:\n"+importErr.Error(), )} }) }, interceptors...) diff --git a/forms/collections_import_test.go b/forms/collections_import_test.go index 0d740e70..cd867fad 100644 --- a/forms/collections_import_test.go +++ b/forms/collections_import_test.go @@ -206,7 +206,7 @@ func TestCollectionsImportSubmit(t *testing.T) { expectError: true, expectCollectionsCount: totalCollections, expectEvents: map[string]int{ - "OnModelBeforeDelete": 4, + "OnModelBeforeDelete": 3, }, }, { diff --git a/forms/record_email_change_confirm.go b/forms/record_email_change_confirm.go index 37a7419b..79da8b92 100644 --- a/forms/record_email_change_confirm.go +++ b/forms/record_email_change_confirm.go @@ -128,6 +128,8 @@ func (form *RecordEmailChangeConfirm) Submit(interceptors ...InterceptorFunc[*mo authRecord.SetEmail(newEmail) authRecord.SetVerified(true) + + // @todo consider removing if not necessary anymore authRecord.RefreshTokenKey() // invalidate old tokens interceptorsErr := runInterceptors(authRecord, func(m *models.Record) error { diff --git a/forms/record_email_change_request.go b/forms/record_email_change_request.go index 9f29a74e..f849290a 100644 --- a/forms/record_email_change_request.go +++ b/forms/record_email_change_request.go @@ -54,7 +54,7 @@ func (form *RecordEmailChangeRequest) checkUniqueEmail(value any) error { v, _ := value.(string) if !form.dao.IsRecordValueUnique(form.record.Collection().Id, schema.FieldNameEmail, v) { - return validation.NewError("validation_record_email_exists", "User email already exists.") + return validation.NewError("validation_record_email_invalid", "User email already exists or it is invalid.") } return nil diff --git a/forms/record_upsert.go b/forms/record_upsert.go index f4bfde50..587ff1ca 100644 --- a/forms/record_upsert.go +++ b/forms/record_upsert.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" "fmt" - "log" + "log/slog" "net/http" "regexp" "strings" @@ -200,8 +200,12 @@ func (form *RecordUpsert) extractMultipartFormData( files, err := rest.FindUploadedFiles(r, fullKey) if err != nil || len(files) == 0 { - if err != nil && err != http.ErrMissingFile && form.app.IsDebug() { - log.Printf("%q uploaded file error: %v\n", fullKey, err) + if err != nil && err != http.ErrMissingFile { + form.app.Logger().Debug( + "Uploaded file error", + slog.String("key", fullKey), + slog.String("error", err.Error()), + ) } // skip invalid or missing file(s) @@ -794,8 +798,11 @@ func (form *RecordUpsert) Submit(interceptors ...InterceptorFunc[*models.Record] // // for now fail silently to avoid reupload when `form.Submit()` // is called manually (aka. not from an api request)... - if err := form.processFilesToDelete(); err != nil && form.app.IsDebug() { - log.Println(err) + if err := form.processFilesToDelete(); err != nil { + form.app.Logger().Debug( + "Failed to delete old files", + slog.String("error", err.Error()), + ) } return nil diff --git a/forms/settings_upsert.go b/forms/settings_upsert.go index f3ee47f4..9d14705d 100644 --- a/forms/settings_upsert.go +++ b/forms/settings_upsert.go @@ -4,9 +4,12 @@ import ( "os" "time" + "github.com/pocketbase/dbx" "github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/daos" + "github.com/pocketbase/pocketbase/models" "github.com/pocketbase/pocketbase/models/settings" + "github.com/pocketbase/pocketbase/tools/types" ) // SettingsUpsert is a [settings.Settings] upsert (create/update) form. @@ -58,32 +61,27 @@ func (form *SettingsUpsert) Submit(interceptors ...InterceptorFunc[*settings.Set return runInterceptors(form.Settings, func(s *settings.Settings) error { form.Settings = s - oldSettings, err := form.app.Settings().Clone() - if err != nil { - return err - } - - // eagerly merge the application settings with the form ones - if err := form.app.Settings().Merge(form.Settings); err != nil { - return err - } - // persists settings change encryptionKey := os.Getenv(form.app.EncryptionEnv()) if err := form.dao.SaveSettings(form.Settings, encryptionKey); err != nil { - // try to revert app settings - form.app.Settings().Merge(oldSettings) - return err } - // explicitly trigger old logs deletion - form.app.LogsDao().DeleteOldRequests( - time.Now().AddDate(0, 0, -1*form.Settings.Logs.MaxDays), - ) + // reload app settings + if err := form.app.RefreshSettings(); err != nil { + return err + } + // try to clear old logs not matching the new settings + createdBefore := time.Now().AddDate(0, 0, -1*form.Settings.Logs.MaxDays).UTC().Format(types.DefaultDateLayout) + expr := dbx.NewExp("[[created]] <= {:date} OR [[level]] < {:level}", dbx.Params{ + "date": createdBefore, + "level": form.Settings.Logs.MinLevel, + }) + form.app.LogsDao().NonconcurrentDB().Delete((&models.Log{}).TableName(), expr).Execute() + + // no logs are allowed -> try to reclaim preserved disk space after the previous delete operation if form.Settings.Logs.MaxDays == 0 { - // no logs are allowed -> reclaim preserved disk space after the previous delete operation form.app.LogsDao().Vacuum() } diff --git a/go.mod b/go.mod index bc9dcb9b..5d9a8795 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,15 @@ module github.com/pocketbase/pocketbase -go 1.19 +go 1.21 require ( github.com/AlecAivazis/survey/v2 v2.3.7 - github.com/aws/aws-sdk-go v1.46.6 + github.com/aws/aws-sdk-go v1.47.9 github.com/disintegration/imaging v1.6.2 github.com/domodwyer/mailyak/v3 v3.6.2 github.com/dop251/goja v0.0.0-20230919151941-fc55792775de github.com/dop251/goja_nodejs v0.0.0-20230914102007-198ba9a8b098 - github.com/fatih/color v1.15.0 + github.com/fatih/color v1.16.0 github.com/fsnotify/fsnotify v1.6.0 github.com/gabriel-vasile/mimetype v1.4.3 github.com/ganigeorgiev/fexpr v0.3.0 @@ -17,40 +17,40 @@ require ( github.com/goccy/go-json v0.10.2 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/labstack/echo/v5 v5.0.0-20230722203903-ec5b858dab61 - github.com/mattn/go-sqlite3 v1.14.17 + github.com/mattn/go-sqlite3 v1.14.18 github.com/pocketbase/dbx v1.10.1 github.com/pocketbase/tygoja v0.0.0-20231111102932-5420517293f4 github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 gocloud.dev v0.34.0 golang.org/x/crypto v0.15.0 golang.org/x/net v0.18.0 - golang.org/x/oauth2 v0.13.0 + golang.org/x/oauth2 v0.14.0 golang.org/x/sync v0.5.0 - modernc.org/sqlite v1.26.0 + modernc.org/sqlite v1.27.0 ) require ( github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2 v1.21.2 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14 // indirect - github.com/aws/aws-sdk-go-v2/config v1.19.1 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.43 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.92 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect - github.com/aws/smithy-go v1.15.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.22.2 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 // indirect + github.com/aws/aws-sdk-go-v2/config v1.23.0 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.15.2 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.5 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.6.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.2 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.42.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.17.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.25.1 // indirect + github.com/aws/smithy-go v1.16.0 // indirect github.com/dlclark/regexp2 v1.10.0 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect @@ -71,23 +71,23 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/image v0.13.0 // indirect + golang.org/x/image v0.14.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/sys v0.14.0 // indirect golang.org/x/term v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/time v0.4.0 // indirect golang.org/x/tools v0.15.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - google.golang.org/api v0.148.0 // indirect + google.golang.org/api v0.150.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect lukechampine.com/uint128 v1.3.0 // indirect modernc.org/cc/v3 v3.41.0 // indirect modernc.org/ccgo/v3 v3.16.15 // indirect - modernc.org/libc v1.28.0 // indirect + modernc.org/libc v1.34.2 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.7.2 // indirect modernc.org/opt v0.1.3 // indirect diff --git a/go.sum b/go.sum index d0b99f33..0ecd93f2 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,14 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= +cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= +cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= +cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/iam v1.1.1 h1:lW7fzj15aVIXYHREOqjRBV9PsH0Z6u8Y46a1YGvQP4Y= +cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/storage v1.31.0 h1:+S3LjjEN2zZ+L5hOwj4+1OkGCsLVe0NzpXKQ1pSdTCI= +cloud.google.com/go/storage v1.31.0/go.mod h1:81ams1PrhW16L4kF7qg+4mTq7SRs5HsbDTM0bWvrwJ0= github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -12,59 +17,53 @@ github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDe github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/aws/aws-sdk-go v1.45.25 h1:c4fLlh5sLdK2DCRTY1z0hyuJZU4ygxX8m1FswL6/nF4= -github.com/aws/aws-sdk-go v1.45.25/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.46.6 h1:6wFnNC9hETIZLMf6SOTN7IcclrOGwp/n9SLp8Pjt6E8= -github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= -github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14 h1:Sc82v7tDQ/vdU1WtuSyzZ1I7y/68j//HJ6uozND1IDs= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14/go.mod h1:9NCTOURS8OpxvoAVHq79LK81/zC78hfRWFn+aL0SPcY= -github.com/aws/aws-sdk-go-v2/config v1.18.45 h1:Aka9bI7n8ysuwPeFdm77nfbyHCAKQ3z9ghB3S/38zes= -github.com/aws/aws-sdk-go-v2/config v1.18.45/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= -github.com/aws/aws-sdk-go-v2/config v1.19.1 h1:oe3vqcGftyk40icfLymhhhNysAwk0NfiwkDi2GTPMXs= -github.com/aws/aws-sdk-go-v2/config v1.19.1/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.90 h1:mtJRt80k1oGw7QQPluAx8AZ6u16MyCA2di/lMhagZ7I= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.90/go.mod h1:lYwZTkeMQWPvNU+u7oYArdNhQ8EKiSGU76jVv0w2GH4= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.92 h1:nLA7dGFC6v4P6b+hzqt5GqIGmIuN+jTJzojfdOLXWFE= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.92/go.mod h1:h+ei9z19AhoN+Dac92DwkzfbJ4mFUea92xgl5pKSG0Q= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6 h1:wmGLw2i8ZTlHLw7a9ULGfQbuccw8uIiNr6sol5bFzc8= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6/go.mod h1:Q0Hq2X/NuL7z8b1Dww8rmOFl+jzusKEcyvkKspwdpyc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15 h1:7R8uRYyXzdD71KWVCL78lJZltah6VVznXBazvKjfH58= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15/go.mod h1:26SQUPcTNgV1Tapwdt4a1rOsYRsnBsJHLMPoxK2b0d8= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38 h1:skaFGzv+3kA+v2BPKhuekeb1Hbb105+44r8ASC+q5SE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38/go.mod h1:epIZoRSSbRIwLPJU5F+OldHhwZPBdpDeQkRdCeY3+00= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6 h1:9ulSU5ClouoPIYhDQdg9tpl83d5Yb91PXTKK+17q+ow= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6/go.mod h1:lnc2taBsR9nTlz9meD+lhFZZ9EWY712QHrRflWpTcOA= -github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2 h1:Ll5/YVCOzRB+gxPqs2uD0R7/MyATC0w85626glSKmp4= -github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2/go.mod h1:Zjfqt7KhQK+PO1bbOsFNzKgaq7TcxzmEoDWN8lM0qzQ= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= -github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= -github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/aws-sdk-go v1.47.9 h1:rarTsos0mA16q+huicGx0e560aYRtOucV5z2Mw23JRY= +github.com/aws/aws-sdk-go v1.47.9/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go-v2 v1.22.2 h1:lV0U8fnhAnPz8YcdmZVV60+tr6CakHzqA6P8T46ExJI= +github.com/aws/aws-sdk-go-v2 v1.22.2/go.mod h1:Kd0OJtkW3Q0M0lUWGszapWjEvrXDzRW+D21JNsroB+c= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 h1:hHgLiIrTRtddC0AKcJr5s7i/hLgcpTt+q/FKxf1Zayk= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0/go.mod h1:w4I/v3NOWgD+qvs1NPEwhd++1h3XPHFaVxasfY6HlYQ= +github.com/aws/aws-sdk-go-v2/config v1.23.0 h1:kqzEfGGDIrRJpfJckgwuZfFTbU9NB1jZnRcaO9MpOqE= +github.com/aws/aws-sdk-go-v2/config v1.23.0/go.mod h1:p7wbxKXXjS1GGQOss7VXOazVMFF9bjUGq85/4wR/fSw= +github.com/aws/aws-sdk-go-v2/credentials v1.15.2 h1:rKH7khRMxPdD0u3dHecd0Q7NOVw3EUe7AqdkUOkiOGI= +github.com/aws/aws-sdk-go-v2/credentials v1.15.2/go.mod h1:tXM8wmaeAhfC7nZoCxb0FzM/aRaB1m1WQ7x0qlBLq80= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3 h1:G5KawTAkyHH6WyKQCdHiW4h3PmAXNJpOgwKg3H7sDRE= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.3/go.mod h1:hugKmSFnZB+HgNI1sYGT14BUPZkO6alC/e0AWu+0IAQ= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.5 h1:P/xwilRdRLLg1PzfviDq0Zjb74weOoDCrh8J5lRCQAY= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.5/go.mod h1:9cLHf2IwX6Jyw0KjLVbXly/g6DmzExgUzB1w/AQPGQE= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2 h1:AaQsr5vvGR7rmeSWBtTCcw16tT9r51mWijuCQhzLnq8= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.2/go.mod h1:o1IiRn7CWocIFTXJjGKJDOwxv1ibL53NpcvcqGWyRBA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2 h1:UZx8SXZ0YtzRiALzYAWcjb9Y9hZUR7MBKaBQ5ouOjPs= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.2/go.mod h1:ipuRpcSaklmxR6C39G187TpBAO132gUfleTGccUPs8c= +github.com/aws/aws-sdk-go-v2/internal/ini v1.6.0 h1:hwZB07/beLiCopuRKF0t+dEHmP39iN4YtDh3X5d3hrg= +github.com/aws/aws-sdk-go-v2/internal/ini v1.6.0/go.mod h1:rdAuXeHWhI/zkpYcO5n8WCpaIgY9MUxFyBsuqq3kjyA= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2 h1:pyVrNAf7Hwz0u39dLKN5t+n0+K/3rMYKuiOoIum3AsU= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.2/go.mod h1:mydrfOb9uiOYCxuCPR8YHQNQyGQwUQ7gPMZGBKbH8NY= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 h1:CJxo7ZBbaIzmXfV3hjcx36n9V87gJsIUPJflwqEHl3Q= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0/go.mod h1:yjVfjuY4nD1EW9i387Kau+I6V5cBA5YnC/mWNopjZrI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2 h1:f2LhPofnjcdOQKRtumKjMvIHkfSQ8aH/rwKUDEQ/SB4= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.2/go.mod h1:q+xX0H4OfuWDuBy7y/LDi4v8IBOWuF+vtp8Z6ex+lw4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2 h1:h7j73yuAVVjic8pqswh+L/7r2IHP43QwRyOu6zcCDDE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.2/go.mod h1:H07AHdK5LSy8F7EJUQhoxyiCNkePoHj2D8P2yGTWafo= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.2 h1:gbIaOzpXixUpoPK+js/bCBK1QBDXM22SigsnzGZio0U= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.2/go.mod h1:p+S7RNbdGN8qgHDSg2SCQJ9FeMAmvcETQiVpeGhYnNM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.42.1 h1:o6MCcX1rJW8Y3g+hvg2xpjF6JR6DftuYhfl3Nc1WV9Q= +github.com/aws/aws-sdk-go-v2/service/s3 v1.42.1/go.mod h1:UDtxEWbREX6y4KREapT+jjtjoH0TiVSS6f5nfaY1UaM= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.1 h1:km+ZNjtLtpXYf42RdaDZnNHm9s7SYAuDGTafy6nd89A= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.1/go.mod h1:aHBr3pvBSD5MbzOvQtYutyPLLRPbl/y9x86XyJJnUXQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1 h1:iRFNqZH4a67IqPvK8xxtyQYnyrlsvwmpHOe9r55ggBA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.1/go.mod h1:pTy5WM+6sNv2tB24JNKFtn6EvciQ5k40ZJ0pq/Iaxj0= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.1 h1:txgVXIXWPXyqdiVn92BV6a/rgtpX31HYdsOYj0sVQQQ= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.1/go.mod h1:VAiJiNaoP1L89STFlEMgmHX1bKixY+FaP+TpRFrmyZ4= +github.com/aws/smithy-go v1.16.0 h1:gJZEH/Fqh+RsvlJ1Zt4tVAtV6bKkp3cC+R6FCZMNzik= +github.com/aws/smithy-go v1.16.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY= github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -93,9 +92,10 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= @@ -108,6 +108,7 @@ github.com/go-sourcemap/sourcemap v2.1.3+incompatible h1:W1iEw64niKVGogNgBN3ePyL github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= @@ -138,25 +139,27 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-replayers/grpcreplay v1.1.0 h1:S5+I3zYyZ+GQz68OfbURDdt/+cSMqCK1wrvNx7WBzTE= +github.com/google/go-replayers/grpcreplay v1.1.0/go.mod h1:qzAvJ8/wi57zq7gWqaE6AwLM6miiXUQwP1S+I9icmhk= github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk= +github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/pprof v0.0.0-20230912144702-c363fe2c2ed8 h1:gpptm606MZYGaMHMsB4Srmb6EbW/IVHnt04rcMXnkBQ= github.com/google/pprof v0.0.0-20230912144702-c363fe2c2ed8/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= -github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= @@ -174,6 +177,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -185,26 +189,17 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM= -github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= +github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pocketbase/dbx v1.10.1 h1:cw+vsyfCJD8YObOVeqb93YErnlxwYMkNZ4rwN0G0AaA= github.com/pocketbase/dbx v1.10.1/go.mod h1:xXRCIAKTHMgUCyCKZm55pUOdvFziJjQfXaWKhu2vhMs= -github.com/pocketbase/tygoja v0.0.0-20231014201019-43707ad269de h1:7Zg82unjBJq9/pUKf206UWzoGvjtaPwDXlqIAoYMG/U= -github.com/pocketbase/tygoja v0.0.0-20231014201019-43707ad269de/go.mod h1:dOJ+pCyqm/jRn5kO/TX598J0e5xGDcJAZerK5atCrKI= -github.com/pocketbase/tygoja v0.0.0-20231028131333-2278fd471632 h1:5R+G0Gy05vPxuOVP9Q7Oy4rSIyfcQG5B5FPosnfOTN0= -github.com/pocketbase/tygoja v0.0.0-20231028131333-2278fd471632/go.mod h1:dOJ+pCyqm/jRn5kO/TX598J0e5xGDcJAZerK5atCrKI= -github.com/pocketbase/tygoja v0.0.0-20231028133025-25a94364de58 h1:1Hu0uwRZrgpQchMEMXz+ZAJxV5l+o06L00svTqeP2RQ= -github.com/pocketbase/tygoja v0.0.0-20231028133025-25a94364de58/go.mod h1:dOJ+pCyqm/jRn5kO/TX598J0e5xGDcJAZerK5atCrKI= github.com/pocketbase/tygoja v0.0.0-20231111102932-5420517293f4 h1:85kAYIKrKEeau7WgXg8B7Km8etrVavJAyH7XcR5MkFw= github.com/pocketbase/tygoja v0.0.0-20231111102932-5420517293f4/go.mod h1:dOJ+pCyqm/jRn5kO/TX598J0e5xGDcJAZerK5atCrKI= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -212,11 +207,12 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -228,6 +224,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= @@ -240,21 +237,17 @@ gocloud.dev v0.34.0/go.mod h1:psKOachbnvY3DAOPbsFVmLIErwsbWPUG2H5i65D38vE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg= -golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk= +golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= +golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -267,23 +260,18 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= +golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -298,21 +286,15 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -324,12 +306,10 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= +golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -339,18 +319,14 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= -google.golang.org/api v0.147.0 h1:Can3FaQo9LlVqxJCodNmeZW/ib3/qKAY3rFeXiHo5gc= -google.golang.org/api v0.147.0/go.mod h1:pQ/9j83DcmPd/5C9e2nFOdjjNkDZ1G+zkbK2uvdkJMs= -google.golang.org/api v0.148.0 h1:HBq4TZlN4/1pNcu0geJZ/Q50vIwIXT532UIMYoo0vOs= -google.golang.org/api v0.148.0/go.mod h1:8/TBgwaKjfqTdacOJrOv2+2Q6fBDU1uHKK06oGSkxzU= +google.golang.org/api v0.150.0 h1:Z9k22qD289SZ8gCJrk4DrWXkNjtfvKAUo/l1ma8eBYE= +google.golang.org/api v0.150.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -359,19 +335,17 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 h1:W18sezcAYs+3tDZX4F80yctqa12jcP1PUS2gQu1zTPU= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a h1:a2MQQVoTo96JC9PMGtGBymLp7+/RzpFc2yX/9WfFg1c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U= +google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= +google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -407,22 +381,24 @@ modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= modernc.org/ccgo/v3 v3.16.15 h1:KbDR3ZAVU+wiLyMESPtbtE/Add4elztFyfsWoNTgxS0= modernc.org/ccgo/v3 v3.16.15/go.mod h1:yT7B+/E2m43tmMOT51GMoM98/MtHIcQQSleGnddkUNI= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= -modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= -modernc.org/libc v1.28.0 h1:kHB6LtDBV8DEAK7aZT1vWvP92abW9fb8cjb1P9UTpUE= -modernc.org/libc v1.28.0/go.mod h1:DaG/4Q3LRRdqpiLyP0C2m1B8ZMGkQ+cCgOIjEtQlYhQ= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.34.2 h1:0SVAi/cII7uoNPdzJbDqn4HfxXkp+dGVKVSoJDtMyDM= +modernc.org/libc v1.34.2/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.26.0 h1:SocQdLRSYlA8W99V8YH0NES75thx19d9sB/aFc4R8Lw= -modernc.org/sqlite v1.26.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= +modernc.org/sqlite v1.27.0 h1:MpKAHoyYB7xqcwnUwkuD+npwEa0fojF0B5QRbN+auJ8= +modernc.org/sqlite v1.27.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= +modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= diff --git a/migrations/logs/1640988000_init.go b/migrations/logs/1640988000_init.go index 67d10f8a..a8d8ef2e 100644 --- a/migrations/logs/1640988000_init.go +++ b/migrations/logs/1640988000_init.go @@ -8,8 +8,8 @@ import ( var LogsMigrations migrate.MigrationsList func init() { - LogsMigrations.Register(func(db dbx.Builder) (err error) { - _, err = db.NewQuery(` + LogsMigrations.Register(func(db dbx.Builder) error { + _, err := db.NewQuery(` CREATE TABLE {{_requests}} ( [[id]] TEXT PRIMARY KEY NOT NULL, [[url]] TEXT DEFAULT "" NOT NULL, diff --git a/migrations/logs/1699187560_logs_generalization.go b/migrations/logs/1699187560_logs_generalization.go new file mode 100644 index 00000000..db5c2040 --- /dev/null +++ b/migrations/logs/1699187560_logs_generalization.go @@ -0,0 +1,58 @@ +package logs + +import ( + "github.com/pocketbase/dbx" +) + +func init() { + LogsMigrations.Register(func(db dbx.Builder) error { + if _, err := db.DropTable("_requests").Execute(); err != nil { + return err + } + + _, err := db.NewQuery(` + CREATE TABLE {{_logs}} ( + [[id]] TEXT PRIMARY KEY DEFAULT ('r'||lower(hex(randomblob(7)))) NOT NULL, + [[level]] INTEGER DEFAULT 0 NOT NULL, + [[message]] TEXT DEFAULT "" NOT NULL, + [[data]] JSON DEFAULT "{}" NOT NULL, + [[created]] TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%fZ')) NOT NULL, + [[updated]] TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%fZ')) NOT NULL + ); + + CREATE INDEX _logs_level_idx on {{_logs}} ([[level]]); + CREATE INDEX _logs_message_idx on {{_logs}} ([[message]]); + CREATE INDEX _logs_data_auth_idx on {{_logs}} (JSON_EXTRACT([[data]], '$.auth')); + CREATE INDEX _logs_created_hour_idx on {{_logs}} (strftime('%Y-%m-%d %H:00:00', [[created]])); + `).Execute() + + return err + }, func(db dbx.Builder) error { + if _, err := db.DropTable("_logs").Execute(); err != nil { + return err + } + + _, err := db.NewQuery(` + CREATE TABLE {{_requests}} ( + [[id]] TEXT PRIMARY KEY NOT NULL, + [[url]] TEXT DEFAULT "" NOT NULL, + [[method]] TEXT DEFAULT "get" NOT NULL, + [[status]] INTEGER DEFAULT 200 NOT NULL, + [[auth]] TEXT DEFAULT "guest" NOT NULL, + [[ip]] TEXT DEFAULT "127.0.0.1" NOT NULL, + [[referer]] TEXT DEFAULT "" NOT NULL, + [[userAgent]] TEXT DEFAULT "" NOT NULL, + [[meta]] JSON DEFAULT "{}" NOT NULL, + [[created]] TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%fZ')) NOT NULL, + [[updated]] TEXT DEFAULT (strftime('%Y-%m-%d %H:%M:%fZ')) NOT NULL + ); + + CREATE INDEX _request_status_idx on {{_requests}} ([[status]]); + CREATE INDEX _request_auth_idx on {{_requests}} ([[auth]]); + CREATE INDEX _request_ip_idx on {{_requests}} ([[ip]]); + CREATE INDEX _request_created_hour_idx on {{_requests}} (strftime('%Y-%m-%d %H:00:00', [[created]])); + `).Execute() + + return err + }) +} diff --git a/models/log.go b/models/log.go new file mode 100644 index 00000000..b8153c35 --- /dev/null +++ b/models/log.go @@ -0,0 +1,19 @@ +package models + +import ( + "github.com/pocketbase/pocketbase/tools/types" +) + +var _ Model = (*Log)(nil) + +type Log struct { + BaseModel + + Data types.JsonMap `db:"data" json:"data"` + Message string `db:"message" json:"message"` + Level int `db:"level" json:"level"` +} + +func (m *Log) TableName() string { + return "_logs" +} diff --git a/models/settings/settings.go b/models/settings/settings.go index 1a6fd06d..3539ba26 100644 --- a/models/settings/settings.go +++ b/models/settings/settings.go @@ -82,6 +82,7 @@ func New() *Settings { }, Logs: LogsConfig{ MaxDays: 5, + LogIp: true, }, Smtp: SmtpConfig{ Enabled: false, @@ -598,7 +599,9 @@ func (t EmailTemplate) Resolve( // ------------------------------------------------------------------- type LogsConfig struct { - MaxDays int `form:"maxDays" json:"maxDays"` + MaxDays int `form:"maxDays" json:"maxDays"` + MinLevel int `form:"minLevel" json:"minLevel"` + LogIp bool `form:"logIp" json:"logIp"` } // Validate makes LogsConfig validatable by implementing [validation.Validatable] interface. diff --git a/plugins/ghupdate/ghupdate.go b/plugins/ghupdate/ghupdate.go index 41972c9e..274037ad 100644 --- a/plugins/ghupdate/ghupdate.go +++ b/plugins/ghupdate/ghupdate.go @@ -12,7 +12,7 @@ import ( "errors" "fmt" "io" - "log" + "log/slog" "net/http" "os" "path/filepath" @@ -221,8 +221,13 @@ func (p *plugin) update(withBackup bool) error { } tryToRevertExecChanges := func() { - if revertErr := os.Rename(renamedOldExec, oldExec); revertErr != nil && p.app.IsDebug() { - log.Println(revertErr) + if revertErr := os.Rename(renamedOldExec, oldExec); revertErr != nil { + p.app.Logger().Debug( + "Failed to revert executable", + slog.String("old", renamedOldExec), + slog.String("new", oldExec), + slog.String("error", revertErr.Error()), + ) } } diff --git a/plugins/jsvm/binds.go b/plugins/jsvm/binds.go index 1a3396b0..46920a78 100644 --- a/plugins/jsvm/binds.go +++ b/plugins/jsvm/binds.go @@ -5,8 +5,8 @@ import ( "context" "encoding/json" "errors" - "fmt" "io" + "log/slog" "net/http" "os" "os/exec" @@ -120,8 +120,12 @@ func cronBinds(app core.App, loader *goja.Runtime, executors *vmsPool) { return err }) - if err != nil && app.IsDebug() { - fmt.Println("[cronAdd] failed to execute cron job " + jobId + ": " + err.Error()) + if err != nil { + app.Logger().Debug( + "[cronAdd] failed to execute cron job", + slog.String("jobId", jobId), + slog.String("error", err.Error()), + ) } }) if err != nil { diff --git a/plugins/jsvm/internal/types/generated/types.d.ts b/plugins/jsvm/internal/types/generated/types.d.ts index 8e6a38c3..495c7659 100644 --- a/plugins/jsvm/internal/types/generated/types.d.ts +++ b/plugins/jsvm/internal/types/generated/types.d.ts @@ -414,7 +414,7 @@ declare class DateTime implements types.DateTime { interface ValidationError extends ozzo_validation.Error{} // merge /** * ValidationError defines a single formatted data validation error, - * usually used as part of a error response. + * usually used as part of an error response. * * ```js * new ValidationError("invalid_title", "Title is not valid") @@ -1429,7 +1429,9 @@ namespace os { * about the underlying operating system process. * * On Unix systems, FindProcess always succeeds and returns a Process - * for the given pid, regardless of whether the process exists. + * for the given pid, regardless of whether the process exists. To test whether + * the process actually exists, see whether p.Signal(syscall.Signal(0)) reports + * an error. */ (pid: number): (Process) } @@ -1611,8 +1613,19 @@ namespace os { */ readFrom(r: io.Reader): number } - type _subRuCbV = io.Writer - interface onlyWriter extends _subRuCbV { + /** + * fileWithoutReadFrom implements all the methods of *File other + * than ReadFrom. This is used to permit ReadFrom to call io.Copy + * without leading to a recursive call to ReadFrom. + */ + type _subIlYgA = File + interface fileWithoutReadFrom extends _subIlYgA { + } + interface fileWithoutReadFrom { + /** + * This ReadFrom method hides the *File ReadFrom method. + */ + readFrom(_arg0: fileWithoutReadFrom): void } interface File { /** @@ -1639,10 +1652,6 @@ namespace os { * relative to the current offset, and 2 means relative to the end. * It returns the new offset and an error, if any. * The behavior of Seek on a file opened with O_APPEND is not specified. - * - * If f is a directory, the behavior of Seek varies by operating - * system; you can seek to the beginning of the directory on Unix-like - * operating systems, but not on Windows. */ seek(offset: number, whence: number): number } @@ -1703,6 +1712,7 @@ namespace os { * Rename renames (moves) oldpath to newpath. * If newpath already exists and is not a directory, Rename replaces it. * OS-specific restrictions may apply when oldpath and newpath are in different directories. + * Even within the same directory, on non-Unix platforms Rename is not an atomic operation. * If there is an error, it will be of type *LinkError. */ (oldpath: string): void @@ -1764,6 +1774,9 @@ namespace os { * On Unix, including macOS, it returns the $HOME environment variable. * On Windows, it returns %USERPROFILE%. * On Plan 9, it returns the $home environment variable. + * + * If the expected variable is not set in the environment, UserHomeDir + * returns either a platform-specific default value or a non-nil error. */ (): string } @@ -1868,7 +1881,8 @@ namespace os { * * The directory dir must not be "". * - * The result implements fs.StatFS. + * The result implements [io/fs.StatFS], [io/fs.ReadFileFS] and + * [io/fs.ReadDirFS]. */ (dir: string): fs.FS } @@ -1876,6 +1890,22 @@ namespace os { interface dirFS { open(name: string): fs.File } + interface dirFS { + /** + * The ReadFile method calls the [ReadFile] function for the file + * with the given name in the directory. The function provides + * robust handling for small files and special file systems. + * Through this method, dirFS implements [io/fs.ReadFileFS]. + */ + readFile(name: string): string|Array + } + interface dirFS { + /** + * ReadDir reads the named directory, returning all its directory entries sorted + * by filename. Through this method, dirFS implements [io/fs.ReadDirFS]. + */ + readDir(name: string): Array + } interface dirFS { stat(name: string): fs.FileInfo } @@ -1893,6 +1923,8 @@ namespace os { * WriteFile writes data to the named file, creating it if necessary. * If the file does not exist, WriteFile creates it with permissions perm (before umask); * otherwise WriteFile truncates it before writing, without changing permissions. + * Since WriteFile requires multiple system calls to complete, a failure mid-operation + * can leave the file in a partially written state. */ (name: string, data: string|Array, perm: FileMode): void } @@ -1958,6 +1990,7 @@ namespace os { /** * Chtimes changes the access and modification times of the named * file, similar to the Unix utime() or utimes() functions. + * A zero time.Time value will leave the corresponding file time unchanged. * * The underlying filesystem may truncate or round the values to a * less precise time unit. @@ -2068,6 +2101,9 @@ namespace os { interface unixDirent { info(): FileInfo } + interface unixDirent { + string(): string + } interface getwd { /** * Getwd returns a rooted path name corresponding to the @@ -2240,8 +2276,8 @@ namespace os { /** * File represents an open file descriptor. */ - type _subtyPSi = file - interface File extends _subtyPSi { + type _subGrZgA = file + interface File extends _subGrZgA { } /** * A FileInfo describes a file and is returned by Stat and Lstat. @@ -2298,7 +2334,7 @@ namespace os { * The filepath package uses either forward slashes or backslashes, * depending on the operating system. To process paths such as URLs * that always use forward slashes regardless of the operating - * system, see the path package. + * system, see the [path] package. */ namespace filepath { interface match { @@ -2379,12 +2415,37 @@ namespace filepath { * If the result of this process is an empty string, Clean * returns the string ".". * + * On Windows, Clean does not modify the volume name other than to replace + * occurrences of "/" with `\`. + * For example, Clean("//host/share/../x") returns `\\host\share\x`. + * * See also Rob Pike, “Lexical File Names in Plan 9 or * Getting Dot-Dot Right,” * https://9p.io/sys/doc/lexnames.html */ (path: string): string } + interface isLocal { + /** + * IsLocal reports whether path, using lexical analysis only, has all of these properties: + * + * ``` + * - is within the subtree rooted at the directory in which path is evaluated + * - is not an absolute path + * - is not empty + * - on Windows, is not a reserved name such as "NUL" + * ``` + * + * If IsLocal(path) returns true, then + * Join(base, path) will always produce a path contained within base and + * Clean(path) will always produce an unrooted path with no ".." path elements. + * + * IsLocal is a purely lexical operation. + * In particular, it does not account for the effect of any symbolic links + * that may exist in the filesystem. + */ + (path: string): boolean + } interface toSlash { /** * ToSlash returns the result of replacing each separator character @@ -2493,8 +2554,9 @@ namespace filepath { * The error result returned by the function controls how Walk continues. * If the function returns the special value SkipDir, Walk skips the * current directory (path if info.IsDir() is true, otherwise path's - * parent directory). Otherwise, if the function returns a non-nil error, - * Walk stops entirely and returns that error. + * parent directory). If the function returns the special value SkipAll, + * Walk skips all remaining files and directories. Otherwise, if the function + * returns a non-nil error, Walk stops entirely and returns that error. * * The err argument reports an error related to path, signaling that Walk * will not walk into that directory. The function can decide how to @@ -2527,6 +2589,10 @@ namespace filepath { * to walk that directory. * * WalkDir does not follow symbolic links. + * + * WalkDir calls fn with paths that use the separator character appropriate + * for the operating system. This is unlike [io/fs.WalkDir], which always + * uses slash separated paths. */ (root: string, fn: fs.WalkDirFunc): void } @@ -2544,6 +2610,9 @@ namespace filepath { interface statDirEntry { info(): fs.FileInfo } + interface statDirEntry { + string(): string + } interface walk { /** * Walk walks the file tree rooted at root, calling fn for each file or @@ -2609,6 +2678,156 @@ namespace filepath { } } +/** + * Package validation provides configurable and extensible rules for validating data of various types. + */ +namespace ozzo_validation { + /** + * Error interface represents an validation error + */ + interface Error { + [key:string]: any; + error(): string + code(): string + message(): string + setMessage(_arg0: string): Error + params(): _TygojaDict + setParams(_arg0: _TygojaDict): Error + } +} + +namespace security { + interface s256Challenge { + /** + * S256Challenge creates base64 encoded sha256 challenge string derived from code. + * The padding of the result base64 string is stripped per [RFC 7636]. + * + * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 + */ + (code: string): string + } + interface md5 { + /** + * MD5 creates md5 hash from the provided plain text. + */ + (text: string): string + } + interface sha256 { + /** + * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. + */ + (text: string): string + } + interface sha512 { + /** + * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. + */ + (text: string): string + } + interface hs256 { + /** + * HS256 creates a HMAC hash with sha256 digest algorithm. + */ + (text: string, secret: string): string + } + interface hs512 { + /** + * HS512 creates a HMAC hash with sha512 digest algorithm. + */ + (text: string, secret: string): string + } + interface equal { + /** + * Equal compares two hash strings for equality without leaking timing information. + */ + (hash1: string, hash2: string): boolean + } + // @ts-ignore + import crand = rand + interface encrypt { + /** + * Encrypt encrypts data with key (must be valid 32 char aes key). + */ + (data: string|Array, key: string): string + } + interface decrypt { + /** + * Decrypt decrypts encrypted text with key (must be valid 32 chars aes key). + */ + (cipherText: string, key: string): string|Array + } + interface parseUnverifiedJWT { + /** + * ParseUnverifiedJWT parses JWT token and returns its claims + * but DOES NOT verify the signature. + * + * It verifies only the exp, iat and nbf claims. + */ + (token: string): jwt.MapClaims + } + interface parseJWT { + /** + * ParseJWT verifies and parses JWT token and returns its claims. + */ + (token: string, verificationKey: string): jwt.MapClaims + } + interface newJWT { + /** + * NewJWT generates and returns new HS256 signed JWT token. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + interface newToken { + /** + * Deprecated: + * Consider replacing with NewJWT(). + * + * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT token. + */ + (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string + } + // @ts-ignore + import cryptoRand = rand + // @ts-ignore + import mathRand = rand + interface randomString { + /** + * RandomString generates a cryptographically random string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + */ + (length: number): string + } + interface randomStringWithAlphabet { + /** + * RandomStringWithAlphabet generates a cryptographically random string + * with the specified length and characters set. + * + * It panics if for some reason rand.Int returns a non-nil error. + */ + (length: number, alphabet: string): string + } + interface pseudorandomString { + /** + * PseudorandomString generates a pseudorandom string with the specified length. + * + * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. + * + * For a cryptographically random string (but a little bit slower) use RandomString instead. + */ + (length: number): string + } + interface pseudorandomStringWithAlphabet { + /** + * PseudorandomStringWithAlphabet generates a pseudorandom string + * with the specified length and characters set. + * + * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. + */ + (length: number, alphabet: string): string + } +} + /** * Package dbx provides a set of DB-agnostic and easy-to-use query building methods for relational databases. */ @@ -2945,14 +3164,14 @@ namespace dbx { /** * MssqlBuilder is the builder for SQL Server databases. */ - type _subHRoxB = BaseBuilder - interface MssqlBuilder extends _subHRoxB { + type _subUHvXW = BaseBuilder + interface MssqlBuilder extends _subUHvXW { } /** * MssqlQueryBuilder is the query builder for SQL Server databases. */ - type _subJSCYu = BaseQueryBuilder - interface MssqlQueryBuilder extends _subJSCYu { + type _sublKnhS = BaseQueryBuilder + interface MssqlQueryBuilder extends _sublKnhS { } interface newMssqlBuilder { /** @@ -3023,8 +3242,8 @@ namespace dbx { /** * MysqlBuilder is the builder for MySQL databases. */ - type _subxqxbT = BaseBuilder - interface MysqlBuilder extends _subxqxbT { + type _subRilhp = BaseBuilder + interface MysqlBuilder extends _subRilhp { } interface newMysqlBuilder { /** @@ -3099,14 +3318,14 @@ namespace dbx { /** * OciBuilder is the builder for Oracle databases. */ - type _subaCEKN = BaseBuilder - interface OciBuilder extends _subaCEKN { + type _subALnSe = BaseBuilder + interface OciBuilder extends _subALnSe { } /** * OciQueryBuilder is the query builder for Oracle databases. */ - type _subSoIYN = BaseQueryBuilder - interface OciQueryBuilder extends _subSoIYN { + type _subEWBGZ = BaseQueryBuilder + interface OciQueryBuilder extends _subEWBGZ { } interface newOciBuilder { /** @@ -3169,8 +3388,8 @@ namespace dbx { /** * PgsqlBuilder is the builder for PostgreSQL databases. */ - type _subZsTVQ = BaseBuilder - interface PgsqlBuilder extends _subZsTVQ { + type _subKzHHv = BaseBuilder + interface PgsqlBuilder extends _subKzHHv { } interface newPgsqlBuilder { /** @@ -3237,8 +3456,8 @@ namespace dbx { /** * SqliteBuilder is the builder for SQLite databases. */ - type _sublVyAE = BaseBuilder - interface SqliteBuilder extends _sublVyAE { + type _suboyIBx = BaseBuilder + interface SqliteBuilder extends _suboyIBx { } interface newSqliteBuilder { /** @@ -3337,8 +3556,8 @@ namespace dbx { /** * StandardBuilder is the builder that is used by DB for an unknown driver. */ - type _subnuCqZ = BaseBuilder - interface StandardBuilder extends _subnuCqZ { + type _subcxTnD = BaseBuilder + interface StandardBuilder extends _subcxTnD { } interface newStandardBuilder { /** @@ -3404,8 +3623,8 @@ namespace dbx { * DB enhances sql.DB by providing a set of DB-agnostic query building methods. * DB allows easier query building and population of data into Go variables. */ - type _subkdJgr = Builder - interface DB extends _subkdJgr { + type _subVWNEX = Builder + interface DB extends _subVWNEX { /** * FieldMapper maps struct fields to DB columns. Defaults to DefaultFieldMapFunc. */ @@ -4207,8 +4426,8 @@ namespace dbx { * Rows enhances sql.Rows by providing additional data query methods. * Rows can be obtained by calling Query.Rows(). It is mainly used to populate data row by row. */ - type _subWXHzf = sql.Rows - interface Rows extends _subWXHzf { + type _subKUZEX = sql.Rows + interface Rows extends _subKUZEX { } interface Rows { /** @@ -4565,8 +4784,8 @@ namespace dbx { }): string } interface structInfo { } - type _subAZzsa = structInfo - interface structValue extends _subAZzsa { + type _subEnKWd = structInfo + interface structValue extends _subEnKWd { } interface fieldInfo { } @@ -4605,8 +4824,8 @@ namespace dbx { /** * Tx enhances sql.Tx with additional querying methods. */ - type _submANru = Builder - interface Tx extends _submANru { + type _subYILYK = Builder + interface Tx extends _subYILYK { } interface Tx { /** @@ -4622,24 +4841,6 @@ namespace dbx { } } -/** - * Package validation provides configurable and extensible rules for validating data of various types. - */ -namespace ozzo_validation { - /** - * Error interface represents an validation error - */ - interface Error { - [key:string]: any; - error(): string - code(): string - message(): string - setMessage(_arg0: string): Error - params(): _TygojaDict - setParams(_arg0: _TygojaDict): Error - } -} - /** * Package exec runs external commands. It wraps os.StartProcess to make it * easier to remap stdin and stdout, connect I/O with pipes, and do other @@ -4766,138 +4967,6 @@ namespace exec { } } -namespace security { - interface s256Challenge { - /** - * S256Challenge creates base64 encoded sha256 challenge string derived from code. - * The padding of the result base64 string is stripped per [RFC 7636]. - * - * [RFC 7636]: https://datatracker.ietf.org/doc/html/rfc7636#section-4.2 - */ - (code: string): string - } - interface md5 { - /** - * MD5 creates md5 hash from the provided plain text. - */ - (text: string): string - } - interface sha256 { - /** - * SHA256 creates sha256 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface sha512 { - /** - * SHA512 creates sha512 hash as defined in FIPS 180-4 from the provided text. - */ - (text: string): string - } - interface hs256 { - /** - * HS256 creates a HMAC hash with sha256 digest algorithm. - */ - (text: string, secret: string): string - } - interface hs512 { - /** - * HS512 creates a HMAC hash with sha512 digest algorithm. - */ - (text: string, secret: string): string - } - interface equal { - /** - * Equal compares two hash strings for equality without leaking timing information. - */ - (hash1: string, hash2: string): boolean - } - // @ts-ignore - import crand = rand - interface encrypt { - /** - * Encrypt encrypts data with key (must be valid 32 char aes key). - */ - (data: string|Array, key: string): string - } - interface decrypt { - /** - * Decrypt decrypts encrypted text with key (must be valid 32 chars aes key). - */ - (cipherText: string, key: string): string|Array - } - interface parseUnverifiedJWT { - /** - * ParseUnverifiedJWT parses JWT token and returns its claims - * but DOES NOT verify the signature. - * - * It verifies only the exp, iat and nbf claims. - */ - (token: string): jwt.MapClaims - } - interface parseJWT { - /** - * ParseJWT verifies and parses JWT token and returns its claims. - */ - (token: string, verificationKey: string): jwt.MapClaims - } - interface newJWT { - /** - * NewJWT generates and returns new HS256 signed JWT token. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - interface newToken { - /** - * Deprecated: - * Consider replacing with NewJWT(). - * - * NewToken is a legacy alias for NewJWT that generates a HS256 signed JWT token. - */ - (payload: jwt.MapClaims, signingKey: string, secondsDuration: number): string - } - // @ts-ignore - import cryptoRand = rand - // @ts-ignore - import mathRand = rand - interface randomString { - /** - * RandomString generates a cryptographically random string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - */ - (length: number): string - } - interface randomStringWithAlphabet { - /** - * RandomStringWithAlphabet generates a cryptographically random string - * with the specified length and characters set. - * - * It panics if for some reason rand.Int returns a non-nil error. - */ - (length: number, alphabet: string): string - } - interface pseudorandomString { - /** - * PseudorandomString generates a pseudorandom string with the specified length. - * - * The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding. - * - * For a cryptographically random string (but a little bit slower) use RandomString instead. - */ - (length: number): string - } - interface pseudorandomStringWithAlphabet { - /** - * PseudorandomStringWithAlphabet generates a pseudorandom string - * with the specified length and characters set. - * - * For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead. - */ - (length: number, alphabet: string): string - } -} - namespace filesystem { /** * FileReader defines an interface for a file resource reader. @@ -4971,8 +5040,8 @@ namespace filesystem { */ open(): io.ReadSeekCloser } - type _subKAeLY = bytes.Reader - interface bytesReadSeekCloser extends _subKAeLY { + type _subNNMcJ = bytes.Reader + interface bytesReadSeekCloser extends _subNNMcJ { } interface bytesReadSeekCloser { /** @@ -6094,8 +6163,8 @@ namespace forms { /** * SettingsUpsert is a [settings.Settings] upsert (create/update) form. */ - type _subZMjdf = settings.Settings - interface SettingsUpsert extends _subZMjdf { + type _subUZecp = settings.Settings + interface SettingsUpsert extends _subUZecp { } interface newSettingsUpsert { /** @@ -6391,8 +6460,11 @@ namespace apis { } interface realtimeApi { } + /** + * recordData represents the broadcasted record subscrition message data. + */ interface recordData { - record?: models.Record + record: any // map or models.Record action: string } interface getter { @@ -6509,6 +6581,91 @@ namespace apis { } } +namespace pocketbase { + /** + * appWrapper serves as a private CoreApp instance wrapper. + */ + type _subCzTfz = CoreApp + interface appWrapper extends _subCzTfz { + } + /** + * PocketBase defines a PocketBase app launcher. + * + * It implements [CoreApp] via embedding and all of the app interface methods + * could be accessed directly through the instance (eg. PocketBase.DataDir()). + */ + type _subkPnla = appWrapper + interface PocketBase extends _subkPnla { + /** + * RootCmd is the main console command + */ + rootCmd?: cobra.Command + } + /** + * Config is the PocketBase initialization config struct. + */ + interface Config { + /** + * optional default values for the console flags + */ + defaultDataDir: string // if not set, it will fallback to "./pb_data" + defaultEncryptionEnv: string + /** + * hide the default console server info on app startup + */ + hideStartBanner: boolean + /** + * optional DB configurations + */ + dataMaxOpenConns: number // default to core.DefaultDataMaxOpenConns + dataMaxIdleConns: number // default to core.DefaultDataMaxIdleConns + logsMaxOpenConns: number // default to core.DefaultLogsMaxOpenConns + logsMaxIdleConns: number // default to core.DefaultLogsMaxIdleConns + } + interface _new { + /** + * New creates a new PocketBase instance with the default configuration. + * Use [NewWithConfig()] if you want to provide a custom configuration. + * + * Note that the application will not be initialized/bootstrapped yet, + * aka. DB connections, migrations, app settings, etc. will not be accessible. + * Everything will be initialized when [Start()] is executed. + * If you want to initialize the application before calling [Start()], + * then you'll have to manually call [Bootstrap()]. + */ + (): (PocketBase) + } + interface newWithConfig { + /** + * NewWithConfig creates a new PocketBase instance with the provided config. + * + * Note that the application will not be initialized/bootstrapped yet, + * aka. DB connections, migrations, app settings, etc. will not be accessible. + * Everything will be initialized when [Start()] is executed. + * If you want to initialize the application before calling [Start()], + * then you'll have to manually call [Bootstrap()]. + */ + (config: Config): (PocketBase) + } + interface PocketBase { + /** + * Start starts the application, aka. registers the default system + * commands (serve, migrate, version) and executes pb.RootCmd. + */ + start(): void + } + interface PocketBase { + /** + * Execute initializes the application (if not already) and executes + * the pb.RootCmd with graceful shutdown support. + * + * This method differs from pb.Start() by not registering the default + * system commands! + */ + execute(): void + } +} + /** * Package template is a thin wrapper around the standard html/template * and text/template packages that implements a convenient registry to @@ -6614,92 +6771,6 @@ namespace template { } } -namespace pocketbase { - /** - * appWrapper serves as a private CoreApp instance wrapper. - */ - type _subBFZCc = CoreApp - interface appWrapper extends _subBFZCc { - } - /** - * PocketBase defines a PocketBase app launcher. - * - * It implements [CoreApp] via embedding and all of the app interface methods - * could be accessed directly through the instance (eg. PocketBase.DataDir()). - */ - type _sublPkZd = appWrapper - interface PocketBase extends _sublPkZd { - /** - * RootCmd is the main console command - */ - rootCmd?: cobra.Command - } - /** - * Config is the PocketBase initialization config struct. - */ - interface Config { - /** - * optional default values for the console flags - */ - defaultDebug: boolean - defaultDataDir: string // if not set, it will fallback to "./pb_data" - defaultEncryptionEnv: string - /** - * hide the default console server info on app startup - */ - hideStartBanner: boolean - /** - * optional DB configurations - */ - dataMaxOpenConns: number // default to core.DefaultDataMaxOpenConns - dataMaxIdleConns: number // default to core.DefaultDataMaxIdleConns - logsMaxOpenConns: number // default to core.DefaultLogsMaxOpenConns - logsMaxIdleConns: number // default to core.DefaultLogsMaxIdleConns - } - interface _new { - /** - * New creates a new PocketBase instance with the default configuration. - * Use [NewWithConfig()] if you want to provide a custom configuration. - * - * Note that the application will not be initialized/bootstrapped yet, - * aka. DB connections, migrations, app settings, etc. will not be accessible. - * Everything will be initialized when [Start()] is executed. - * If you want to initialize the application before calling [Start()], - * then you'll have to manually call [Bootstrap()]. - */ - (): (PocketBase) - } - interface newWithConfig { - /** - * NewWithConfig creates a new PocketBase instance with the provided config. - * - * Note that the application will not be initialized/bootstrapped yet, - * aka. DB connections, migrations, app settings, etc. will not be accessible. - * Everything will be initialized when [Start()] is executed. - * If you want to initialize the application before calling [Start()], - * then you'll have to manually call [Bootstrap()]. - */ - (config: Config): (PocketBase) - } - interface PocketBase { - /** - * Start starts the application, aka. registers the default system - * commands (serve, migrate, version) and executes pb.RootCmd. - */ - start(): void - } - interface PocketBase { - /** - * Execute initializes the application (if not already) and executes - * the pb.RootCmd with graceful shutdown support. - * - * This method differs from pb.Start() by not registering the default - * system commands! - */ - execute(): void - } -} - /** * Package io provides basic interfaces to I/O primitives. * Its primary job is to wrap existing implementations of such primitives, @@ -6734,6 +6805,9 @@ namespace io { * that happen after reading some bytes and also both of the * allowed EOF behaviors. * + * If len(p) == 0, Read should always return n == 0. It may return a + * non-nil error if some error condition is known, such as EOF. + * * Implementations of Read are discouraged from returning a * zero byte count with a nil error, except when len(p) == 0. * Callers should treat a return of 0 and nil as indicating that @@ -6745,21 +6819,6 @@ namespace io { [key:string]: any; read(p: string|Array): number } - /** - * Writer is the interface that wraps the basic Write method. - * - * Write writes len(p) bytes from p to the underlying data stream. - * It returns the number of bytes written from p (0 <= n <= len(p)) - * and any error encountered that caused the write to stop early. - * Write must return a non-nil error if it returns n < len(p). - * Write must not modify the slice data, even temporarily. - * - * Implementations must not retain p. - */ - interface Writer { - [key:string]: any; - write(p: string|Array): number - } /** * ReadSeekCloser is the interface that groups the basic Read, Seek and Close * methods. @@ -6771,7 +6830,7 @@ namespace io { /** * Package bytes implements functions for the manipulation of byte slices. - * It is analogous to the facilities of the strings package. + * It is analogous to the facilities of the [strings] package. */ namespace bytes { /** @@ -6930,6 +6989,8 @@ namespace syscall { */ gidMappingsEnableSetgroups: boolean ambientCaps: Array // Ambient capabilities (Linux only) + useCgroupFD: boolean // Whether to make use of the CgroupFD field. + cgroupFD: number // File descriptor of a cgroup to put the new process into. } // @ts-ignore import errorspkg = errors @@ -6973,8 +7034,8 @@ namespace syscall { * } * ``` * - * Errno values can be tested against error values from the os package - * using errors.Is. For example: + * Errno values can be tested against error values using errors.Is. + * For example: * * ``` * _, _, err := syscall.Syscall(...) @@ -7043,7 +7104,7 @@ namespace syscall { * The canonical way to strip a monotonic clock reading is to use t = t.Round(0). * * If Times t and u both contain monotonic clock readings, the operations - * t.After(u), t.Before(u), t.Equal(u), and t.Sub(u) are carried out + * t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out * using the monotonic clock readings alone, ignoring the wall clock * readings. If either t or u contains no monotonic clock reading, these * operations fall back to using the wall clock readings. @@ -7177,6 +7238,13 @@ namespace time { */ before(u: Time): boolean } + interface Time { + /** + * Compare compares the time instant t with u. If t is before u, it returns -1; + * if t is after u, it returns +1; if they're the same, it returns 0. + */ + compare(u: Time): number + } interface Time { /** * Equal reports whether t and u represent the same time instant. @@ -7489,28 +7557,32 @@ namespace time { interface Time { /** * MarshalJSON implements the json.Marshaler interface. - * The time is a quoted string in RFC 3339 format, with sub-second precision added if present. + * The time is a quoted string in the RFC 3339 format with sub-second precision. + * If the timestamp cannot be represented as valid RFC 3339 + * (e.g., the year is out of range), then an error is reported. */ marshalJSON(): string|Array } interface Time { /** * UnmarshalJSON implements the json.Unmarshaler interface. - * The time is expected to be a quoted string in RFC 3339 format. + * The time must be a quoted string in the RFC 3339 format. */ unmarshalJSON(data: string|Array): void } interface Time { /** * MarshalText implements the encoding.TextMarshaler interface. - * The time is formatted in RFC 3339 format, with sub-second precision added if present. + * The time is formatted in RFC 3339 format with sub-second precision. + * If the timestamp cannot be represented as valid RFC 3339 + * (e.g., the year is out of range), then an error is reported. */ marshalText(): string|Array } interface Time { /** * UnmarshalText implements the encoding.TextUnmarshaler interface. - * The time is expected to be in RFC 3339 format. + * The time must be in the RFC 3339 format. */ unmarshalText(data: string|Array): void } @@ -7547,6 +7619,169 @@ namespace time { } } +/** + * Package context defines the Context type, which carries deadlines, + * cancellation signals, and other request-scoped values across API boundaries + * and between processes. + * + * Incoming requests to a server should create a [Context], and outgoing + * calls to servers should accept a Context. The chain of function + * calls between them must propagate the Context, optionally replacing + * it with a derived Context created using [WithCancel], [WithDeadline], + * [WithTimeout], or [WithValue]. When a Context is canceled, all + * Contexts derived from it are also canceled. + * + * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a + * Context (the parent) and return a derived Context (the child) and a + * [CancelFunc]. Calling the CancelFunc cancels the child and its + * children, removes the parent's reference to the child, and stops + * any associated timers. Failing to call the CancelFunc leaks the + * child and its children until the parent is canceled or the timer + * fires. The go vet tool checks that CancelFuncs are used on all + * control-flow paths. + * + * The [WithCancelCause] function returns a [CancelCauseFunc], which + * takes an error and records it as the cancellation cause. Calling + * [Cause] on the canceled context or any of its children retrieves + * the cause. If no cause is specified, Cause(ctx) returns the same + * value as ctx.Err(). + * + * Programs that use Contexts should follow these rules to keep interfaces + * consistent across packages and enable static analysis tools to check context + * propagation: + * + * Do not store Contexts inside a struct type; instead, pass a Context + * explicitly to each function that needs it. The Context should be the first + * parameter, typically named ctx: + * + * ``` + * func DoSomething(ctx context.Context, arg Arg) error { + * // ... use ctx ... + * } + * ``` + * + * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] + * if you are unsure about which Context to use. + * + * Use context Values only for request-scoped data that transits processes and + * APIs, not for passing optional parameters to functions. + * + * The same Context may be passed to functions running in different goroutines; + * Contexts are safe for simultaneous use by multiple goroutines. + * + * See https://blog.golang.org/context for example code for a server that uses + * Contexts. + */ +namespace context { + /** + * A Context carries a deadline, a cancellation signal, and other values across + * API boundaries. + * + * Context's methods may be called by multiple goroutines simultaneously. + */ + interface Context { + [key:string]: any; + /** + * Deadline returns the time when work done on behalf of this context + * should be canceled. Deadline returns ok==false when no deadline is + * set. Successive calls to Deadline return the same results. + */ + deadline(): [time.Time, boolean] + /** + * Done returns a channel that's closed when work done on behalf of this + * context should be canceled. Done may return nil if this context can + * never be canceled. Successive calls to Done return the same value. + * The close of the Done channel may happen asynchronously, + * after the cancel function returns. + * + * WithCancel arranges for Done to be closed when cancel is called; + * WithDeadline arranges for Done to be closed when the deadline + * expires; WithTimeout arranges for Done to be closed when the timeout + * elapses. + * + * Done is provided for use in select statements: + * + * // Stream generates values with DoSomething and sends them to out + * // until DoSomething returns an error or ctx.Done is closed. + * func Stream(ctx context.Context, out chan<- Value) error { + * for { + * v, err := DoSomething(ctx) + * if err != nil { + * return err + * } + * select { + * case <-ctx.Done(): + * return ctx.Err() + * case out <- v: + * } + * } + * } + * + * See https://blog.golang.org/pipelines for more examples of how to use + * a Done channel for cancellation. + */ + done(): undefined + /** + * If Done is not yet closed, Err returns nil. + * If Done is closed, Err returns a non-nil error explaining why: + * Canceled if the context was canceled + * or DeadlineExceeded if the context's deadline passed. + * After Err returns a non-nil error, successive calls to Err return the same error. + */ + err(): void + /** + * Value returns the value associated with this context for key, or nil + * if no value is associated with key. Successive calls to Value with + * the same key returns the same result. + * + * Use context values only for request-scoped data that transits + * processes and API boundaries, not for passing optional parameters to + * functions. + * + * A key identifies a specific value in a Context. Functions that wish + * to store values in Context typically allocate a key in a global + * variable then use that key as the argument to context.WithValue and + * Context.Value. A key can be any type that supports equality; + * packages should define keys as an unexported type to avoid + * collisions. + * + * Packages that define a Context key should provide type-safe accessors + * for the values stored using that key: + * + * ``` + * // Package user defines a User type that's stored in Contexts. + * package user + * + * import "context" + * + * // User is the type of value stored in the Contexts. + * type User struct {...} + * + * // key is an unexported type for keys defined in this package. + * // This prevents collisions with keys defined in other packages. + * type key int + * + * // userKey is the key for user.User values in Contexts. It is + * // unexported; clients use user.NewContext and user.FromContext + * // instead of using this key directly. + * var userKey key + * + * // NewContext returns a new Context that carries value u. + * func NewContext(ctx context.Context, u *User) context.Context { + * return context.WithValue(ctx, userKey, u) + * } + * + * // FromContext returns the User value stored in ctx, if any. + * func FromContext(ctx context.Context) (*User, bool) { + * u, ok := ctx.Value(userKey).(*User) + * return u, ok + * } + * ``` + */ + value(key: any): any + } +} + /** * Package fs defines basic interfaces to a file system. * A file system can be provided by the host operating system @@ -7701,8 +7936,10 @@ namespace fs { * The error result returned by the function controls how WalkDir * continues. If the function returns the special value SkipDir, WalkDir * skips the current directory (path if d.IsDir() is true, otherwise - * path's parent directory). Otherwise, if the function returns a non-nil - * error, WalkDir stops entirely and returns that error. + * path's parent directory). If the function returns the special value + * SkipAll, WalkDir skips all remaining files and directories. Otherwise, + * if the function returns a non-nil error, WalkDir stops entirely and + * returns that error. * * The err argument reports an error related to path, signaling that * WalkDir will not walk into that directory. The function can decide how @@ -7721,8 +7958,8 @@ namespace fs { * ReadDir. In this second case, the function is called twice with the * path of the directory: the first call is before the directory read is * attempted and has err set to nil, giving the function a chance to - * return SkipDir and avoid the ReadDir entirely. The second call is - * after a failed ReadDir and reports the error from ReadDir. + * return SkipDir or SkipAll and avoid the ReadDir entirely. The second call + * is after a failed ReadDir and reports the error from ReadDir. * (If ReadDir succeeds, there is no second call.) * * The differences between WalkDirFunc compared to filepath.WalkFunc are: @@ -7730,7 +7967,8 @@ namespace fs { * ``` * - The second argument has type fs.DirEntry instead of fs.FileInfo. * - The function is called before reading a directory, to allow SkipDir - * to bypass the directory read entirely. + * or SkipAll to bypass the directory read entirely or skip all remaining + * files and directories respectively. * - If a directory read fails, the function is called a second time * for that directory to report the error. * ``` @@ -7738,220 +7976,6 @@ namespace fs { interface WalkDirFunc {(path: string, d: DirEntry, err: Error): void } } -/** - * Package context defines the Context type, which carries deadlines, - * cancellation signals, and other request-scoped values across API boundaries - * and between processes. - * - * Incoming requests to a server should create a Context, and outgoing - * calls to servers should accept a Context. The chain of function - * calls between them must propagate the Context, optionally replacing - * it with a derived Context created using WithCancel, WithDeadline, - * WithTimeout, or WithValue. When a Context is canceled, all - * Contexts derived from it are also canceled. - * - * The WithCancel, WithDeadline, and WithTimeout functions take a - * Context (the parent) and return a derived Context (the child) and a - * CancelFunc. Calling the CancelFunc cancels the child and its - * children, removes the parent's reference to the child, and stops - * any associated timers. Failing to call the CancelFunc leaks the - * child and its children until the parent is canceled or the timer - * fires. The go vet tool checks that CancelFuncs are used on all - * control-flow paths. - * - * Programs that use Contexts should follow these rules to keep interfaces - * consistent across packages and enable static analysis tools to check context - * propagation: - * - * Do not store Contexts inside a struct type; instead, pass a Context - * explicitly to each function that needs it. The Context should be the first - * parameter, typically named ctx: - * - * ``` - * func DoSomething(ctx context.Context, arg Arg) error { - * // ... use ctx ... - * } - * ``` - * - * Do not pass a nil Context, even if a function permits it. Pass context.TODO - * if you are unsure about which Context to use. - * - * Use context Values only for request-scoped data that transits processes and - * APIs, not for passing optional parameters to functions. - * - * The same Context may be passed to functions running in different goroutines; - * Contexts are safe for simultaneous use by multiple goroutines. - * - * See https://blog.golang.org/context for example code for a server that uses - * Contexts. - */ -namespace context { - /** - * A Context carries a deadline, a cancellation signal, and other values across - * API boundaries. - * - * Context's methods may be called by multiple goroutines simultaneously. - */ - interface Context { - [key:string]: any; - /** - * Deadline returns the time when work done on behalf of this context - * should be canceled. Deadline returns ok==false when no deadline is - * set. Successive calls to Deadline return the same results. - */ - deadline(): [time.Time, boolean] - /** - * Done returns a channel that's closed when work done on behalf of this - * context should be canceled. Done may return nil if this context can - * never be canceled. Successive calls to Done return the same value. - * The close of the Done channel may happen asynchronously, - * after the cancel function returns. - * - * WithCancel arranges for Done to be closed when cancel is called; - * WithDeadline arranges for Done to be closed when the deadline - * expires; WithTimeout arranges for Done to be closed when the timeout - * elapses. - * - * Done is provided for use in select statements: - * - * // Stream generates values with DoSomething and sends them to out - * // until DoSomething returns an error or ctx.Done is closed. - * func Stream(ctx context.Context, out chan<- Value) error { - * for { - * v, err := DoSomething(ctx) - * if err != nil { - * return err - * } - * select { - * case <-ctx.Done(): - * return ctx.Err() - * case out <- v: - * } - * } - * } - * - * See https://blog.golang.org/pipelines for more examples of how to use - * a Done channel for cancellation. - */ - done(): undefined - /** - * If Done is not yet closed, Err returns nil. - * If Done is closed, Err returns a non-nil error explaining why: - * Canceled if the context was canceled - * or DeadlineExceeded if the context's deadline passed. - * After Err returns a non-nil error, successive calls to Err return the same error. - */ - err(): void - /** - * Value returns the value associated with this context for key, or nil - * if no value is associated with key. Successive calls to Value with - * the same key returns the same result. - * - * Use context values only for request-scoped data that transits - * processes and API boundaries, not for passing optional parameters to - * functions. - * - * A key identifies a specific value in a Context. Functions that wish - * to store values in Context typically allocate a key in a global - * variable then use that key as the argument to context.WithValue and - * Context.Value. A key can be any type that supports equality; - * packages should define keys as an unexported type to avoid - * collisions. - * - * Packages that define a Context key should provide type-safe accessors - * for the values stored using that key: - * - * ``` - * // Package user defines a User type that's stored in Contexts. - * package user - * - * import "context" - * - * // User is the type of value stored in the Contexts. - * type User struct {...} - * - * // key is an unexported type for keys defined in this package. - * // This prevents collisions with keys defined in other packages. - * type key int - * - * // userKey is the key for user.User values in Contexts. It is - * // unexported; clients use user.NewContext and user.FromContext - * // instead of using this key directly. - * var userKey key - * - * // NewContext returns a new Context that carries value u. - * func NewContext(ctx context.Context, u *User) context.Context { - * return context.WithValue(ctx, userKey, u) - * } - * - * // FromContext returns the User value stored in ctx, if any. - * func FromContext(ctx context.Context) (*User, bool) { - * u, ok := ctx.Value(userKey).(*User) - * return u, ok - * } - * ``` - */ - value(key: any): any - } -} - -/** - * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html - * - * See README.md for more info. - */ -namespace jwt { - /** - * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. - * This is the default claims type if you don't supply one - */ - interface MapClaims extends _TygojaDict{} - interface MapClaims { - /** - * VerifyAudience Compares the aud claim against cmp. - * If required is false, this method will return true if the value matches or is unset - */ - verifyAudience(cmp: string, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). - * If req is false, it will return true, if exp is unset. - */ - verifyExpiresAt(cmp: number, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). - * If req is false, it will return true, if iat is unset. - */ - verifyIssuedAt(cmp: number, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). - * If req is false, it will return true, if nbf is unset. - */ - verifyNotBefore(cmp: number, req: boolean): boolean - } - interface MapClaims { - /** - * VerifyIssuer compares the iss claim against cmp. - * If required is false, this method will return true if the value matches or is unset - */ - verifyIssuer(cmp: string, req: boolean): boolean - } - interface MapClaims { - /** - * Valid validates time based claims "exp, iat, nbf". - * There is no accounting for clock skew. - * As well, if any of the above claims are not in the token, it will still - * be considered a valid claim. - */ - valid(): void - } -} - /** * Package multipart implements MIME multipart parsing, as defined in RFC * 2046. @@ -8010,7 +8034,7 @@ namespace multipart { * url.Values{"key": {"Value"}, "id": {"123"}}) * ``` * - * The client must close the response body when finished with it: + * The caller must close the response body when finished with it: * * ``` * resp, err := http.Get("http://example.com/") @@ -8022,6 +8046,8 @@ namespace multipart { * // ... * ``` * + * # Clients and Transports + * * For control over HTTP client headers, redirect policy, and other * settings, create a Client: * @@ -8056,6 +8082,8 @@ namespace multipart { * Clients and Transports are safe for concurrent use by multiple * goroutines and for efficiency should only be created once and re-used. * + * # Servers + * * ListenAndServe starts an HTTP server with a given address and handler. * The handler is usually nil, which means to use DefaultServeMux. * Handle and HandleFunc add handlers to DefaultServeMux: @@ -8084,11 +8112,13 @@ namespace multipart { * log.Fatal(s.ListenAndServe()) * ``` * + * # HTTP/2 + * * Starting with Go 1.6, the http package has transparent support for the * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 * can do so by setting Transport.TLSNextProto (for clients) or * Server.TLSNextProto (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG environment variables are + * map. Alternatively, the following GODEBUG settings are * currently supported: * * ``` @@ -8098,9 +8128,7 @@ namespace multipart { * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps * ``` * - * The GODEBUG variables are not covered by Go's API compatibility - * promise. Please report any issues before disabling HTTP/2 - * support: https://golang.org/s/http2bug + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug * * The http package's Transport and Server both automatically enable * HTTP/2 support for simple configurations. To enable HTTP/2 for more @@ -8367,7 +8395,7 @@ namespace http { interface Request { /** * Context returns the request's context. To change the context, use - * WithContext. + * Clone or WithContext. * * The returned context is always non-nil; it defaults to the * background context. @@ -8390,9 +8418,7 @@ namespace http { * sending the request, and reading the response headers and body. * * To create a new request with a context, use NewRequestWithContext. - * To change the context of a request, such as an incoming request you - * want to modify before sending back out, use Request.Clone. Between - * those two uses, it's rare to need WithContext. + * To make a deep copy of a request with a new context, use Request.Clone. */ withContext(ctx: context.Context): (Request) } @@ -8680,6 +8706,11 @@ namespace http { */ addr: string handler: Handler // handler to invoke, http.DefaultServeMux if nil + /** + * DisableGeneralOptionsHandler, if true, passes "OPTIONS *" requests to the Handler, + * otherwise responds with 200 OK and Content-Length: 0. + */ + disableGeneralOptionsHandler: boolean /** * TLSConfig optionally provides a TLS configuration for use * by ServeTLS and ListenAndServeTLS. Note that this value is @@ -8901,113 +8932,234 @@ namespace http { } } -namespace auth { +/** + * Package blob provides an easy and portable way to interact with blobs + * within a storage location. Subpackages contain driver implementations of + * blob for supported services. + * + * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. + * + * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with + * functions in that package. + * + * # Errors + * + * The errors returned from this package can be inspected in several ways: + * + * The Code function from gocloud.dev/gcerrors will return an error code, also + * defined in that package, when invoked on an error. + * + * The Bucket.ErrorAs method can retrieve the driver error underlying the returned + * error. + * + * # OpenCensus Integration + * + * OpenCensus supports tracing and metric collection for multiple languages and + * backend providers. See https://opencensus.io. + * + * This API collects OpenCensus traces and metrics for the following methods: + * ``` + * - Attributes + * - Copy + * - Delete + * - ListPage + * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll + * are included because they call NewRangeReader.) + * - NewWriter, from creation until the call to Close. + * ``` + * + * All trace and metric names begin with the package import path. + * The traces add the method name. + * For example, "gocloud.dev/blob/Attributes". + * The metrics are "completed_calls", a count of completed method calls by driver, + * method and status (error code); and "latency", a distribution of method latency + * by driver and method. + * For example, "gocloud.dev/blob/latency". + * + * It also collects the following metrics: + * ``` + * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. + * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. + * ``` + * + * To enable trace collection in your application, see "Configure Exporter" at + * https://opencensus.io/quickstart/go/tracing. + * To enable metric collection in your application, see "Exporting stats" at + * https://opencensus.io/quickstart/go/metrics. + */ +namespace blob { /** - * AuthUser defines a standardized oauth2 user data structure. + * Reader reads bytes from a blob. + * It implements io.ReadSeekCloser, and must be closed after + * reads are finished. */ - interface AuthUser { - id: string - name: string - username: string - email: string - avatarUrl: string - rawUser: _TygojaDict - accessToken: string - refreshToken: string + interface Reader { + } + interface Reader { + /** + * Read implements io.Reader (https://golang.org/pkg/io/#Reader). + */ + read(p: string|Array): number + } + interface Reader { + /** + * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). + */ + seek(offset: number, whence: number): number + } + interface Reader { + /** + * Close implements io.Closer (https://golang.org/pkg/io/#Closer). + */ + close(): void + } + interface Reader { + /** + * ContentType returns the MIME type of the blob. + */ + contentType(): string + } + interface Reader { + /** + * ModTime returns the time the blob was last modified. + */ + modTime(): time.Time + } + interface Reader { + /** + * Size returns the size of the blob content in bytes. + */ + size(): number + } + interface Reader { + /** + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. + */ + as(i: { + }): boolean + } + interface Reader { + /** + * WriteTo reads from r and writes to w until there's no more data or + * an error occurs. + * The return value is the number of bytes written to w. + * + * It implements the io.WriterTo interface. + */ + writeTo(w: io.Writer): number } /** - * Provider defines a common interface for an OAuth2 client. + * Attributes contains attributes about a blob. */ - interface Provider { - [key:string]: any; + interface Attributes { /** - * Scopes returns the context associated with the provider (if any). + * CacheControl specifies caching attributes that services may use + * when serving the blob. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control */ - context(): context.Context + cacheControl: string /** - * SetContext assigns the specified context to the current provider. + * ContentDisposition specifies whether the blob content is expected to be + * displayed inline or as an attachment. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition */ - setContext(ctx: context.Context): void + contentDisposition: string /** - * Scopes returns the provider access permissions that will be requested. + * ContentEncoding specifies the encoding used for the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding */ - scopes(): Array + contentEncoding: string /** - * SetScopes sets the provider access permissions that will be requested later. + * ContentLanguage specifies the language used in the blob's content, if any. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language */ - setScopes(scopes: Array): void + contentLanguage: string /** - * ClientId returns the provider client's app ID. + * ContentType is the MIME type of the blob. It will not be empty. + * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type */ - clientId(): string + contentType: string /** - * SetClientId sets the provider client's ID. + * Metadata holds key/value pairs associated with the blob. + * Keys are guaranteed to be in lowercase, even if the backend service + * has case-sensitive keys (although note that Metadata written via + * this package will always be lowercased). If there are duplicate + * case-insensitive keys (e.g., "foo" and "FOO"), only one value + * will be kept, and it is undefined which one. */ - setClientId(clientId: string): void + metadata: _TygojaDict /** - * ClientSecret returns the provider client's app secret. + * CreateTime is the time the blob was created, if available. If not available, + * CreateTime will be the zero time. */ - clientSecret(): string + createTime: time.Time /** - * SetClientSecret sets the provider client's app secret. + * ModTime is the time the blob was last modified. */ - setClientSecret(secret: string): void + modTime: time.Time /** - * RedirectUrl returns the end address to redirect the user - * going through the OAuth flow. + * Size is the size of the blob's content in bytes. */ - redirectUrl(): string + size: number /** - * SetRedirectUrl sets the provider's RedirectUrl. + * MD5 is an MD5 hash of the blob contents or nil if not available. */ - setRedirectUrl(url: string): void + md5: string|Array /** - * AuthUrl returns the provider's authorization service url. + * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. */ - authUrl(): string + eTag: string + } + interface Attributes { /** - * SetAuthUrl sets the provider's AuthUrl. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - setAuthUrl(url: string): void + as(i: { + }): boolean + } + /** + * ListObject represents a single blob returned from List. + */ + interface ListObject { /** - * TokenUrl returns the provider's token exchange service url. + * Key is the key for this blob. */ - tokenUrl(): string + key: string /** - * SetTokenUrl sets the provider's TokenUrl. + * ModTime is the time the blob was last modified. */ - setTokenUrl(url: string): void + modTime: time.Time /** - * UserApiUrl returns the provider's user info api url. + * Size is the size of the blob's content in bytes. */ - userApiUrl(): string + size: number /** - * SetUserApiUrl sets the provider's UserApiUrl. + * MD5 is an MD5 hash of the blob contents or nil if not available. */ - setUserApiUrl(url: string): void + md5: string|Array /** - * Client returns an http client using the provided token. + * IsDir indicates that this result represents a "directory" in the + * hierarchical namespace, ending in ListOptions.Delimiter. Key can be + * passed as ListOptions.Prefix to list items in the "directory". + * Fields other than Key and IsDir will not be set if IsDir is true. */ - client(token: oauth2.Token): (any) + isDir: boolean + } + interface ListObject { /** - * BuildAuthUrl returns a URL to the provider's consent page - * that asks for permissions for the required scopes explicitly. + * As converts i to driver-specific types. + * See https://gocloud.dev/concepts/as/ for background information, the "As" + * examples in this package for examples, and the driver package + * documentation for the specific types supported for that driver. */ - buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string - /** - * FetchToken converts an authorization code to token. - */ - fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) - /** - * FetchRawUserData requests and marshalizes into `result` the - * the OAuth user api response. - */ - fetchRawUserData(token: oauth2.Token): string|Array - /** - * FetchAuthUser is similar to FetchRawUserData, but normalizes and - * marshalizes the user api response into a standardized AuthUser struct. - */ - fetchAuthUser(token: oauth2.Token): (AuthUser) + as(i: { + }): boolean } } @@ -9619,7 +9771,7 @@ namespace sql { * select query will close any cursor *Rows if the parent *Rows is closed. * * If any of the first arguments implementing Scanner returns an error, - * that error will be wrapped in the returned error + * that error will be wrapped in the returned error. */ scan(...dest: any[]): void } @@ -9654,6 +9806,1267 @@ namespace sql { } } +/** + * Package exec runs external commands. It wraps os.StartProcess to make it + * easier to remap stdin and stdout, connect I/O with pipes, and do other + * adjustments. + * + * Unlike the "system" library call from C and other languages, the + * os/exec package intentionally does not invoke the system shell and + * does not expand any glob patterns or handle other expansions, + * pipelines, or redirections typically done by shells. The package + * behaves more like C's "exec" family of functions. To expand glob + * patterns, either call the shell directly, taking care to escape any + * dangerous input, or use the path/filepath package's Glob function. + * To expand environment variables, use package os's ExpandEnv. + * + * Note that the examples in this package assume a Unix system. + * They may not run on Windows, and they do not run in the Go Playground + * used by golang.org and godoc.org. + * + * # Executables in the current directory + * + * The functions Command and LookPath look for a program + * in the directories listed in the current path, following the + * conventions of the host operating system. + * Operating systems have for decades included the current + * directory in this search, sometimes implicitly and sometimes + * configured explicitly that way by default. + * Modern practice is that including the current directory + * is usually unexpected and often leads to security problems. + * + * To avoid those security problems, as of Go 1.19, this package will not resolve a program + * using an implicit or explicit path entry relative to the current directory. + * That is, if you run exec.LookPath("go"), it will not successfully return + * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. + * Instead, if the usual path algorithms would result in that answer, + * these functions return an error err satisfying errors.Is(err, ErrDot). + * + * For example, consider these two program snippets: + * + * ``` + * path, err := exec.LookPath("prog") + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * These will not find and run ./prog or .\prog.exe, + * no matter how the current path is configured. + * + * Code that always wants to run a program from the current directory + * can be rewritten to say "./prog" instead of "prog". + * + * Code that insists on including results from relative path entries + * can instead override the error using an errors.Is check: + * + * ``` + * path, err := exec.LookPath("prog") + * if errors.Is(err, exec.ErrDot) { + * err = nil + * } + * if err != nil { + * log.Fatal(err) + * } + * use(path) + * ``` + * + * and + * + * ``` + * cmd := exec.Command("prog") + * if errors.Is(cmd.Err, exec.ErrDot) { + * cmd.Err = nil + * } + * if err := cmd.Run(); err != nil { + * log.Fatal(err) + * } + * ``` + * + * Setting the environment variable GODEBUG=execerrdot=0 + * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 + * behavior for programs that are unable to apply more targeted fixes. + * A future version of Go may remove support for this variable. + * + * Before adding such overrides, make sure you understand the + * security implications of doing so. + * See https://go.dev/blog/path-security for more information. + */ +namespace exec { + /** + * Cmd represents an external command being prepared or run. + * + * A Cmd cannot be reused after calling its Run, Output or CombinedOutput + * methods. + */ + interface Cmd { + /** + * Path is the path of the command to run. + * + * This is the only field that must be set to a non-zero + * value. If Path is relative, it is evaluated relative + * to Dir. + */ + path: string + /** + * Args holds command line arguments, including the command as Args[0]. + * If the Args field is empty or nil, Run uses {Path}. + * + * In typical use, both Path and Args are set by calling Command. + */ + args: Array + /** + * Env specifies the environment of the process. + * Each entry is of the form "key=value". + * If Env is nil, the new process uses the current process's + * environment. + * If Env contains duplicate environment keys, only the last + * value in the slice for each duplicate key is used. + * As a special case on Windows, SYSTEMROOT is always added if + * missing and not explicitly set to the empty string. + */ + env: Array + /** + * Dir specifies the working directory of the command. + * If Dir is the empty string, Run runs the command in the + * calling process's current directory. + */ + dir: string + /** + * Stdin specifies the process's standard input. + * + * If Stdin is nil, the process reads from the null device (os.DevNull). + * + * If Stdin is an *os.File, the process's standard input is connected + * directly to that file. + * + * Otherwise, during the execution of the command a separate + * goroutine reads from Stdin and delivers that data to the command + * over a pipe. In this case, Wait does not complete until the goroutine + * stops copying, either because it has reached the end of Stdin + * (EOF or a read error), or because writing to the pipe returned an error, + * or because a nonzero WaitDelay was set and expired. + */ + stdin: io.Reader + /** + * Stdout and Stderr specify the process's standard output and error. + * + * If either is nil, Run connects the corresponding file descriptor + * to the null device (os.DevNull). + * + * If either is an *os.File, the corresponding output from the process + * is connected directly to that file. + * + * Otherwise, during the execution of the command a separate goroutine + * reads from the process over a pipe and delivers that data to the + * corresponding Writer. In this case, Wait does not complete until the + * goroutine reaches EOF or encounters an error or a nonzero WaitDelay + * expires. + * + * If Stdout and Stderr are the same writer, and have a type that can + * be compared with ==, at most one goroutine at a time will call Write. + */ + stdout: io.Writer + stderr: io.Writer + /** + * ExtraFiles specifies additional open files to be inherited by the + * new process. It does not include standard input, standard output, or + * standard error. If non-nil, entry i becomes file descriptor 3+i. + * + * ExtraFiles is not supported on Windows. + */ + extraFiles: Array<(os.File | undefined)> + /** + * SysProcAttr holds optional, operating system-specific attributes. + * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. + */ + sysProcAttr?: syscall.SysProcAttr + /** + * Process is the underlying process, once started. + */ + process?: os.Process + /** + * ProcessState contains information about an exited process. + * If the process was started successfully, Wait or Run will + * populate its ProcessState when the command completes. + */ + processState?: os.ProcessState + err: Error // LookPath error, if any. + /** + * If Cancel is non-nil, the command must have been created with + * CommandContext and Cancel will be called when the command's + * Context is done. By default, CommandContext sets Cancel to + * call the Kill method on the command's Process. + * + * Typically a custom Cancel will send a signal to the command's + * Process, but it may instead take other actions to initiate cancellation, + * such as closing a stdin or stdout pipe or sending a shutdown request on a + * network socket. + * + * If the command exits with a success status after Cancel is + * called, and Cancel does not return an error equivalent to + * os.ErrProcessDone, then Wait and similar methods will return a non-nil + * error: either an error wrapping the one returned by Cancel, + * or the error from the Context. + * (If the command exits with a non-success status, or Cancel + * returns an error that wraps os.ErrProcessDone, Wait and similar methods + * continue to return the command's usual exit status.) + * + * If Cancel is set to nil, nothing will happen immediately when the command's + * Context is done, but a nonzero WaitDelay will still take effect. That may + * be useful, for example, to work around deadlocks in commands that do not + * support shutdown signals but are expected to always finish quickly. + * + * Cancel will not be called if Start returns a non-nil error. + */ + cancel: () => void + /** + * If WaitDelay is non-zero, it bounds the time spent waiting on two sources + * of unexpected delay in Wait: a child process that fails to exit after the + * associated Context is canceled, and a child process that exits but leaves + * its I/O pipes unclosed. + * + * The WaitDelay timer starts when either the associated Context is done or a + * call to Wait observes that the child process has exited, whichever occurs + * first. When the delay has elapsed, the command shuts down the child process + * and/or its I/O pipes. + * + * If the child process has failed to exit — perhaps because it ignored or + * failed to receive a shutdown signal from a Cancel function, or because no + * Cancel function was set — then it will be terminated using os.Process.Kill. + * + * Then, if the I/O pipes communicating with the child process are still open, + * those pipes are closed in order to unblock any goroutines currently blocked + * on Read or Write calls. + * + * If pipes are closed due to WaitDelay, no Cancel call has occurred, + * and the command has otherwise exited with a successful status, Wait and + * similar methods will return ErrWaitDelay instead of nil. + * + * If WaitDelay is zero (the default), I/O pipes will be read until EOF, + * which might not occur until orphaned subprocesses of the command have + * also closed their descriptors for the pipes. + */ + waitDelay: time.Duration + } + interface Cmd { + /** + * String returns a human-readable description of c. + * It is intended only for debugging. + * In particular, it is not suitable for use as input to a shell. + * The output of String may vary across Go releases. + */ + string(): string + } + interface Cmd { + /** + * Run starts the specified command and waits for it to complete. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command starts but does not complete successfully, the error is of + * type *ExitError. Other error types may be returned for other situations. + * + * If the calling goroutine has locked the operating system thread + * with runtime.LockOSThread and modified any inheritable OS-level + * thread state (for example, Linux or Plan 9 name spaces), the new + * process will inherit the caller's thread state. + */ + run(): void + } + interface Cmd { + /** + * Start starts the specified command but does not wait for it to complete. + * + * If Start returns successfully, the c.Process field will be set. + * + * After a successful call to Start the Wait method must be called in + * order to release associated system resources. + */ + start(): void + } + interface Cmd { + /** + * Wait waits for the command to exit and waits for any copying to + * stdin or copying from stdout or stderr to complete. + * + * The command must have been started by Start. + * + * The returned error is nil if the command runs, has no problems + * copying stdin, stdout, and stderr, and exits with a zero exit + * status. + * + * If the command fails to run or doesn't complete successfully, the + * error is of type *ExitError. Other error types may be + * returned for I/O problems. + * + * If any of c.Stdin, c.Stdout or c.Stderr are not an *os.File, Wait also waits + * for the respective I/O loop copying to or from the process to complete. + * + * Wait releases any resources associated with the Cmd. + */ + wait(): void + } + interface Cmd { + /** + * Output runs the command and returns its standard output. + * Any returned error will usually be of type *ExitError. + * If c.Stderr was nil, Output populates ExitError.Stderr. + */ + output(): string|Array + } + interface Cmd { + /** + * CombinedOutput runs the command and returns its combined standard + * output and standard error. + */ + combinedOutput(): string|Array + } + interface Cmd { + /** + * StdinPipe returns a pipe that will be connected to the command's + * standard input when the command starts. + * The pipe will be closed automatically after Wait sees the command exit. + * A caller need only call Close to force the pipe to close sooner. + * For example, if the command being run will not exit until standard input + * is closed, the caller must close the pipe. + */ + stdinPipe(): io.WriteCloser + } + interface Cmd { + /** + * StdoutPipe returns a pipe that will be connected to the command's + * standard output when the command starts. + * + * Wait will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to call Run when using StdoutPipe. + * See the example for idiomatic usage. + */ + stdoutPipe(): io.ReadCloser + } + interface Cmd { + /** + * StderrPipe returns a pipe that will be connected to the command's + * standard error when the command starts. + * + * Wait will close the pipe after seeing the command exit, so most callers + * need not close the pipe themselves. It is thus incorrect to call Wait + * before all reads from the pipe have completed. + * For the same reason, it is incorrect to use Run when using StderrPipe. + * See the StdoutPipe example for idiomatic usage. + */ + stderrPipe(): io.ReadCloser + } + interface Cmd { + /** + * Environ returns a copy of the environment in which the command would be run + * as it is currently configured. + */ + environ(): Array + } +} + +/** + * Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html + * + * See README.md for more info. + */ +namespace jwt { + /** + * MapClaims is a claims type that uses the map[string]interface{} for JSON decoding. + * This is the default claims type if you don't supply one + */ + interface MapClaims extends _TygojaDict{} + interface MapClaims { + /** + * VerifyAudience Compares the aud claim against cmp. + * If required is false, this method will return true if the value matches or is unset + */ + verifyAudience(cmp: string, req: boolean): boolean + } + interface MapClaims { + /** + * VerifyExpiresAt compares the exp claim against cmp (cmp <= exp). + * If req is false, it will return true, if exp is unset. + */ + verifyExpiresAt(cmp: number, req: boolean): boolean + } + interface MapClaims { + /** + * VerifyIssuedAt compares the exp claim against cmp (cmp >= iat). + * If req is false, it will return true, if iat is unset. + */ + verifyIssuedAt(cmp: number, req: boolean): boolean + } + interface MapClaims { + /** + * VerifyNotBefore compares the nbf claim against cmp (cmp >= nbf). + * If req is false, it will return true, if nbf is unset. + */ + verifyNotBefore(cmp: number, req: boolean): boolean + } + interface MapClaims { + /** + * VerifyIssuer compares the iss claim against cmp. + * If required is false, this method will return true if the value matches or is unset + */ + verifyIssuer(cmp: string, req: boolean): boolean + } + interface MapClaims { + /** + * Valid validates time based claims "exp, iat, nbf". + * There is no accounting for clock skew. + * As well, if any of the above claims are not in the token, it will still + * be considered a valid claim. + */ + valid(): void + } +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * JsonArray defines a slice that is safe for json and db read/write. + */ + interface JsonArray extends Array{} + interface JsonArray { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JsonArray { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JsonArray { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonArray[T] instance. + */ + scan(value: any): void + } + /** + * JsonMap defines a map that is safe for json and db read/write. + */ + interface JsonMap extends _TygojaDict{} + interface JsonMap { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JsonMap { + /** + * Get retrieves a single value from the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + */ + get(key: string): any + } + interface JsonMap { + /** + * Set sets a single value in the current JsonMap. + * + * This helper was added primarily to assist the goja integration since custom map types + * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). + */ + set(key: string, value: any): void + } + interface JsonMap { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JsonMap { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current `JsonMap` instance. + */ + scan(value: any): void + } +} + +/** + * Package schema implements custom Schema and SchemaField datatypes + * for handling the Collection schema definitions. + */ +namespace schema { + // @ts-ignore + import validation = ozzo_validation + /** + * Schema defines a dynamic db schema as a slice of `SchemaField`s. + */ + interface Schema { + } + interface Schema { + /** + * Fields returns the registered schema fields. + */ + fields(): Array<(SchemaField | undefined)> + } + interface Schema { + /** + * InitFieldsOptions calls `InitOptions()` for all schema fields. + */ + initFieldsOptions(): void + } + interface Schema { + /** + * Clone creates a deep clone of the current schema. + */ + clone(): (Schema) + } + interface Schema { + /** + * AsMap returns a map with all registered schema field. + * The returned map is indexed with each field name. + */ + asMap(): _TygojaDict + } + interface Schema { + /** + * GetFieldById returns a single field by its id. + */ + getFieldById(id: string): (SchemaField) + } + interface Schema { + /** + * GetFieldByName returns a single field by its name. + */ + getFieldByName(name: string): (SchemaField) + } + interface Schema { + /** + * RemoveField removes a single schema field by its id. + * + * This method does nothing if field with `id` doesn't exist. + */ + removeField(id: string): void + } + interface Schema { + /** + * AddField registers the provided newField to the current schema. + * + * If field with `newField.Id` already exist, the existing field is + * replaced with the new one. + * + * Otherwise the new field is appended to the other schema fields. + */ + addField(newField: SchemaField): void + } + interface Schema { + /** + * Validate makes Schema validatable by implementing [validation.Validatable] interface. + * + * Internally calls each individual field's validator and additionally + * checks for invalid renamed fields and field name duplications. + */ + validate(): void + } + interface Schema { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface Schema { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + * + * On success, all schema field options are auto initialized. + */ + unmarshalJSON(data: string|Array): void + } + interface Schema { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface Schema { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current Schema instance. + */ + scan(value: any): void + } +} + +/** + * Package models implements all PocketBase DB models and DTOs. + */ +namespace models { + type _subrkSMk = BaseModel + interface Admin extends _subrkSMk { + avatar: number + email: string + tokenKey: string + passwordHash: string + lastResetSentAt: types.DateTime + } + interface Admin { + /** + * TableName returns the Admin model SQL table name. + */ + tableName(): string + } + interface Admin { + /** + * ValidatePassword validates a plain password against the model's password. + */ + validatePassword(password: string): boolean + } + interface Admin { + /** + * SetPassword sets cryptographically secure string to `model.Password`. + * + * Additionally this method also resets the LastResetSentAt and the TokenKey fields. + */ + setPassword(password: string): void + } + interface Admin { + /** + * RefreshTokenKey generates and sets new random token key. + */ + refreshTokenKey(): void + } + // @ts-ignore + import validation = ozzo_validation + type _subtTadc = BaseModel + interface Collection extends _subtTadc { + name: string + type: string + system: boolean + schema: schema.Schema + indexes: types.JsonArray + /** + * rules + */ + listRule?: string + viewRule?: string + createRule?: string + updateRule?: string + deleteRule?: string + options: types.JsonMap + } + interface Collection { + /** + * TableName returns the Collection model SQL table name. + */ + tableName(): string + } + interface Collection { + /** + * BaseFilesPath returns the storage dir path used by the collection. + */ + baseFilesPath(): string + } + interface Collection { + /** + * IsBase checks if the current collection has "base" type. + */ + isBase(): boolean + } + interface Collection { + /** + * IsAuth checks if the current collection has "auth" type. + */ + isAuth(): boolean + } + interface Collection { + /** + * IsView checks if the current collection has "view" type. + */ + isView(): boolean + } + interface Collection { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface Collection { + /** + * BaseOptions decodes the current collection options and returns them + * as new [CollectionBaseOptions] instance. + */ + baseOptions(): CollectionBaseOptions + } + interface Collection { + /** + * AuthOptions decodes the current collection options and returns them + * as new [CollectionAuthOptions] instance. + */ + authOptions(): CollectionAuthOptions + } + interface Collection { + /** + * ViewOptions decodes the current collection options and returns them + * as new [CollectionViewOptions] instance. + */ + viewOptions(): CollectionViewOptions + } + interface Collection { + /** + * NormalizeOptions updates the current collection options with a + * new normalized state based on the collection type. + */ + normalizeOptions(): void + } + interface Collection { + /** + * DecodeOptions decodes the current collection options into the + * provided "result" (must be a pointer). + */ + decodeOptions(result: any): void + } + interface Collection { + /** + * SetOptions normalizes and unmarshals the specified options into m.Options. + */ + setOptions(typedOptions: any): void + } + type _subuzsiX = BaseModel + interface ExternalAuth extends _subuzsiX { + collectionId: string + recordId: string + provider: string + providerId: string + } + interface ExternalAuth { + tableName(): string + } + type _subTQQtP = BaseModel + interface Record extends _subTQQtP { + } + interface Record { + /** + * TableName returns the table name associated to the current Record model. + */ + tableName(): string + } + interface Record { + /** + * Collection returns the Collection model associated to the current Record model. + */ + collection(): (Collection) + } + interface Record { + /** + * OriginalCopy returns a copy of the current record model populated + * with its ORIGINAL data state (aka. the initially loaded) and + * everything else reset to the defaults. + */ + originalCopy(): (Record) + } + interface Record { + /** + * CleanCopy returns a copy of the current record model populated only + * with its LATEST data state and everything else reset to the defaults. + */ + cleanCopy(): (Record) + } + interface Record { + /** + * Expand returns a shallow copy of the current Record model expand data. + */ + expand(): _TygojaDict + } + interface Record { + /** + * SetExpand shallow copies the provided data to the current Record model's expand. + */ + setExpand(expand: _TygojaDict): void + } + interface Record { + /** + * MergeExpand merges recursively the provided expand data into + * the current model's expand (if any). + * + * Note that if an expanded prop with the same key is a slice (old or new expand) + * then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]). + * Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew). + */ + mergeExpand(expand: _TygojaDict): void + } + interface Record { + /** + * SchemaData returns a shallow copy ONLY of the defined record schema fields data. + */ + schemaData(): _TygojaDict + } + interface Record { + /** + * UnknownData returns a shallow copy ONLY of the unknown record fields data, + * aka. fields that are neither one of the base and special system ones, + * nor defined by the collection schema. + */ + unknownData(): _TygojaDict + } + interface Record { + /** + * IgnoreEmailVisibility toggles the flag to ignore the auth record email visibility check. + */ + ignoreEmailVisibility(state: boolean): void + } + interface Record { + /** + * WithUnknownData toggles the export/serialization of unknown data fields + * (false by default). + */ + withUnknownData(state: boolean): void + } + interface Record { + /** + * Set sets the provided key-value data pair for the current Record model. + * + * If the record collection has field with name matching the provided "key", + * the value will be further normalized according to the field rules. + */ + set(key: string, value: any): void + } + interface Record { + /** + * Get returns a normalized single record model data value for "key". + */ + get(key: string): any + } + interface Record { + /** + * GetBool returns the data value for "key" as a bool. + */ + getBool(key: string): boolean + } + interface Record { + /** + * GetString returns the data value for "key" as a string. + */ + getString(key: string): string + } + interface Record { + /** + * GetInt returns the data value for "key" as an int. + */ + getInt(key: string): number + } + interface Record { + /** + * GetFloat returns the data value for "key" as a float64. + */ + getFloat(key: string): number + } + interface Record { + /** + * GetTime returns the data value for "key" as a [time.Time] instance. + */ + getTime(key: string): time.Time + } + interface Record { + /** + * GetDateTime returns the data value for "key" as a DateTime instance. + */ + getDateTime(key: string): types.DateTime + } + interface Record { + /** + * GetStringSlice returns the data value for "key" as a slice of unique strings. + */ + getStringSlice(key: string): Array + } + interface Record { + /** + * ExpandedOne retrieves a single relation Record from the already + * loaded expand data of the current model. + * + * If the requested expand relation is multiple, this method returns + * only first available Record from the expanded relation. + * + * Returns nil if there is no such expand relation loaded. + */ + expandedOne(relField: string): (Record) + } + interface Record { + /** + * ExpandedAll retrieves a slice of relation Records from the already + * loaded expand data of the current model. + * + * If the requested expand relation is single, this method normalizes + * the return result and will wrap the single model as a slice. + * + * Returns nil slice if there is no such expand relation loaded. + */ + expandedAll(relField: string): Array<(Record | undefined)> + } + interface Record { + /** + * Retrieves the "key" json field value and unmarshals it into "result". + * + * Example + * + * ``` + * result := struct { + * FirstName string `json:"first_name"` + * }{} + * err := m.UnmarshalJSONField("my_field_name", &result) + * ``` + */ + unmarshalJSONField(key: string, result: any): void + } + interface Record { + /** + * BaseFilesPath returns the storage dir path used by the record. + */ + baseFilesPath(): string + } + interface Record { + /** + * FindFileFieldByFile returns the first file type field for which + * any of the record's data contains the provided filename. + */ + findFileFieldByFile(filename: string): (schema.SchemaField) + } + interface Record { + /** + * Load bulk loads the provided data into the current Record model. + */ + load(data: _TygojaDict): void + } + interface Record { + /** + * ColumnValueMap implements [ColumnValueMapper] interface. + */ + columnValueMap(): _TygojaDict + } + interface Record { + /** + * PublicExport exports only the record fields that are safe to be public. + * + * For auth records, to force the export of the email field you need to set + * `m.IgnoreEmailVisibility(true)`. + */ + publicExport(): _TygojaDict + } + interface Record { + /** + * MarshalJSON implements the [json.Marshaler] interface. + * + * Only the data exported by `PublicExport()` will be serialized. + */ + marshalJSON(): string|Array + } + interface Record { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(data: string|Array): void + } + interface Record { + /** + * ReplaceModifers returns a new map with applied modifier + * values based on the current record and the specified data. + * + * The resolved modifier keys will be removed. + * + * Multiple modifiers will be applied one after another, + * while reusing the previous base key value result (eg. 1; -5; +2 => -2). + * + * Example usage: + * + * ``` + * newData := record.ReplaceModifers(data) + * // record: {"field": 10} + * // data: {"field+": 5} + * // newData: {"field": 15} + * ``` + */ + replaceModifers(data: _TygojaDict): _TygojaDict + } + interface Record { + /** + * Username returns the "username" auth record data value. + */ + username(): string + } + interface Record { + /** + * SetUsername sets the "username" auth record data value. + * + * This method doesn't check whether the provided value is a valid username. + * + * Returns an error if the record is not from an auth collection. + */ + setUsername(username: string): void + } + interface Record { + /** + * Email returns the "email" auth record data value. + */ + email(): string + } + interface Record { + /** + * SetEmail sets the "email" auth record data value. + * + * This method doesn't check whether the provided value is a valid email. + * + * Returns an error if the record is not from an auth collection. + */ + setEmail(email: string): void + } + interface Record { + /** + * Verified returns the "emailVisibility" auth record data value. + */ + emailVisibility(): boolean + } + interface Record { + /** + * SetEmailVisibility sets the "emailVisibility" auth record data value. + * + * Returns an error if the record is not from an auth collection. + */ + setEmailVisibility(visible: boolean): void + } + interface Record { + /** + * Verified returns the "verified" auth record data value. + */ + verified(): boolean + } + interface Record { + /** + * SetVerified sets the "verified" auth record data value. + * + * Returns an error if the record is not from an auth collection. + */ + setVerified(verified: boolean): void + } + interface Record { + /** + * TokenKey returns the "tokenKey" auth record data value. + */ + tokenKey(): string + } + interface Record { + /** + * SetTokenKey sets the "tokenKey" auth record data value. + * + * Returns an error if the record is not from an auth collection. + */ + setTokenKey(key: string): void + } + interface Record { + /** + * RefreshTokenKey generates and sets new random auth record "tokenKey". + * + * Returns an error if the record is not from an auth collection. + */ + refreshTokenKey(): void + } + interface Record { + /** + * LastResetSentAt returns the "lastResentSentAt" auth record data value. + */ + lastResetSentAt(): types.DateTime + } + interface Record { + /** + * SetLastResetSentAt sets the "lastResentSentAt" auth record data value. + * + * Returns an error if the record is not from an auth collection. + */ + setLastResetSentAt(dateTime: types.DateTime): void + } + interface Record { + /** + * LastVerificationSentAt returns the "lastVerificationSentAt" auth record data value. + */ + lastVerificationSentAt(): types.DateTime + } + interface Record { + /** + * SetLastVerificationSentAt sets an "lastVerificationSentAt" auth record data value. + * + * Returns an error if the record is not from an auth collection. + */ + setLastVerificationSentAt(dateTime: types.DateTime): void + } + interface Record { + /** + * PasswordHash returns the "passwordHash" auth record data value. + */ + passwordHash(): string + } + interface Record { + /** + * ValidatePassword validates a plain password against the auth record password. + * + * Returns false if the password is incorrect or record is not from an auth collection. + */ + validatePassword(password: string): boolean + } + interface Record { + /** + * SetPassword sets cryptographically secure string to the auth record "password" field. + * This method also resets the "lastResetSentAt" and the "tokenKey" fields. + * + * Returns an error if the record is not from an auth collection or + * an empty password is provided. + */ + setPassword(password: string): void + } + /** + * RequestInfo defines a HTTP request data struct, usually used + * as part of the `@request.*` filter resolver. + */ + interface RequestInfo { + query: _TygojaDict + data: _TygojaDict + headers: _TygojaDict + authRecord?: Record + admin?: Admin + method: string + } + interface RequestInfo { + /** + * HasModifierDataKeys loosely checks if the current struct has any modifier Data keys. + */ + hasModifierDataKeys(): boolean + } +} + +namespace auth { + /** + * AuthUser defines a standardized oauth2 user data structure. + */ + interface AuthUser { + id: string + name: string + username: string + email: string + avatarUrl: string + rawUser: _TygojaDict + accessToken: string + refreshToken: string + } + /** + * Provider defines a common interface for an OAuth2 client. + */ + interface Provider { + [key:string]: any; + /** + * Scopes returns the context associated with the provider (if any). + */ + context(): context.Context + /** + * SetContext assigns the specified context to the current provider. + */ + setContext(ctx: context.Context): void + /** + * Scopes returns the provider access permissions that will be requested. + */ + scopes(): Array + /** + * SetScopes sets the provider access permissions that will be requested later. + */ + setScopes(scopes: Array): void + /** + * ClientId returns the provider client's app ID. + */ + clientId(): string + /** + * SetClientId sets the provider client's ID. + */ + setClientId(clientId: string): void + /** + * ClientSecret returns the provider client's app secret. + */ + clientSecret(): string + /** + * SetClientSecret sets the provider client's app secret. + */ + setClientSecret(secret: string): void + /** + * RedirectUrl returns the end address to redirect the user + * going through the OAuth flow. + */ + redirectUrl(): string + /** + * SetRedirectUrl sets the provider's RedirectUrl. + */ + setRedirectUrl(url: string): void + /** + * AuthUrl returns the provider's authorization service url. + */ + authUrl(): string + /** + * SetAuthUrl sets the provider's AuthUrl. + */ + setAuthUrl(url: string): void + /** + * TokenUrl returns the provider's token exchange service url. + */ + tokenUrl(): string + /** + * SetTokenUrl sets the provider's TokenUrl. + */ + setTokenUrl(url: string): void + /** + * UserApiUrl returns the provider's user info api url. + */ + userApiUrl(): string + /** + * SetUserApiUrl sets the provider's UserApiUrl. + */ + setUserApiUrl(url: string): void + /** + * Client returns an http client using the provided token. + */ + client(token: oauth2.Token): (any) + /** + * BuildAuthUrl returns a URL to the provider's consent page + * that asks for permissions for the required scopes explicitly. + */ + buildAuthUrl(state: string, ...opts: oauth2.AuthCodeOption[]): string + /** + * FetchToken converts an authorization code to token. + */ + fetchToken(code: string, ...opts: oauth2.AuthCodeOption[]): (oauth2.Token) + /** + * FetchRawUserData requests and marshalizes into `result` the + * the OAuth user api response. + */ + fetchRawUserData(token: oauth2.Token): string|Array + /** + * FetchAuthUser is similar to FetchRawUserData, but normalizes and + * marshalizes the user api response into a standardized AuthUser struct. + */ + fetchAuthUser(token: oauth2.Token): (AuthUser) + } +} + /** * Package echo implements high performance, minimalist Go web framework. * @@ -10230,1272 +11643,6 @@ namespace echo { } } -/** - * Package exec runs external commands. It wraps os.StartProcess to make it - * easier to remap stdin and stdout, connect I/O with pipes, and do other - * adjustments. - * - * Unlike the "system" library call from C and other languages, the - * os/exec package intentionally does not invoke the system shell and - * does not expand any glob patterns or handle other expansions, - * pipelines, or redirections typically done by shells. The package - * behaves more like C's "exec" family of functions. To expand glob - * patterns, either call the shell directly, taking care to escape any - * dangerous input, or use the path/filepath package's Glob function. - * To expand environment variables, use package os's ExpandEnv. - * - * Note that the examples in this package assume a Unix system. - * They may not run on Windows, and they do not run in the Go Playground - * used by golang.org and godoc.org. - * - * # Executables in the current directory - * - * The functions Command and LookPath look for a program - * in the directories listed in the current path, following the - * conventions of the host operating system. - * Operating systems have for decades included the current - * directory in this search, sometimes implicitly and sometimes - * configured explicitly that way by default. - * Modern practice is that including the current directory - * is usually unexpected and often leads to security problems. - * - * To avoid those security problems, as of Go 1.19, this package will not resolve a program - * using an implicit or explicit path entry relative to the current directory. - * That is, if you run exec.LookPath("go"), it will not successfully return - * ./go on Unix nor .\go.exe on Windows, no matter how the path is configured. - * Instead, if the usual path algorithms would result in that answer, - * these functions return an error err satisfying errors.Is(err, ErrDot). - * - * For example, consider these two program snippets: - * - * ``` - * path, err := exec.LookPath("prog") - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * These will not find and run ./prog or .\prog.exe, - * no matter how the current path is configured. - * - * Code that always wants to run a program from the current directory - * can be rewritten to say "./prog" instead of "prog". - * - * Code that insists on including results from relative path entries - * can instead override the error using an errors.Is check: - * - * ``` - * path, err := exec.LookPath("prog") - * if errors.Is(err, exec.ErrDot) { - * err = nil - * } - * if err != nil { - * log.Fatal(err) - * } - * use(path) - * ``` - * - * and - * - * ``` - * cmd := exec.Command("prog") - * if errors.Is(cmd.Err, exec.ErrDot) { - * cmd.Err = nil - * } - * if err := cmd.Run(); err != nil { - * log.Fatal(err) - * } - * ``` - * - * Setting the environment variable GODEBUG=execerrdot=0 - * disables generation of ErrDot entirely, temporarily restoring the pre-Go 1.19 - * behavior for programs that are unable to apply more targeted fixes. - * A future version of Go may remove support for this variable. - * - * Before adding such overrides, make sure you understand the - * security implications of doing so. - * See https://go.dev/blog/path-security for more information. - */ -namespace exec { - /** - * Cmd represents an external command being prepared or run. - * - * A Cmd cannot be reused after calling its Run, Output or CombinedOutput - * methods. - */ - interface Cmd { - /** - * Path is the path of the command to run. - * - * This is the only field that must be set to a non-zero - * value. If Path is relative, it is evaluated relative - * to Dir. - */ - path: string - /** - * Args holds command line arguments, including the command as Args[0]. - * If the Args field is empty or nil, Run uses {Path}. - * - * In typical use, both Path and Args are set by calling Command. - */ - args: Array - /** - * Env specifies the environment of the process. - * Each entry is of the form "key=value". - * If Env is nil, the new process uses the current process's - * environment. - * If Env contains duplicate environment keys, only the last - * value in the slice for each duplicate key is used. - * As a special case on Windows, SYSTEMROOT is always added if - * missing and not explicitly set to the empty string. - */ - env: Array - /** - * Dir specifies the working directory of the command. - * If Dir is the empty string, Run runs the command in the - * calling process's current directory. - */ - dir: string - /** - * Stdin specifies the process's standard input. - * - * If Stdin is nil, the process reads from the null device (os.DevNull). - * - * If Stdin is an *os.File, the process's standard input is connected - * directly to that file. - * - * Otherwise, during the execution of the command a separate - * goroutine reads from Stdin and delivers that data to the command - * over a pipe. In this case, Wait does not complete until the goroutine - * stops copying, either because it has reached the end of Stdin - * (EOF or a read error) or because writing to the pipe returned an error. - */ - stdin: io.Reader - /** - * Stdout and Stderr specify the process's standard output and error. - * - * If either is nil, Run connects the corresponding file descriptor - * to the null device (os.DevNull). - * - * If either is an *os.File, the corresponding output from the process - * is connected directly to that file. - * - * Otherwise, during the execution of the command a separate goroutine - * reads from the process over a pipe and delivers that data to the - * corresponding Writer. In this case, Wait does not complete until the - * goroutine reaches EOF or encounters an error. - * - * If Stdout and Stderr are the same writer, and have a type that can - * be compared with ==, at most one goroutine at a time will call Write. - */ - stdout: io.Writer - stderr: io.Writer - /** - * ExtraFiles specifies additional open files to be inherited by the - * new process. It does not include standard input, standard output, or - * standard error. If non-nil, entry i becomes file descriptor 3+i. - * - * ExtraFiles is not supported on Windows. - */ - extraFiles: Array<(os.File | undefined)> - /** - * SysProcAttr holds optional, operating system-specific attributes. - * Run passes it to os.StartProcess as the os.ProcAttr's Sys field. - */ - sysProcAttr?: syscall.SysProcAttr - /** - * Process is the underlying process, once started. - */ - process?: os.Process - /** - * ProcessState contains information about an exited process, - * available after a call to Wait or Run. - */ - processState?: os.ProcessState - err: Error // LookPath error, if any. - } - interface Cmd { - /** - * String returns a human-readable description of c. - * It is intended only for debugging. - * In particular, it is not suitable for use as input to a shell. - * The output of String may vary across Go releases. - */ - string(): string - } - interface Cmd { - /** - * Run starts the specified command and waits for it to complete. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command starts but does not complete successfully, the error is of - * type *ExitError. Other error types may be returned for other situations. - * - * If the calling goroutine has locked the operating system thread - * with runtime.LockOSThread and modified any inheritable OS-level - * thread state (for example, Linux or Plan 9 name spaces), the new - * process will inherit the caller's thread state. - */ - run(): void - } - interface Cmd { - /** - * Start starts the specified command but does not wait for it to complete. - * - * If Start returns successfully, the c.Process field will be set. - * - * After a successful call to Start the Wait method must be called in - * order to release associated system resources. - */ - start(): void - } - interface Cmd { - /** - * Wait waits for the command to exit and waits for any copying to - * stdin or copying from stdout or stderr to complete. - * - * The command must have been started by Start. - * - * The returned error is nil if the command runs, has no problems - * copying stdin, stdout, and stderr, and exits with a zero exit - * status. - * - * If the command fails to run or doesn't complete successfully, the - * error is of type *ExitError. Other error types may be - * returned for I/O problems. - * - * If any of c.Stdin, c.Stdout or c.Stderr are not an *os.File, Wait also waits - * for the respective I/O loop copying to or from the process to complete. - * - * Wait releases any resources associated with the Cmd. - */ - wait(): void - } - interface Cmd { - /** - * Output runs the command and returns its standard output. - * Any returned error will usually be of type *ExitError. - * If c.Stderr was nil, Output populates ExitError.Stderr. - */ - output(): string|Array - } - interface Cmd { - /** - * CombinedOutput runs the command and returns its combined standard - * output and standard error. - */ - combinedOutput(): string|Array - } - interface Cmd { - /** - * StdinPipe returns a pipe that will be connected to the command's - * standard input when the command starts. - * The pipe will be closed automatically after Wait sees the command exit. - * A caller need only call Close to force the pipe to close sooner. - * For example, if the command being run will not exit until standard input - * is closed, the caller must close the pipe. - */ - stdinPipe(): io.WriteCloser - } - interface Cmd { - /** - * StdoutPipe returns a pipe that will be connected to the command's - * standard output when the command starts. - * - * Wait will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to call Run when using StdoutPipe. - * See the example for idiomatic usage. - */ - stdoutPipe(): io.ReadCloser - } - interface Cmd { - /** - * StderrPipe returns a pipe that will be connected to the command's - * standard error when the command starts. - * - * Wait will close the pipe after seeing the command exit, so most callers - * need not close the pipe themselves. It is thus incorrect to call Wait - * before all reads from the pipe have completed. - * For the same reason, it is incorrect to use Run when using StderrPipe. - * See the StdoutPipe example for idiomatic usage. - */ - stderrPipe(): io.ReadCloser - } - interface Cmd { - /** - * Environ returns a copy of the environment in which the command would be run - * as it is currently configured. - */ - environ(): Array - } -} - -/** - * Package blob provides an easy and portable way to interact with blobs - * within a storage location. Subpackages contain driver implementations of - * blob for supported services. - * - * See https://gocloud.dev/howto/blob/ for a detailed how-to guide. - * - * *blob.Bucket implements io/fs.FS and io/fs.SubFS, so it can be used with - * functions in that package. - * - * # Errors - * - * The errors returned from this package can be inspected in several ways: - * - * The Code function from gocloud.dev/gcerrors will return an error code, also - * defined in that package, when invoked on an error. - * - * The Bucket.ErrorAs method can retrieve the driver error underlying the returned - * error. - * - * # OpenCensus Integration - * - * OpenCensus supports tracing and metric collection for multiple languages and - * backend providers. See https://opencensus.io. - * - * This API collects OpenCensus traces and metrics for the following methods: - * ``` - * - Attributes - * - Copy - * - Delete - * - ListPage - * - NewRangeReader, from creation until the call to Close. (NewReader and ReadAll - * are included because they call NewRangeReader.) - * - NewWriter, from creation until the call to Close. - * ``` - * - * All trace and metric names begin with the package import path. - * The traces add the method name. - * For example, "gocloud.dev/blob/Attributes". - * The metrics are "completed_calls", a count of completed method calls by driver, - * method and status (error code); and "latency", a distribution of method latency - * by driver and method. - * For example, "gocloud.dev/blob/latency". - * - * It also collects the following metrics: - * ``` - * - gocloud.dev/blob/bytes_read: the total number of bytes read, by driver. - * - gocloud.dev/blob/bytes_written: the total number of bytes written, by driver. - * ``` - * - * To enable trace collection in your application, see "Configure Exporter" at - * https://opencensus.io/quickstart/go/tracing. - * To enable metric collection in your application, see "Exporting stats" at - * https://opencensus.io/quickstart/go/metrics. - */ -namespace blob { - /** - * Reader reads bytes from a blob. - * It implements io.ReadSeekCloser, and must be closed after - * reads are finished. - */ - interface Reader { - } - interface Reader { - /** - * Read implements io.Reader (https://golang.org/pkg/io/#Reader). - */ - read(p: string|Array): number - } - interface Reader { - /** - * Seek implements io.Seeker (https://golang.org/pkg/io/#Seeker). - */ - seek(offset: number, whence: number): number - } - interface Reader { - /** - * Close implements io.Closer (https://golang.org/pkg/io/#Closer). - */ - close(): void - } - interface Reader { - /** - * ContentType returns the MIME type of the blob. - */ - contentType(): string - } - interface Reader { - /** - * ModTime returns the time the blob was last modified. - */ - modTime(): time.Time - } - interface Reader { - /** - * Size returns the size of the blob content in bytes. - */ - size(): number - } - interface Reader { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } - interface Reader { - /** - * WriteTo reads from r and writes to w until there's no more data or - * an error occurs. - * The return value is the number of bytes written to w. - * - * It implements the io.WriterTo interface. - */ - writeTo(w: io.Writer): number - } - /** - * Attributes contains attributes about a blob. - */ - interface Attributes { - /** - * CacheControl specifies caching attributes that services may use - * when serving the blob. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control - */ - cacheControl: string - /** - * ContentDisposition specifies whether the blob content is expected to be - * displayed inline or as an attachment. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition - */ - contentDisposition: string - /** - * ContentEncoding specifies the encoding used for the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding - */ - contentEncoding: string - /** - * ContentLanguage specifies the language used in the blob's content, if any. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language - */ - contentLanguage: string - /** - * ContentType is the MIME type of the blob. It will not be empty. - * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type - */ - contentType: string - /** - * Metadata holds key/value pairs associated with the blob. - * Keys are guaranteed to be in lowercase, even if the backend service - * has case-sensitive keys (although note that Metadata written via - * this package will always be lowercased). If there are duplicate - * case-insensitive keys (e.g., "foo" and "FOO"), only one value - * will be kept, and it is undefined which one. - */ - metadata: _TygojaDict - /** - * CreateTime is the time the blob was created, if available. If not available, - * CreateTime will be the zero time. - */ - createTime: time.Time - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number - /** - * MD5 is an MD5 hash of the blob contents or nil if not available. - */ - md5: string|Array - /** - * ETag for the blob; see https://en.wikipedia.org/wiki/HTTP_ETag. - */ - eTag: string - } - interface Attributes { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } - /** - * ListObject represents a single blob returned from List. - */ - interface ListObject { - /** - * Key is the key for this blob. - */ - key: string - /** - * ModTime is the time the blob was last modified. - */ - modTime: time.Time - /** - * Size is the size of the blob's content in bytes. - */ - size: number - /** - * MD5 is an MD5 hash of the blob contents or nil if not available. - */ - md5: string|Array - /** - * IsDir indicates that this result represents a "directory" in the - * hierarchical namespace, ending in ListOptions.Delimiter. Key can be - * passed as ListOptions.Prefix to list items in the "directory". - * Fields other than Key and IsDir will not be set if IsDir is true. - */ - isDir: boolean - } - interface ListObject { - /** - * As converts i to driver-specific types. - * See https://gocloud.dev/concepts/as/ for background information, the "As" - * examples in this package for examples, and the driver package - * documentation for the specific types supported for that driver. - */ - as(i: { - }): boolean - } -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonArray defines a slice that is safe for json and db read/write. - */ - interface JsonArray extends Array{} - interface JsonArray { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface JsonArray { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonArray { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonArray[T] instance. - */ - scan(value: any): void - } - /** - * JsonMap defines a map that is safe for json and db read/write. - */ - interface JsonMap extends _TygojaDict{} - interface JsonMap { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface JsonMap { - /** - * Get retrieves a single value from the current JsonMap. - * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). - */ - get(key: string): any - } - interface JsonMap { - /** - * Set sets a single value in the current JsonMap. - * - * This helper was added primarily to assist the goja integration since custom map types - * don't have direct access to the map keys (https://pkg.go.dev/github.com/dop251/goja#hdr-Maps_with_methods). - */ - set(key: string, value: any): void - } - interface JsonMap { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonMap { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current `JsonMap` instance. - */ - scan(value: any): void - } -} - -/** - * Package schema implements custom Schema and SchemaField datatypes - * for handling the Collection schema definitions. - */ -namespace schema { - // @ts-ignore - import validation = ozzo_validation - /** - * Schema defines a dynamic db schema as a slice of `SchemaField`s. - */ - interface Schema { - } - interface Schema { - /** - * Fields returns the registered schema fields. - */ - fields(): Array<(SchemaField | undefined)> - } - interface Schema { - /** - * InitFieldsOptions calls `InitOptions()` for all schema fields. - */ - initFieldsOptions(): void - } - interface Schema { - /** - * Clone creates a deep clone of the current schema. - */ - clone(): (Schema) - } - interface Schema { - /** - * AsMap returns a map with all registered schema field. - * The returned map is indexed with each field name. - */ - asMap(): _TygojaDict - } - interface Schema { - /** - * GetFieldById returns a single field by its id. - */ - getFieldById(id: string): (SchemaField) - } - interface Schema { - /** - * GetFieldByName returns a single field by its name. - */ - getFieldByName(name: string): (SchemaField) - } - interface Schema { - /** - * RemoveField removes a single schema field by its id. - * - * This method does nothing if field with `id` doesn't exist. - */ - removeField(id: string): void - } - interface Schema { - /** - * AddField registers the provided newField to the current schema. - * - * If field with `newField.Id` already exist, the existing field is - * replaced with the new one. - * - * Otherwise the new field is appended to the other schema fields. - */ - addField(newField: SchemaField): void - } - interface Schema { - /** - * Validate makes Schema validatable by implementing [validation.Validatable] interface. - * - * Internally calls each individual field's validator and additionally - * checks for invalid renamed fields and field name duplications. - */ - validate(): void - } - interface Schema { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface Schema { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - * - * On success, all schema field options are auto initialized. - */ - unmarshalJSON(data: string|Array): void - } - interface Schema { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface Schema { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current Schema instance. - */ - scan(value: any): void - } -} - -/** - * Package models implements all PocketBase DB models and DTOs. - */ -namespace models { - type _subVziVV = BaseModel - interface Admin extends _subVziVV { - avatar: number - email: string - tokenKey: string - passwordHash: string - lastResetSentAt: types.DateTime - } - interface Admin { - /** - * TableName returns the Admin model SQL table name. - */ - tableName(): string - } - interface Admin { - /** - * ValidatePassword validates a plain password against the model's password. - */ - validatePassword(password: string): boolean - } - interface Admin { - /** - * SetPassword sets cryptographically secure string to `model.Password`. - * - * Additionally this method also resets the LastResetSentAt and the TokenKey fields. - */ - setPassword(password: string): void - } - interface Admin { - /** - * RefreshTokenKey generates and sets new random token key. - */ - refreshTokenKey(): void - } - // @ts-ignore - import validation = ozzo_validation - type _subrjVFg = BaseModel - interface Collection extends _subrjVFg { - name: string - type: string - system: boolean - schema: schema.Schema - indexes: types.JsonArray - /** - * rules - */ - listRule?: string - viewRule?: string - createRule?: string - updateRule?: string - deleteRule?: string - options: types.JsonMap - } - interface Collection { - /** - * TableName returns the Collection model SQL table name. - */ - tableName(): string - } - interface Collection { - /** - * BaseFilesPath returns the storage dir path used by the collection. - */ - baseFilesPath(): string - } - interface Collection { - /** - * IsBase checks if the current collection has "base" type. - */ - isBase(): boolean - } - interface Collection { - /** - * IsAuth checks if the current collection has "auth" type. - */ - isAuth(): boolean - } - interface Collection { - /** - * IsView checks if the current collection has "view" type. - */ - isView(): boolean - } - interface Collection { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface Collection { - /** - * BaseOptions decodes the current collection options and returns them - * as new [CollectionBaseOptions] instance. - */ - baseOptions(): CollectionBaseOptions - } - interface Collection { - /** - * AuthOptions decodes the current collection options and returns them - * as new [CollectionAuthOptions] instance. - */ - authOptions(): CollectionAuthOptions - } - interface Collection { - /** - * ViewOptions decodes the current collection options and returns them - * as new [CollectionViewOptions] instance. - */ - viewOptions(): CollectionViewOptions - } - interface Collection { - /** - * NormalizeOptions updates the current collection options with a - * new normalized state based on the collection type. - */ - normalizeOptions(): void - } - interface Collection { - /** - * DecodeOptions decodes the current collection options into the - * provided "result" (must be a pointer). - */ - decodeOptions(result: any): void - } - interface Collection { - /** - * SetOptions normalizes and unmarshals the specified options into m.Options. - */ - setOptions(typedOptions: any): void - } - type _subLUwFE = BaseModel - interface ExternalAuth extends _subLUwFE { - collectionId: string - recordId: string - provider: string - providerId: string - } - interface ExternalAuth { - tableName(): string - } - type _subWLLaT = BaseModel - interface Record extends _subWLLaT { - } - interface Record { - /** - * TableName returns the table name associated to the current Record model. - */ - tableName(): string - } - interface Record { - /** - * Collection returns the Collection model associated to the current Record model. - */ - collection(): (Collection) - } - interface Record { - /** - * OriginalCopy returns a copy of the current record model populated - * with its ORIGINAL data state (aka. the initially loaded) and - * everything else reset to the defaults. - */ - originalCopy(): (Record) - } - interface Record { - /** - * CleanCopy returns a copy of the current record model populated only - * with its LATEST data state and everything else reset to the defaults. - */ - cleanCopy(): (Record) - } - interface Record { - /** - * Expand returns a shallow copy of the current Record model expand data. - */ - expand(): _TygojaDict - } - interface Record { - /** - * SetExpand shallow copies the provided data to the current Record model's expand. - */ - setExpand(expand: _TygojaDict): void - } - interface Record { - /** - * MergeExpand merges recursively the provided expand data into - * the current model's expand (if any). - * - * Note that if an expanded prop with the same key is a slice (old or new expand) - * then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]). - * Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew). - */ - mergeExpand(expand: _TygojaDict): void - } - interface Record { - /** - * SchemaData returns a shallow copy ONLY of the defined record schema fields data. - */ - schemaData(): _TygojaDict - } - interface Record { - /** - * UnknownData returns a shallow copy ONLY of the unknown record fields data, - * aka. fields that are neither one of the base and special system ones, - * nor defined by the collection schema. - */ - unknownData(): _TygojaDict - } - interface Record { - /** - * IgnoreEmailVisibility toggles the flag to ignore the auth record email visibility check. - */ - ignoreEmailVisibility(state: boolean): void - } - interface Record { - /** - * WithUnknownData toggles the export/serialization of unknown data fields - * (false by default). - */ - withUnknownData(state: boolean): void - } - interface Record { - /** - * Set sets the provided key-value data pair for the current Record model. - * - * If the record collection has field with name matching the provided "key", - * the value will be further normalized according to the field rules. - */ - set(key: string, value: any): void - } - interface Record { - /** - * Get returns a normalized single record model data value for "key". - */ - get(key: string): any - } - interface Record { - /** - * GetBool returns the data value for "key" as a bool. - */ - getBool(key: string): boolean - } - interface Record { - /** - * GetString returns the data value for "key" as a string. - */ - getString(key: string): string - } - interface Record { - /** - * GetInt returns the data value for "key" as an int. - */ - getInt(key: string): number - } - interface Record { - /** - * GetFloat returns the data value for "key" as a float64. - */ - getFloat(key: string): number - } - interface Record { - /** - * GetTime returns the data value for "key" as a [time.Time] instance. - */ - getTime(key: string): time.Time - } - interface Record { - /** - * GetDateTime returns the data value for "key" as a DateTime instance. - */ - getDateTime(key: string): types.DateTime - } - interface Record { - /** - * GetStringSlice returns the data value for "key" as a slice of unique strings. - */ - getStringSlice(key: string): Array - } - interface Record { - /** - * ExpandedOne retrieves a single relation Record from the already - * loaded expand data of the current model. - * - * If the requested expand relation is multiple, this method returns - * only first available Record from the expanded relation. - * - * Returns nil if there is no such expand relation loaded. - */ - expandedOne(relField: string): (Record) - } - interface Record { - /** - * ExpandedAll retrieves a slice of relation Records from the already - * loaded expand data of the current model. - * - * If the requested expand relation is single, this method normalizes - * the return result and will wrap the single model as a slice. - * - * Returns nil slice if there is no such expand relation loaded. - */ - expandedAll(relField: string): Array<(Record | undefined)> - } - interface Record { - /** - * Retrieves the "key" json field value and unmarshals it into "result". - * - * Example - * - * ``` - * result := struct { - * FirstName string `json:"first_name"` - * }{} - * err := m.UnmarshalJSONField("my_field_name", &result) - * ``` - */ - unmarshalJSONField(key: string, result: any): void - } - interface Record { - /** - * BaseFilesPath returns the storage dir path used by the record. - */ - baseFilesPath(): string - } - interface Record { - /** - * FindFileFieldByFile returns the first file type field for which - * any of the record's data contains the provided filename. - */ - findFileFieldByFile(filename: string): (schema.SchemaField) - } - interface Record { - /** - * Load bulk loads the provided data into the current Record model. - */ - load(data: _TygojaDict): void - } - interface Record { - /** - * ColumnValueMap implements [ColumnValueMapper] interface. - */ - columnValueMap(): _TygojaDict - } - interface Record { - /** - * PublicExport exports only the record fields that are safe to be public. - * - * For auth records, to force the export of the email field you need to set - * `m.IgnoreEmailVisibility(true)`. - */ - publicExport(): _TygojaDict - } - interface Record { - /** - * MarshalJSON implements the [json.Marshaler] interface. - * - * Only the data exported by `PublicExport()` will be serialized. - */ - marshalJSON(): string|Array - } - interface Record { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(data: string|Array): void - } - interface Record { - /** - * ReplaceModifers returns a new map with applied modifier - * values based on the current record and the specified data. - * - * The resolved modifier keys will be removed. - * - * Multiple modifiers will be applied one after another, - * while reusing the previous base key value result (eg. 1; -5; +2 => -2). - * - * Example usage: - * - * ``` - * newData := record.ReplaceModifers(data) - * // record: {"field": 10} - * // data: {"field+": 5} - * // newData: {"field": 15} - * ``` - */ - replaceModifers(data: _TygojaDict): _TygojaDict - } - interface Record { - /** - * Username returns the "username" auth record data value. - */ - username(): string - } - interface Record { - /** - * SetUsername sets the "username" auth record data value. - * - * This method doesn't check whether the provided value is a valid username. - * - * Returns an error if the record is not from an auth collection. - */ - setUsername(username: string): void - } - interface Record { - /** - * Email returns the "email" auth record data value. - */ - email(): string - } - interface Record { - /** - * SetEmail sets the "email" auth record data value. - * - * This method doesn't check whether the provided value is a valid email. - * - * Returns an error if the record is not from an auth collection. - */ - setEmail(email: string): void - } - interface Record { - /** - * Verified returns the "emailVisibility" auth record data value. - */ - emailVisibility(): boolean - } - interface Record { - /** - * SetEmailVisibility sets the "emailVisibility" auth record data value. - * - * Returns an error if the record is not from an auth collection. - */ - setEmailVisibility(visible: boolean): void - } - interface Record { - /** - * Verified returns the "verified" auth record data value. - */ - verified(): boolean - } - interface Record { - /** - * SetVerified sets the "verified" auth record data value. - * - * Returns an error if the record is not from an auth collection. - */ - setVerified(verified: boolean): void - } - interface Record { - /** - * TokenKey returns the "tokenKey" auth record data value. - */ - tokenKey(): string - } - interface Record { - /** - * SetTokenKey sets the "tokenKey" auth record data value. - * - * Returns an error if the record is not from an auth collection. - */ - setTokenKey(key: string): void - } - interface Record { - /** - * RefreshTokenKey generates and sets new random auth record "tokenKey". - * - * Returns an error if the record is not from an auth collection. - */ - refreshTokenKey(): void - } - interface Record { - /** - * LastResetSentAt returns the "lastResentSentAt" auth record data value. - */ - lastResetSentAt(): types.DateTime - } - interface Record { - /** - * SetLastResetSentAt sets the "lastResentSentAt" auth record data value. - * - * Returns an error if the record is not from an auth collection. - */ - setLastResetSentAt(dateTime: types.DateTime): void - } - interface Record { - /** - * LastVerificationSentAt returns the "lastVerificationSentAt" auth record data value. - */ - lastVerificationSentAt(): types.DateTime - } - interface Record { - /** - * SetLastVerificationSentAt sets an "lastVerificationSentAt" auth record data value. - * - * Returns an error if the record is not from an auth collection. - */ - setLastVerificationSentAt(dateTime: types.DateTime): void - } - interface Record { - /** - * PasswordHash returns the "passwordHash" auth record data value. - */ - passwordHash(): string - } - interface Record { - /** - * ValidatePassword validates a plain password against the auth record password. - * - * Returns false if the password is incorrect or record is not from an auth collection. - */ - validatePassword(password: string): boolean - } - interface Record { - /** - * SetPassword sets cryptographically secure string to the auth record "password" field. - * This method also resets the "lastResetSentAt" and the "tokenKey" fields. - * - * Returns an error if the record is not from an auth collection or - * an empty password is provided. - */ - setPassword(password: string): void - } - /** - * RequestInfo defines a HTTP request data struct, usually used - * as part of the `@request.*` filter resolver. - */ - interface RequestInfo { - query: _TygojaDict - data: _TygojaDict - headers: _TygojaDict - authRecord?: Record - admin?: Admin - method: string - } - interface RequestInfo { - /** - * HasModifierDataKeys loosely checks if the current struct has any modifier Data keys. - */ - hasModifierDataKeys(): boolean - } -} - namespace settings { // @ts-ignore import validation = ozzo_validation @@ -11849,6 +11996,36 @@ namespace daos { */ deleteExternalAuth(model: models.ExternalAuth): void } + interface Dao { + /** + * LogQuery returns a new Log select query. + */ + logQuery(): (dbx.SelectQuery) + } + interface Dao { + /** + * FindLogById finds a single Log entry by its id. + */ + findLogById(id: string): (models.Log) + } + interface Dao { + /** + * LogsStats returns hourly grouped requests logs statistics. + */ + logsStats(expr: dbx.Expression): Array<(LogsStatsItem | undefined)> + } + interface Dao { + /** + * DeleteOldLogs delete all requests that are created before createdBefore. + */ + deleteOldLogs(createdBefore: time.Time): void + } + interface Dao { + /** + * SaveLog upserts the provided Log model. + */ + saveLog(log: models.Log): void + } interface Dao { /** * ParamQuery returns a new Param select query. @@ -12095,36 +12272,6 @@ namespace daos { */ syncRecordTableSchema(newCollection: models.Collection, oldCollection: models.Collection): void } - interface Dao { - /** - * RequestQuery returns a new Request logs select query. - */ - requestQuery(): (dbx.SelectQuery) - } - interface Dao { - /** - * FindRequestById finds a single Request log by its id. - */ - findRequestById(id: string): (models.Request) - } - interface Dao { - /** - * RequestsStats returns hourly grouped requests logs statistics. - */ - requestsStats(expr: dbx.Expression): Array<(RequestsStatsItem | undefined)> - } - interface Dao { - /** - * DeleteOldRequests delete all requests that are created before createdBefore. - */ - deleteOldRequests(createdBefore: time.Time): void - } - interface Dao { - /** - * SaveRequest upserts the provided Request model. - */ - saveRequest(request: models.Request): void - } interface Dao { /** * FindSettings returns and decode the serialized app settings param value. @@ -12273,6 +12420,10 @@ namespace core { * the users table from LogsDao will result in error. */ logsDao(): (daos.Dao) + /** + * Logger returns the active app logger. + */ + logger(): (slog.Logger) /** * DataDir returns the app data directory path. */ @@ -12282,19 +12433,18 @@ namespace core { * (used for settings encryption). */ encryptionEnv(): string - /** - * IsDebug returns whether the app is in debug mode - * (showing more detailed error logs, executed sql statements, etc.). - */ - isDebug(): boolean /** * Settings returns the loaded app settings. */ settings(): (settings.Settings) /** - * Cache returns the app internal cache store. + * Deprecated: Use app.Store() instead. */ cache(): (store.Store) + /** + * Store returns the app runtime store. + */ + store(): (store.Store) /** * SubscriptionsBroker returns the app realtime subscriptions broker instance. */ @@ -13210,7 +13360,7 @@ namespace cobra { deprecated: string /** * Annotations are key/value pairs that can be used by applications to identify or - * group commands. + * group commands or set special options. */ annotations: _TygojaDict /** @@ -13230,6 +13380,8 @@ namespace cobra { * * PersistentPostRun() * ``` * All functions get the same args, the arguments after the command name. + * The *PreRun and *PostRun functions will only be executed if the Run function of the current + * command has been declared. * * PersistentPreRun: children of this command will inherit and execute. */ @@ -13430,6 +13582,12 @@ namespace cobra { */ setVersionTemplate(s: string): void } + interface Command { + /** + * SetErrPrefix sets error message prefix to be used. Application can use it to set custom prefix. + */ + setErrPrefix(s: string): void + } interface Command { /** * SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands. @@ -13541,6 +13699,12 @@ namespace cobra { */ versionTemplate(): string } + interface Command { + /** + * ErrPrefix return error message prefix for the command + */ + errPrefix(): string + } interface Command { /** * Find the target command given the args and command tree @@ -13750,6 +13914,7 @@ namespace cobra { /** * DebugFlags used to determine which flags have been assigned to which commands * and which persist. + * nolint:goconst */ debugFlags(): void } @@ -13958,6 +14123,12 @@ namespace cobra { */ registerFlagCompletionFunc(flagName: string, f: (cmd: Command, args: Array, toComplete: string) => [Array, ShellCompDirective]): void } + interface Command { + /** + * GetFlagCompletionFunc returns the completion function for the given flag of the command, if available. + */ + getFlagCompletionFunc(flagName: string): [(_arg0: Command, _arg1: Array, _arg2: string) => [Array, ShellCompDirective], boolean] + } interface Command { /** * InitDefaultCompletionCmd adds a default 'completion' command to c. @@ -13987,6 +14158,13 @@ namespace cobra { */ markFlagsRequiredTogether(...flagNames: string[]): void } + interface Command { + /** + * MarkFlagsOneRequired marks the given flags with annotations so that Cobra errors + * if the command is invoked without at least one flag from the given set of flags. + */ + markFlagsOneRequired(...flagNames: string[]): void + } interface Command { /** * MarkFlagsMutuallyExclusive marks the given flags with annotations so that Cobra errors @@ -13996,7 +14174,7 @@ namespace cobra { } interface Command { /** - * ValidateFlagGroups validates the mutuallyExclusive/requiredAsGroup logic and returns the + * ValidateFlagGroups validates the mutuallyExclusive/oneRequired/requiredAsGroup logic and returns the * first error encountered. */ validateFlagGroups(): void @@ -14168,6 +14346,46 @@ namespace migrate { } } +/** + * Package io provides basic interfaces to I/O primitives. + * Its primary job is to wrap existing implementations of such primitives, + * such as those in package os, into shared public interfaces that + * abstract the functionality, plus some other related primitives. + * + * Because these interfaces and primitives wrap lower-level operations with + * various implementations, unless otherwise informed clients should not + * assume they are safe for parallel execution. + */ +namespace io { + /** + * Writer is the interface that wraps the basic Write method. + * + * Write writes len(p) bytes from p to the underlying data stream. + * It returns the number of bytes written from p (0 <= n <= len(p)) + * and any error encountered that caused the write to stop early. + * Write must return a non-nil error if it returns n < len(p). + * Write must not modify the slice data, even temporarily. + * + * Implementations must not retain p. + */ + interface Writer { + [key:string]: any; + write(p: string|Array): number + } + /** + * ReadCloser is the interface that groups the basic Read and Close methods. + */ + interface ReadCloser { + [key:string]: any; + } + /** + * WriteCloser is the interface that groups the basic Write and Close methods. + */ + interface WriteCloser { + [key:string]: any; + } +} + /** * Package syscall contains an interface to the low-level operating system * primitives. The details vary depending on the underlying system, and @@ -14273,7 +14491,7 @@ namespace syscall { * The canonical way to strip a monotonic clock reading is to use t = t.Round(0). * * If Times t and u both contain monotonic clock readings, the operations - * t.After(u), t.Before(u), t.Equal(u), and t.Sub(u) are carried out + * t.After(u), t.Before(u), t.Equal(u), t.Compare(u), and t.Sub(u) are carried out * using the monotonic clock readings alone, ignoring the wall clock * readings. If either t or u contains no monotonic clock reading, these * operations fall back to using the wall clock readings. @@ -14343,27 +14561,241 @@ namespace time { } /** - * Package io provides basic interfaces to I/O primitives. - * Its primary job is to wrap existing implementations of such primitives, - * such as those in package os, into shared public interfaces that - * abstract the functionality, plus some other related primitives. - * - * Because these interfaces and primitives wrap lower-level operations with - * various implementations, unless otherwise informed clients should not - * assume they are safe for parallel execution. + * Package fs defines basic interfaces to a file system. + * A file system can be provided by the host operating system + * but also by other packages. */ -namespace io { +namespace fs { +} + +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { /** - * ReadCloser is the interface that groups the basic Read and Close methods. + * A URL represents a parsed URL (technically, a URI reference). + * + * The general form represented is: + * + * ``` + * [scheme:][//[userinfo@]host][/]path[?query][#fragment] + * ``` + * + * URLs that do not start with a slash after the scheme are interpreted as: + * + * ``` + * scheme:opaque[?query][#fragment] + * ``` + * + * Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. + * A consequence is that it is impossible to tell which slashes in the Path were + * slashes in the raw URL and which were %2f. This distinction is rarely important, + * but when it is, the code should use the EscapedPath method, which preserves + * the original encoding of Path. + * + * The RawPath field is an optional field which is only set when the default + * encoding of Path is different from the escaped path. See the EscapedPath method + * for more details. + * + * URL's String method uses the EscapedPath method to obtain the path. */ - interface ReadCloser { - [key:string]: any; + interface URL { + scheme: string + opaque: string // encoded opaque data + user?: Userinfo // username and password information + host: string // host or host:port + path: string // path (relative paths may omit leading slash) + rawPath: string // encoded path hint (see EscapedPath method) + omitHost: boolean // do not emit empty host (authority) + forceQuery: boolean // append a query ('?') even if RawQuery is empty + rawQuery: string // encoded query values, without '?' + fragment: string // fragment for references, without '#' + rawFragment: string // encoded fragment hint (see EscapedFragment method) + } + interface URL { + /** + * EscapedPath returns the escaped form of u.Path. + * In general there are multiple possible escaped forms of any path. + * EscapedPath returns u.RawPath when it is a valid escaping of u.Path. + * Otherwise EscapedPath ignores u.RawPath and computes an escaped + * form on its own. + * The String and RequestURI methods use EscapedPath to construct + * their results. + * In general, code should call EscapedPath instead of + * reading u.RawPath directly. + */ + escapedPath(): string + } + interface URL { + /** + * EscapedFragment returns the escaped form of u.Fragment. + * In general there are multiple possible escaped forms of any fragment. + * EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment. + * Otherwise EscapedFragment ignores u.RawFragment and computes an escaped + * form on its own. + * The String method uses EscapedFragment to construct its result. + * In general, code should call EscapedFragment instead of + * reading u.RawFragment directly. + */ + escapedFragment(): string + } + interface URL { + /** + * String reassembles the URL into a valid URL string. + * The general form of the result is one of: + * + * ``` + * scheme:opaque?query#fragment + * scheme://userinfo@host/path?query#fragment + * ``` + * + * If u.Opaque is non-empty, String uses the first form; + * otherwise it uses the second form. + * Any non-ASCII characters in host are escaped. + * To obtain the path, String uses u.EscapedPath(). + * + * In the second form, the following rules apply: + * ``` + * - if u.Scheme is empty, scheme: is omitted. + * - if u.User is nil, userinfo@ is omitted. + * - if u.Host is empty, host/ is omitted. + * - if u.Scheme and u.Host are empty and u.User is nil, + * the entire scheme://userinfo@host/ is omitted. + * - if u.Host is non-empty and u.Path begins with a /, + * the form host/path does not add its own /. + * - if u.RawQuery is empty, ?query is omitted. + * - if u.Fragment is empty, #fragment is omitted. + * ``` + */ + string(): string + } + interface URL { + /** + * Redacted is like String but replaces any password with "xxxxx". + * Only the password in u.User is redacted. + */ + redacted(): string } /** - * WriteCloser is the interface that groups the basic Write and Close methods. + * Values maps a string key to a list of values. + * It is typically used for query parameters and form values. + * Unlike in the http.Header map, the keys in a Values map + * are case-sensitive. */ - interface WriteCloser { - [key:string]: any; + interface Values extends _TygojaDict{} + interface Values { + /** + * Get gets the first value associated with the given key. + * If there are no values associated with the key, Get returns + * the empty string. To access multiple values, use the map + * directly. + */ + get(key: string): string + } + interface Values { + /** + * Set sets the key to value. It replaces any existing + * values. + */ + set(key: string): void + } + interface Values { + /** + * Add adds the value to key. It appends to any existing + * values associated with key. + */ + add(key: string): void + } + interface Values { + /** + * Del deletes the values associated with key. + */ + del(key: string): void + } + interface Values { + /** + * Has checks whether a given key is set. + */ + has(key: string): boolean + } + interface Values { + /** + * Encode encodes the values into “URL encoded” form + * ("bar=baz&foo=quux") sorted by key. + */ + encode(): string + } + interface URL { + /** + * IsAbs reports whether the URL is absolute. + * Absolute means that it has a non-empty scheme. + */ + isAbs(): boolean + } + interface URL { + /** + * Parse parses a URL in the context of the receiver. The provided URL + * may be relative or absolute. Parse returns nil, err on parse + * failure, otherwise its return value is the same as ResolveReference. + */ + parse(ref: string): (URL) + } + interface URL { + /** + * ResolveReference resolves a URI reference to an absolute URI from + * an absolute base URI u, per RFC 3986 Section 5.2. The URI reference + * may be relative or absolute. ResolveReference always returns a new + * URL instance, even if the returned URL is identical to either the + * base or reference. If ref is an absolute URL, then ResolveReference + * ignores base and returns a copy of ref. + */ + resolveReference(ref: URL): (URL) + } + interface URL { + /** + * Query parses RawQuery and returns the corresponding values. + * It silently discards malformed value pairs. + * To check errors use ParseQuery. + */ + query(): Values + } + interface URL { + /** + * RequestURI returns the encoded path?query or opaque?query + * string that would be used in an HTTP request for u. + */ + requestURI(): string + } + interface URL { + /** + * Hostname returns u.Host, stripping any valid port number if present. + * + * If the result is enclosed in square brackets, as literal IPv6 addresses are, + * the square brackets are removed from the result. + */ + hostname(): string + } + interface URL { + /** + * Port returns the port part of u.Host, without the leading colon. + * + * If u.Host doesn't contain a valid numeric port, Port returns an empty string. + */ + port(): string + } + interface URL { + marshalBinary(): string|Array + } + interface URL { + unmarshalBinary(text: string|Array): void + } + interface URL { + /** + * JoinPath returns a new URL with the provided path elements joined to + * any existing path and the resulting path cleaned of any ./ or ../ elements. + * Any sequences of multiple / characters will be reduced to a single /. + */ + joinPath(...elem: string[]): (URL) } } @@ -14372,22 +14804,28 @@ namespace io { * cancellation signals, and other request-scoped values across API boundaries * and between processes. * - * Incoming requests to a server should create a Context, and outgoing + * Incoming requests to a server should create a [Context], and outgoing * calls to servers should accept a Context. The chain of function * calls between them must propagate the Context, optionally replacing - * it with a derived Context created using WithCancel, WithDeadline, - * WithTimeout, or WithValue. When a Context is canceled, all + * it with a derived Context created using [WithCancel], [WithDeadline], + * [WithTimeout], or [WithValue]. When a Context is canceled, all * Contexts derived from it are also canceled. * - * The WithCancel, WithDeadline, and WithTimeout functions take a + * The [WithCancel], [WithDeadline], and [WithTimeout] functions take a * Context (the parent) and return a derived Context (the child) and a - * CancelFunc. Calling the CancelFunc cancels the child and its + * [CancelFunc]. Calling the CancelFunc cancels the child and its * children, removes the parent's reference to the child, and stops * any associated timers. Failing to call the CancelFunc leaks the * child and its children until the parent is canceled or the timer * fires. The go vet tool checks that CancelFuncs are used on all * control-flow paths. * + * The [WithCancelCause] function returns a [CancelCauseFunc], which + * takes an error and records it as the cancellation cause. Calling + * [Cause] on the canceled context or any of its children retrieves + * the cause. If no cause is specified, Cause(ctx) returns the same + * value as ctx.Err(). + * * Programs that use Contexts should follow these rules to keep interfaces * consistent across packages and enable static analysis tools to check context * propagation: @@ -14402,7 +14840,7 @@ namespace io { * } * ``` * - * Do not pass a nil Context, even if a function permits it. Pass context.TODO + * Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] * if you are unsure about which Context to use. * * Use context Values only for request-scoped data that transits processes and @@ -14417,14 +14855,6 @@ namespace io { namespace context { } -/** - * Package fs defines basic interfaces to a file system. - * A file system can be provided by the host operating system - * but also by other packages. - */ -namespace fs { -} - /** * Package sql provides a generic interface around SQL (or SQL-like) * databases. @@ -14641,231 +15071,11 @@ namespace sql { } } -/** - * Package url parses URLs and implements query escaping. - */ -namespace url { - /** - * A URL represents a parsed URL (technically, a URI reference). - * - * The general form represented is: - * - * ``` - * [scheme:][//[userinfo@]host][/]path[?query][#fragment] - * ``` - * - * URLs that do not start with a slash after the scheme are interpreted as: - * - * ``` - * scheme:opaque[?query][#fragment] - * ``` - * - * Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/. - * A consequence is that it is impossible to tell which slashes in the Path were - * slashes in the raw URL and which were %2f. This distinction is rarely important, - * but when it is, the code should use RawPath, an optional field which only gets - * set if the default encoding is different from Path. - * - * URL's String method uses the EscapedPath method to obtain the path. See the - * EscapedPath method for more details. - */ - interface URL { - scheme: string - opaque: string // encoded opaque data - user?: Userinfo // username and password information - host: string // host or host:port - path: string // path (relative paths may omit leading slash) - rawPath: string // encoded path hint (see EscapedPath method) - omitHost: boolean // do not emit empty host (authority) - forceQuery: boolean // append a query ('?') even if RawQuery is empty - rawQuery: string // encoded query values, without '?' - fragment: string // fragment for references, without '#' - rawFragment: string // encoded fragment hint (see EscapedFragment method) - } - interface URL { - /** - * EscapedPath returns the escaped form of u.Path. - * In general there are multiple possible escaped forms of any path. - * EscapedPath returns u.RawPath when it is a valid escaping of u.Path. - * Otherwise EscapedPath ignores u.RawPath and computes an escaped - * form on its own. - * The String and RequestURI methods use EscapedPath to construct - * their results. - * In general, code should call EscapedPath instead of - * reading u.RawPath directly. - */ - escapedPath(): string - } - interface URL { - /** - * EscapedFragment returns the escaped form of u.Fragment. - * In general there are multiple possible escaped forms of any fragment. - * EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment. - * Otherwise EscapedFragment ignores u.RawFragment and computes an escaped - * form on its own. - * The String method uses EscapedFragment to construct its result. - * In general, code should call EscapedFragment instead of - * reading u.RawFragment directly. - */ - escapedFragment(): string - } - interface URL { - /** - * String reassembles the URL into a valid URL string. - * The general form of the result is one of: - * - * ``` - * scheme:opaque?query#fragment - * scheme://userinfo@host/path?query#fragment - * ``` - * - * If u.Opaque is non-empty, String uses the first form; - * otherwise it uses the second form. - * Any non-ASCII characters in host are escaped. - * To obtain the path, String uses u.EscapedPath(). - * - * In the second form, the following rules apply: - * ``` - * - if u.Scheme is empty, scheme: is omitted. - * - if u.User is nil, userinfo@ is omitted. - * - if u.Host is empty, host/ is omitted. - * - if u.Scheme and u.Host are empty and u.User is nil, - * the entire scheme://userinfo@host/ is omitted. - * - if u.Host is non-empty and u.Path begins with a /, - * the form host/path does not add its own /. - * - if u.RawQuery is empty, ?query is omitted. - * - if u.Fragment is empty, #fragment is omitted. - * ``` - */ - string(): string - } - interface URL { - /** - * Redacted is like String but replaces any password with "xxxxx". - * Only the password in u.URL is redacted. - */ - redacted(): string - } - /** - * Values maps a string key to a list of values. - * It is typically used for query parameters and form values. - * Unlike in the http.Header map, the keys in a Values map - * are case-sensitive. - */ - interface Values extends _TygojaDict{} - interface Values { - /** - * Get gets the first value associated with the given key. - * If there are no values associated with the key, Get returns - * the empty string. To access multiple values, use the map - * directly. - */ - get(key: string): string - } - interface Values { - /** - * Set sets the key to value. It replaces any existing - * values. - */ - set(key: string): void - } - interface Values { - /** - * Add adds the value to key. It appends to any existing - * values associated with key. - */ - add(key: string): void - } - interface Values { - /** - * Del deletes the values associated with key. - */ - del(key: string): void - } - interface Values { - /** - * Has checks whether a given key is set. - */ - has(key: string): boolean - } - interface Values { - /** - * Encode encodes the values into “URL encoded” form - * ("bar=baz&foo=quux") sorted by key. - */ - encode(): string - } - interface URL { - /** - * IsAbs reports whether the URL is absolute. - * Absolute means that it has a non-empty scheme. - */ - isAbs(): boolean - } - interface URL { - /** - * Parse parses a URL in the context of the receiver. The provided URL - * may be relative or absolute. Parse returns nil, err on parse - * failure, otherwise its return value is the same as ResolveReference. - */ - parse(ref: string): (URL) - } - interface URL { - /** - * ResolveReference resolves a URI reference to an absolute URI from - * an absolute base URI u, per RFC 3986 Section 5.2. The URI reference - * may be relative or absolute. ResolveReference always returns a new - * URL instance, even if the returned URL is identical to either the - * base or reference. If ref is an absolute URL, then ResolveReference - * ignores base and returns a copy of ref. - */ - resolveReference(ref: URL): (URL) - } - interface URL { - /** - * Query parses RawQuery and returns the corresponding values. - * It silently discards malformed value pairs. - * To check errors use ParseQuery. - */ - query(): Values - } - interface URL { - /** - * RequestURI returns the encoded path?query or opaque?query - * string that would be used in an HTTP request for u. - */ - requestURI(): string - } - interface URL { - /** - * Hostname returns u.Host, stripping any valid port number if present. - * - * If the result is enclosed in square brackets, as literal IPv6 addresses are, - * the square brackets are removed from the result. - */ - hostname(): string - } - interface URL { - /** - * Port returns the port part of u.Host, without the leading colon. - * - * If u.Host doesn't contain a valid numeric port, Port returns an empty string. - */ - port(): string - } - interface URL { - marshalBinary(): string|Array - } - interface URL { - unmarshalBinary(text: string|Array): void - } - interface URL { - /** - * JoinPath returns a new URL with the provided path elements joined to - * any existing path and the resulting path cleaned of any ./ or ../ elements. - * Any sequences of multiple / characters will be reduced to a single /. - */ - joinPath(...elem: string[]): (URL) +namespace migrate { + interface Migration { + file: string + up: (db: dbx.Builder) => void + down: (db: dbx.Builder) => void } } @@ -14944,6 +15154,10 @@ namespace url { * To force a particular resolver while also printing debugging information, * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * * On Plan 9, the resolver always accesses /net/cs and /net/dns. * * On Windows, in Go 1.18.x and earlier, the resolver always used C @@ -15224,7 +15438,7 @@ namespace multipart { * url.Values{"key": {"Value"}, "id": {"123"}}) * ``` * - * The client must close the response body when finished with it: + * The caller must close the response body when finished with it: * * ``` * resp, err := http.Get("http://example.com/") @@ -15236,6 +15450,8 @@ namespace multipart { * // ... * ``` * + * # Clients and Transports + * * For control over HTTP client headers, redirect policy, and other * settings, create a Client: * @@ -15270,6 +15486,8 @@ namespace multipart { * Clients and Transports are safe for concurrent use by multiple * goroutines and for efficiency should only be created once and re-used. * + * # Servers + * * ListenAndServe starts an HTTP server with a given address and handler. * The handler is usually nil, which means to use DefaultServeMux. * Handle and HandleFunc add handlers to DefaultServeMux: @@ -15298,11 +15516,13 @@ namespace multipart { * log.Fatal(s.ListenAndServe()) * ``` * + * # HTTP/2 + * * Starting with Go 1.6, the http package has transparent support for the * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 * can do so by setting Transport.TLSNextProto (for clients) or * Server.TLSNextProto (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG environment variables are + * map. Alternatively, the following GODEBUG settings are * currently supported: * * ``` @@ -15312,9 +15532,7 @@ namespace multipart { * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps * ``` * - * The GODEBUG variables are not covered by Go's API compatibility - * promise. Please report any issues before disabling HTTP/2 - * support: https://golang.org/s/http2bug + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug * * The http package's Transport and Server both automatically enable * HTTP/2 support for simple configurations. To enable HTTP/2 for more @@ -15998,29 +16216,23 @@ namespace models { */ validate(): void } - type _subvHuvT = BaseModel - interface Param extends _subvHuvT { + type _subgeChI = BaseModel + interface Log extends _subgeChI { + level: number + message: string + data: types.JsonMap + } + interface Log { + tableName(): string + } + type _subZVtpB = BaseModel + interface Param extends _subZVtpB { key: string value: types.JsonRaw } interface Param { tableName(): string } - type _subLkuaZ = BaseModel - interface Request extends _subLkuaZ { - url: string - method: string - status: number - auth: string - userIp: string - remoteIp: string - referer: string - userAgent: string - meta: types.JsonMap - } - interface Request { - tableName(): string - } interface TableInfoRow { /** * the `db:"pk"` tag has special semantic so we cannot rename @@ -16701,6 +16913,8 @@ namespace settings { } interface LogsConfig { maxDays: number + minLevel: number + logIp: boolean } interface LogsConfig { /** @@ -16751,110 +16965,16 @@ namespace settings { * Think of daos as DB repository and service layer in one. */ namespace daos { + interface LogsStatsItem { + total: number + date: types.DateTime + } /** * ExpandFetchFunc defines the function that is used to fetch the expanded relation records. */ interface ExpandFetchFunc {(relCollection: models.Collection, relIds: Array): Array<(models.Record | undefined)> } // @ts-ignore import validation = ozzo_validation - interface RequestsStatsItem { - total: number - date: types.DateTime - } -} - -namespace subscriptions { - /** - * Broker defines a struct for managing subscriptions clients. - */ - interface Broker { - } - interface Broker { - /** - * Clients returns a shallow copy of all registered clients indexed - * with their connection id. - */ - clients(): _TygojaDict - } - interface Broker { - /** - * ClientById finds a registered client by its id. - * - * Returns non-nil error when client with clientId is not registered. - */ - clientById(clientId: string): Client - } - interface Broker { - /** - * Register adds a new client to the broker instance. - */ - register(client: Client): void - } - interface Broker { - /** - * Unregister removes a single client by its id. - * - * If client with clientId doesn't exist, this method does nothing. - */ - unregister(clientId: string): void - } -} - -/** - * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. - * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. - */ -namespace cobra { - interface PositionalArgs {(cmd: Command, args: Array): void } - // @ts-ignore - import flag = pflag - /** - * FParseErrWhitelist configures Flag parse errors to be ignored - */ - interface FParseErrWhitelist extends _TygojaAny{} - /** - * Group Structure to manage groups for commands - */ - interface Group { - id: string - title: string - } - /** - * ShellCompDirective is a bit map representing the different behaviors the shell - * can be instructed to have once completions have been provided. - */ - interface ShellCompDirective extends Number{} - /** - * CompletionOptions are the options to control shell completion - */ - interface CompletionOptions { - /** - * DisableDefaultCmd prevents Cobra from creating a default 'completion' command - */ - disableDefaultCmd: boolean - /** - * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag - * for shells that support completion descriptions - */ - disableNoDescFlag: boolean - /** - * DisableDescriptions turns off all completion descriptions for shells - * that support them - */ - disableDescriptions: boolean - /** - * HiddenDefaultCmd makes the default 'completion' command hidden - */ - hiddenDefaultCmd: boolean - } -} - -namespace migrate { - interface Migration { - file: string - up: (db: dbx.Builder) => void - down: (db: dbx.Builder) => void - } } namespace hook { @@ -16910,8 +17030,8 @@ namespace hook { * TaggedHook defines a proxy hook which register handlers that are triggered only * if the TaggedHook.tags are empty or includes at least one of the event data tag(s). */ - type _sublDMXz = mainHook - interface TaggedHook extends _sublDMXz { + type _subKUiBe = mainHook + interface TaggedHook extends _subKUiBe { } interface TaggedHook { /** @@ -16938,6 +17058,531 @@ namespace hook { } } +namespace subscriptions { + /** + * Broker defines a struct for managing subscriptions clients. + */ + interface Broker { + } + interface Broker { + /** + * Clients returns a shallow copy of all registered clients indexed + * with their connection id. + */ + clients(): _TygojaDict + } + interface Broker { + /** + * ClientById finds a registered client by its id. + * + * Returns non-nil error when client with clientId is not registered. + */ + clientById(clientId: string): Client + } + interface Broker { + /** + * Register adds a new client to the broker instance. + */ + register(client: Client): void + } + interface Broker { + /** + * Unregister removes a single client by its id. + * + * If client with clientId doesn't exist, this method does nothing. + */ + unregister(clientId: string): void + } +} + +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a TextHandler + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use Value.Resolve instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(format string, args ...any) { + * slog.Default().Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that each record is written in one piece. User-defined + * handlers are responsible for their own locking. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + // @ts-ignore + import loginternal = internal + /** + * A Logger records structured information about each call to its + * Log, Debug, Info, Warn, and Error methods. + * For each call, it creates a Record and passes it to a Handler. + * + * To create a new Logger, call [New] or a Logger method + * that begins "With". + */ + interface Logger { + } + interface Logger { + /** + * Handler returns l's Handler. + */ + handler(): Handler + } + interface Logger { + /** + * With returns a Logger that includes the given attributes + * in each output operation. Arguments are converted to + * attributes as if by [Logger.Log]. + */ + with(...args: any[]): (Logger) + } + interface Logger { + /** + * WithGroup returns a Logger that starts a group, if name is non-empty. + * The keys of all attributes added to the Logger will be qualified by the given + * name. (How that qualification happens depends on the [Handler.WithGroup] + * method of the Logger's Handler.) + * + * If name is empty, WithGroup returns the receiver. + */ + withGroup(name: string): (Logger) + } + interface Logger { + /** + * Enabled reports whether l emits log records at the given context and level. + */ + enabled(ctx: context.Context, level: Level): boolean + } + interface Logger { + /** + * Log emits a log record with the current time and the given level and message. + * The Record's Attrs consist of the Logger's attributes followed by + * the Attrs specified by args. + * + * The attribute arguments are processed as follows: + * ``` + * - If an argument is an Attr, it is used as is. + * - If an argument is a string and this is not the last argument, + * the following argument is treated as the value and the two are combined + * into an Attr. + * - Otherwise, the argument is treated as a value with key "!BADKEY". + * ``` + */ + log(ctx: context.Context, level: Level, msg: string, ...args: any[]): void + } + interface Logger { + /** + * LogAttrs is a more efficient version of [Logger.Log] that accepts only Attrs. + */ + logAttrs(ctx: context.Context, level: Level, msg: string, ...attrs: Attr[]): void + } + interface Logger { + /** + * Debug logs at LevelDebug. + */ + debug(msg: string, ...args: any[]): void + } + interface Logger { + /** + * DebugContext logs at LevelDebug with the given context. + */ + debugContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Info logs at LevelInfo. + */ + info(msg: string, ...args: any[]): void + } + interface Logger { + /** + * InfoContext logs at LevelInfo with the given context. + */ + infoContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Warn logs at LevelWarn. + */ + warn(msg: string, ...args: any[]): void + } + interface Logger { + /** + * WarnContext logs at LevelWarn with the given context. + */ + warnContext(ctx: context.Context, msg: string, ...args: any[]): void + } + interface Logger { + /** + * Error logs at LevelError. + */ + error(msg: string, ...args: any[]): void + } + interface Logger { + /** + * ErrorContext logs at LevelError with the given context. + */ + errorContext(ctx: context.Context, msg: string, ...args: any[]): void + } +} + /** * Package core is the backbone of PocketBase. * @@ -16960,12 +17605,12 @@ namespace core { httpContext: echo.Context error: Error } - type _subkMeAn = BaseModelEvent - interface ModelEvent extends _subkMeAn { + type _subVmVgE = BaseModelEvent + interface ModelEvent extends _subVmVgE { dao?: daos.Dao } - type _subJKgBy = BaseCollectionEvent - interface MailerRecordEvent extends _subJKgBy { + type _subgSyNj = BaseCollectionEvent + interface MailerRecordEvent extends _subgSyNj { mailClient: mailer.Mailer message?: mailer.Message record?: models.Record @@ -17005,50 +17650,50 @@ namespace core { oldSettings?: settings.Settings newSettings?: settings.Settings } - type _sublIYdm = BaseCollectionEvent - interface RecordsListEvent extends _sublIYdm { + type _subNLZmW = BaseCollectionEvent + interface RecordsListEvent extends _subNLZmW { httpContext: echo.Context records: Array<(models.Record | undefined)> result?: search.Result } - type _subsgIXQ = BaseCollectionEvent - interface RecordViewEvent extends _subsgIXQ { + type _subpJaDg = BaseCollectionEvent + interface RecordViewEvent extends _subpJaDg { httpContext: echo.Context record?: models.Record } - type _subDcliy = BaseCollectionEvent - interface RecordCreateEvent extends _subDcliy { + type _subrcYnp = BaseCollectionEvent + interface RecordCreateEvent extends _subrcYnp { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _subtrdqA = BaseCollectionEvent - interface RecordUpdateEvent extends _subtrdqA { + type _subrVORc = BaseCollectionEvent + interface RecordUpdateEvent extends _subrVORc { httpContext: echo.Context record?: models.Record uploadedFiles: _TygojaDict } - type _subtBDBs = BaseCollectionEvent - interface RecordDeleteEvent extends _subtBDBs { + type _subUtNwX = BaseCollectionEvent + interface RecordDeleteEvent extends _subUtNwX { httpContext: echo.Context record?: models.Record } - type _subIUhMk = BaseCollectionEvent - interface RecordAuthEvent extends _subIUhMk { + type _sublQNwf = BaseCollectionEvent + interface RecordAuthEvent extends _sublQNwf { httpContext: echo.Context record?: models.Record token: string meta: any } - type _subrFbse = BaseCollectionEvent - interface RecordAuthWithPasswordEvent extends _subrFbse { + type _subjXsbd = BaseCollectionEvent + interface RecordAuthWithPasswordEvent extends _subjXsbd { httpContext: echo.Context record?: models.Record identity: string password: string } - type _subfMyzZ = BaseCollectionEvent - interface RecordAuthWithOAuth2Event extends _subfMyzZ { + type _subDTfjP = BaseCollectionEvent + interface RecordAuthWithOAuth2Event extends _subDTfjP { httpContext: echo.Context providerName: string providerClient: auth.Provider @@ -17056,49 +17701,49 @@ namespace core { oAuth2User?: auth.AuthUser isNewRecord: boolean } - type _subQduzB = BaseCollectionEvent - interface RecordAuthRefreshEvent extends _subQduzB { + type _subfjARO = BaseCollectionEvent + interface RecordAuthRefreshEvent extends _subfjARO { httpContext: echo.Context record?: models.Record } - type _subOQkjX = BaseCollectionEvent - interface RecordRequestPasswordResetEvent extends _subOQkjX { + type _subJmKVx = BaseCollectionEvent + interface RecordRequestPasswordResetEvent extends _subJmKVx { httpContext: echo.Context record?: models.Record } - type _subNmsGn = BaseCollectionEvent - interface RecordConfirmPasswordResetEvent extends _subNmsGn { + type _sublaMxn = BaseCollectionEvent + interface RecordConfirmPasswordResetEvent extends _sublaMxn { httpContext: echo.Context record?: models.Record } - type _subJfgBc = BaseCollectionEvent - interface RecordRequestVerificationEvent extends _subJfgBc { + type _subxSbEs = BaseCollectionEvent + interface RecordRequestVerificationEvent extends _subxSbEs { httpContext: echo.Context record?: models.Record } - type _subZUzkX = BaseCollectionEvent - interface RecordConfirmVerificationEvent extends _subZUzkX { + type _subeKmuc = BaseCollectionEvent + interface RecordConfirmVerificationEvent extends _subeKmuc { httpContext: echo.Context record?: models.Record } - type _subpAFPH = BaseCollectionEvent - interface RecordRequestEmailChangeEvent extends _subpAFPH { + type _subgMlop = BaseCollectionEvent + interface RecordRequestEmailChangeEvent extends _subgMlop { httpContext: echo.Context record?: models.Record } - type _subRChOL = BaseCollectionEvent - interface RecordConfirmEmailChangeEvent extends _subRChOL { + type _subzrUxD = BaseCollectionEvent + interface RecordConfirmEmailChangeEvent extends _subzrUxD { httpContext: echo.Context record?: models.Record } - type _subaJUXR = BaseCollectionEvent - interface RecordListExternalAuthsEvent extends _subaJUXR { + type _subrxBzx = BaseCollectionEvent + interface RecordListExternalAuthsEvent extends _subrxBzx { httpContext: echo.Context record?: models.Record externalAuths: Array<(models.ExternalAuth | undefined)> } - type _subooFWL = BaseCollectionEvent - interface RecordUnlinkExternalAuthEvent extends _subooFWL { + type _subppuXc = BaseCollectionEvent + interface RecordUnlinkExternalAuthEvent extends _subppuXc { httpContext: echo.Context record?: models.Record externalAuth?: models.ExternalAuth @@ -17152,33 +17797,33 @@ namespace core { collections: Array<(models.Collection | undefined)> result?: search.Result } - type _subkyuBA = BaseCollectionEvent - interface CollectionViewEvent extends _subkyuBA { + type _subompKp = BaseCollectionEvent + interface CollectionViewEvent extends _subompKp { httpContext: echo.Context } - type _subsXpWx = BaseCollectionEvent - interface CollectionCreateEvent extends _subsXpWx { + type _subgQtpK = BaseCollectionEvent + interface CollectionCreateEvent extends _subgQtpK { httpContext: echo.Context } - type _subtLtpO = BaseCollectionEvent - interface CollectionUpdateEvent extends _subtLtpO { + type _subMyvFO = BaseCollectionEvent + interface CollectionUpdateEvent extends _subMyvFO { httpContext: echo.Context } - type _subnNAsf = BaseCollectionEvent - interface CollectionDeleteEvent extends _subnNAsf { + type _subbUWLF = BaseCollectionEvent + interface CollectionDeleteEvent extends _subbUWLF { httpContext: echo.Context } interface CollectionsImportEvent { httpContext: echo.Context collections: Array<(models.Collection | undefined)> } - type _subhJTbu = BaseModelEvent - interface FileTokenEvent extends _subhJTbu { + type _subsoxOJ = BaseModelEvent + interface FileTokenEvent extends _subsoxOJ { httpContext: echo.Context token: string } - type _subqJPey = BaseCollectionEvent - interface FileDownloadEvent extends _subqJPey { + type _subjUWcE = BaseCollectionEvent + interface FileDownloadEvent extends _subjUWcE { httpContext: echo.Context record?: models.Record fileField?: schema.SchemaField @@ -17188,17 +17833,87 @@ namespace core { } /** - * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer - * object, creating another object (Reader or Writer) that also implements - * the interface but provides buffering and some help for textual I/O. + * Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces. + * In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code. */ -namespace bufio { +namespace cobra { + interface PositionalArgs {(cmd: Command, args: Array): void } + // @ts-ignore + import flag = pflag /** - * ReadWriter stores pointers to a Reader and a Writer. - * It implements io.ReadWriter. + * FParseErrWhitelist configures Flag parse errors to be ignored */ - type _subFMonm = Reader&Writer - interface ReadWriter extends _subFMonm { + interface FParseErrWhitelist extends _TygojaAny{} + /** + * Group Structure to manage groups for commands + */ + interface Group { + id: string + title: string + } + /** + * ShellCompDirective is a bit map representing the different behaviors the shell + * can be instructed to have once completions have been provided. + */ + interface ShellCompDirective extends Number{} + /** + * CompletionOptions are the options to control shell completion + */ + interface CompletionOptions { + /** + * DisableDefaultCmd prevents Cobra from creating a default 'completion' command + */ + disableDefaultCmd: boolean + /** + * DisableNoDescFlag prevents Cobra from creating the '--no-descriptions' flag + * for shells that support completion descriptions + */ + disableNoDescFlag: boolean + /** + * DisableDescriptions turns off all completion descriptions for shells + * that support them + */ + disableDescriptions: boolean + /** + * HiddenDefaultCmd makes the default 'completion' command hidden + */ + hiddenDefaultCmd: boolean + } +} + +namespace store { +} + +/** + * Package url parses URLs and implements query escaping. + */ +namespace url { + /** + * The Userinfo type is an immutable encapsulation of username and + * password details for a URL. An existing Userinfo value is guaranteed + * to have a username set (potentially empty, as allowed by RFC 2396), + * and optionally a password. + */ + interface Userinfo { + } + interface Userinfo { + /** + * Username returns the username. + */ + username(): string + } + interface Userinfo { + /** + * Password returns the password in case it is set, and whether it is set. + */ + password(): [string, boolean] + } + interface Userinfo { + /** + * String returns the encoded userinfo information in the standard form + * of "username[:password]". + */ + string(): string } } @@ -17277,6 +17992,10 @@ namespace bufio { * To force a particular resolver while also printing debugging information, * join the two settings by a plus sign, as in GODEBUG=netdns=go+1. * + * On macOS, if Go code that uses the net package is built with + * -buildmode=c-archive, linking the resulting archive into a C program + * requires passing -lresolv when linking the C code. + * * On Plan 9, the resolver always accesses /net/cs and /net/dns. * * On Windows, in Go 1.18.x and earlier, the resolver always used C @@ -17297,37 +18016,167 @@ namespace net { } } -/** - * Package url parses URLs and implements query escaping. - */ -namespace url { +namespace hook { /** - * The Userinfo type is an immutable encapsulation of username and - * password details for a URL. An existing Userinfo value is guaranteed - * to have a username set (potentially empty, as allowed by RFC 2396), - * and optionally a password. + * Handler defines a hook handler function. */ - interface Userinfo { + interface Handler {(e: T): void } + /** + * wrapped local Hook embedded struct to limit the public API surface. + */ + type _subeCVJm = Hook + interface mainHook extends _subeCVJm { } - interface Userinfo { - /** - * Username returns the username. - */ - username(): string +} + +/** + * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer + * object, creating another object (Reader or Writer) that also implements + * the interface but provides buffering and some help for textual I/O. + */ +namespace bufio { + /** + * ReadWriter stores pointers to a Reader and a Writer. + * It implements io.ReadWriter. + */ + type _subPDOhy = Reader&Writer + interface ReadWriter extends _subPDOhy { } - interface Userinfo { +} + +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { + /** + * JsonRaw defines a json value type that is safe for db read/write. + */ + interface JsonRaw extends Array{} + interface JsonRaw { /** - * Password returns the password in case it is set, and whether it is set. - */ - password(): [string, boolean] - } - interface Userinfo { - /** - * String returns the encoded userinfo information in the standard form - * of "username[:password]". + * String returns the current JsonRaw instance as a json encoded string. */ string(): string } + interface JsonRaw { + /** + * MarshalJSON implements the [json.Marshaler] interface. + */ + marshalJSON(): string|Array + } + interface JsonRaw { + /** + * UnmarshalJSON implements the [json.Unmarshaler] interface. + */ + unmarshalJSON(b: string|Array): void + } + interface JsonRaw { + /** + * Value implements the [driver.Valuer] interface. + */ + value(): any + } + interface JsonRaw { + /** + * Scan implements [sql.Scanner] interface to scan the provided value + * into the current JsonRaw instance. + */ + scan(value: any): void + } +} + +namespace search { + /** + * Result defines the returned search result structure. + */ + interface Result { + page: number + perPage: number + totalItems: number + totalPages: number + items: any + } +} + +namespace subscriptions { + /** + * Message defines a client's channel data. + */ + interface Message { + name: string + data: string|Array + } + /** + * Client is an interface for a generic subscription client. + */ + interface Client { + [key:string]: any; + /** + * Id Returns the unique id of the client. + */ + id(): string + /** + * Channel returns the client's communication channel. + */ + channel(): undefined + /** + * Subscriptions returns a shallow copy of the the client subscriptions matching the prefixes. + * If no prefix is specified, returns all subscriptions. + */ + subscriptions(...prefixes: string[]): _TygojaDict + /** + * Subscribe subscribes the client to the provided subscriptions list. + * + * Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter. + * + * Example: + * + * ``` + * Subscribe( + * "subscriptionA", + * `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, + * ) + * ``` + */ + subscribe(...subs: string[]): void + /** + * Unsubscribe unsubscribes the client from the provided subscriptions list. + */ + unsubscribe(...subs: string[]): void + /** + * HasSubscription checks if the client is subscribed to `sub`. + */ + hasSubscription(sub: string): boolean + /** + * Set stores any value to the client's context. + */ + set(key: string, value: any): void + /** + * Unset removes a single value from the client's context. + */ + unset(key: string): void + /** + * Get retrieves the key value from the client's context. + */ + get(key: string): any + /** + * Discard marks the client as "discarded", meaning that it + * shouldn't be used anymore for sending new messages. + * + * It is safe to call Discard() multiple times. + */ + discard(): void + /** + * IsDiscarded indicates whether the client has been "discarded" + * and should no longer be used. + */ + isDiscarded(): boolean + /** + * Send sends the specified message to the client's channel (if not discarded). + */ + send(m: Message): void + } } /** @@ -17410,7 +18259,7 @@ namespace multipart { * url.Values{"key": {"Value"}, "id": {"123"}}) * ``` * - * The client must close the response body when finished with it: + * The caller must close the response body when finished with it: * * ``` * resp, err := http.Get("http://example.com/") @@ -17422,6 +18271,8 @@ namespace multipart { * // ... * ``` * + * # Clients and Transports + * * For control over HTTP client headers, redirect policy, and other * settings, create a Client: * @@ -17456,6 +18307,8 @@ namespace multipart { * Clients and Transports are safe for concurrent use by multiple * goroutines and for efficiency should only be created once and re-used. * + * # Servers + * * ListenAndServe starts an HTTP server with a given address and handler. * The handler is usually nil, which means to use DefaultServeMux. * Handle and HandleFunc add handlers to DefaultServeMux: @@ -17484,11 +18337,13 @@ namespace multipart { * log.Fatal(s.ListenAndServe()) * ``` * + * # HTTP/2 + * * Starting with Go 1.6, the http package has transparent support for the * HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2 * can do so by setting Transport.TLSNextProto (for clients) or * Server.TLSNextProto (for servers) to a non-nil, empty - * map. Alternatively, the following GODEBUG environment variables are + * map. Alternatively, the following GODEBUG settings are * currently supported: * * ``` @@ -17498,9 +18353,7 @@ namespace multipart { * GODEBUG=http2debug=2 # ... even more verbose, with frame dumps * ``` * - * The GODEBUG variables are not covered by Go's API compatibility - * promise. Please report any issues before disabling HTTP/2 - * support: https://golang.org/s/http2bug + * Please report any issues before disabling HTTP/2 support: https://golang.org/s/http2bug * * The http package's Transport and Server both automatically enable * HTTP/2 support for simple configurations. To enable HTTP/2 for more @@ -17642,64 +18495,6 @@ namespace echo { } } -namespace store { -} - -/** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. - */ -namespace types { - /** - * JsonRaw defines a json value type that is safe for db read/write. - */ - interface JsonRaw extends Array{} - interface JsonRaw { - /** - * String returns the current JsonRaw instance as a json encoded string. - */ - string(): string - } - interface JsonRaw { - /** - * MarshalJSON implements the [json.Marshaler] interface. - */ - marshalJSON(): string|Array - } - interface JsonRaw { - /** - * UnmarshalJSON implements the [json.Unmarshaler] interface. - */ - unmarshalJSON(b: string|Array): void - } - interface JsonRaw { - /** - * Value implements the [driver.Valuer] interface. - */ - value(): any - } - interface JsonRaw { - /** - * Scan implements [sql.Scanner] interface to scan the provided value - * into the current JsonRaw instance. - */ - scan(value: any): void - } -} - -namespace search { - /** - * Result defines the returned search result structure. - */ - interface Result { - page: number - perPage: number - totalItems: number - totalPages: number - items: any - } -} - namespace mailer { /** * Message defines a generic email message struct. @@ -17740,85 +18535,541 @@ namespace settings { } } -namespace subscriptions { +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a TextHandler + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use Value.Resolve instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(format string, args ...any) { + * slog.Default().Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that each record is written in one piece. User-defined + * handlers are responsible for their own locking. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { /** - * Message defines a client's channel data. + * An Attr is a key-value pair. */ - interface Message { - name: string - data: string|Array + interface Attr { + key: string + value: Value + } + interface Attr { + /** + * Equal reports whether a and b have equal keys and values. + */ + equal(b: Attr): boolean + } + interface Attr { + string(): string } /** - * Client is an interface for a generic subscription client. + * A Handler handles log records produced by a Logger.. + * + * A typical handler may print log records to standard error, + * or write them to a file or database, or perhaps augment them + * with additional attributes and pass them on to another handler. + * + * Any of the Handler's methods may be called concurrently with itself + * or with other methods. It is the responsibility of the Handler to + * manage this concurrency. + * + * Users of the slog package should not invoke Handler methods directly. + * They should use the methods of [Logger] instead. */ - interface Client { + interface Handler { [key:string]: any; /** - * Id Returns the unique id of the client. + * Enabled reports whether the handler handles records at the given level. + * The handler ignores records whose level is lower. + * It is called early, before any arguments are processed, + * to save effort if the log event should be discarded. + * If called from a Logger method, the first argument is the context + * passed to that method, or context.Background() if nil was passed + * or the method does not take a context. + * The context is passed so Enabled can use its values + * to make a decision. */ - id(): string + enabled(_arg0: context.Context, _arg1: Level): boolean /** - * Channel returns the client's communication channel. - */ - channel(): undefined - /** - * Subscriptions returns all subscriptions to which the client has subscribed to. - */ - subscriptions(): _TygojaDict - /** - * Subscribe subscribes the client to the provided subscriptions list. - */ - subscribe(...subs: string[]): void - /** - * Unsubscribe unsubscribes the client from the provided subscriptions list. - */ - unsubscribe(...subs: string[]): void - /** - * HasSubscription checks if the client is subscribed to `sub`. - */ - hasSubscription(sub: string): boolean - /** - * Set stores any value to the client's context. - */ - set(key: string, value: any): void - /** - * Unset removes a single value from the client's context. - */ - unset(key: string): void - /** - * Get retrieves the key value from the client's context. - */ - get(key: string): any - /** - * Discard marks the client as "discarded", meaning that it - * shouldn't be used anymore for sending new messages. + * Handle handles the Record. + * It will only be called when Enabled returns true. + * The Context argument is as for Enabled. + * It is present solely to provide Handlers access to the context's values. + * Canceling the context should not affect record processing. + * (Among other things, log messages may be necessary to debug a + * cancellation-related problem.) * - * It is safe to call Discard() multiple times. + * Handle methods that produce output should observe the following rules: + * ``` + * - If r.Time is the zero time, ignore the time. + * - If r.PC is zero, ignore it. + * - Attr's values should be resolved. + * - If an Attr's key and value are both the zero value, ignore the Attr. + * This can be tested with attr.Equal(Attr{}). + * - If a group's key is empty, inline the group's Attrs. + * - If a group has no Attrs (even if it has a non-empty key), + * ignore it. + * ``` */ - discard(): void + handle(_arg0: context.Context, _arg1: Record): void /** - * IsDiscarded indicates whether the client has been "discarded" - * and should no longer be used. + * WithAttrs returns a new Handler whose attributes consist of + * both the receiver's attributes and the arguments. + * The Handler owns the slice: it may retain, modify or discard it. */ - isDiscarded(): boolean + withAttrs(attrs: Array): Handler /** - * Send sends the specified message to the client's channel (if not discarded). + * WithGroup returns a new Handler with the given group appended to + * the receiver's existing groups. + * The keys of all subsequent attributes, whether added by With or in a + * Record, should be qualified by the sequence of group names. + * + * How this qualification happens is up to the Handler, so long as + * this Handler's attribute keys differ from those of another Handler + * with a different sequence of group names. + * + * A Handler should treat WithGroup as starting a Group of Attrs that ends + * at the end of the log event. That is, + * + * ``` + * logger.WithGroup("s").LogAttrs(level, msg, slog.Int("a", 1), slog.Int("b", 2)) + * ``` + * + * should behave like + * + * ``` + * logger.LogAttrs(level, msg, slog.Group("s", slog.Int("a", 1), slog.Int("b", 2))) + * ``` + * + * If the name is empty, WithGroup returns the receiver. */ - send(m: Message): void + withGroup(name: string): Handler } -} - -namespace hook { /** - * Handler defines a hook handler function. + * A Level is the importance or severity of a log event. + * The higher the level, the more important or severe the event. */ - interface Handler {(e: T): void } - /** - * wrapped local Hook embedded struct to limit the public API surface. - */ - type _subiYKnb = Hook - interface mainHook extends _subiYKnb { + interface Level extends Number{} + interface Level { + /** + * String returns a name for the level. + * If the level has a name, then that name + * in uppercase is returned. + * If the level is between named values, then + * an integer is appended to the uppercased name. + * Examples: + * + * ``` + * LevelWarn.String() => "WARN" + * (LevelInfo+2).String() => "INFO+2" + * ``` + */ + string(): string } + interface Level { + /** + * MarshalJSON implements [encoding/json.Marshaler] + * by quoting the output of [Level.String]. + */ + marshalJSON(): string|Array + } + interface Level { + /** + * UnmarshalJSON implements [encoding/json.Unmarshaler] + * It accepts any string produced by [Level.MarshalJSON], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". + */ + unmarshalJSON(data: string|Array): void + } + interface Level { + /** + * MarshalText implements [encoding.TextMarshaler] + * by calling [Level.String]. + */ + marshalText(): string|Array + } + interface Level { + /** + * UnmarshalText implements [encoding.TextUnmarshaler]. + * It accepts any string produced by [Level.MarshalText], + * ignoring case. + * It also accepts numeric offsets that would result in a different string on + * output. For example, "Error-8" would marshal as "INFO". + */ + unmarshalText(data: string|Array): void + } + interface Level { + /** + * Level returns the receiver. + * It implements Leveler. + */ + level(): Level + } + // @ts-ignore + import loginternal = internal } /** @@ -17841,6 +19092,549 @@ namespace core { } } +/** + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a TextHandler + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use Value.Resolve instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(format string, args ...any) { + * slog.Default().Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that each record is written in one piece. User-defined + * handlers are responsible for their own locking. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. + */ +namespace slog { + // @ts-ignore + import loginternal = internal + /** + * A Record holds information about a log event. + * Copies of a Record share state. + * Do not modify a Record after handing out a copy to it. + * Call [NewRecord] to create a new Record. + * Use [Record.Clone] to create a copy with no shared state. + */ + interface Record { + /** + * The time at which the output method (Log, Info, etc.) was called. + */ + time: time.Time + /** + * The log message. + */ + message: string + /** + * The level of the event. + */ + level: Level + /** + * The program counter at the time the record was constructed, as determined + * by runtime.Callers. If zero, no program counter is available. + * + * The only valid use for this value is as an argument to + * [runtime.CallersFrames]. In particular, it must not be passed to + * [runtime.FuncForPC]. + */ + pc: number + } + interface Record { + /** + * Clone returns a copy of the record with no shared state. + * The original record and the clone can both be modified + * without interfering with each other. + */ + clone(): Record + } + interface Record { + /** + * NumAttrs returns the number of attributes in the Record. + */ + numAttrs(): number + } + interface Record { + /** + * Attrs calls f on each Attr in the Record. + * Iteration stops if f returns false. + */ + attrs(f: (_arg0: Attr) => boolean): void + } + interface Record { + /** + * AddAttrs appends the given Attrs to the Record's list of Attrs. + * It omits empty groups. + */ + addAttrs(...attrs: Attr[]): void + } + interface Record { + /** + * Add converts the args to Attrs as described in [Logger.Log], + * then appends the Attrs to the Record's list of Attrs. + * It omits empty groups. + */ + add(...args: any[]): void + } + /** + * A Value can represent any Go value, but unlike type any, + * it can represent most small values without an allocation. + * The zero Value corresponds to nil. + */ + interface Value { + } + interface Value { + /** + * Kind returns v's Kind. + */ + kind(): Kind + } + interface Value { + /** + * Any returns v's value as an any. + */ + any(): any + } + interface Value { + /** + * String returns Value's value as a string, formatted like fmt.Sprint. Unlike + * the methods Int64, Float64, and so on, which panic if v is of the + * wrong kind, String never panics. + */ + string(): string + } + interface Value { + /** + * Int64 returns v's value as an int64. It panics + * if v is not a signed integer. + */ + int64(): number + } + interface Value { + /** + * Uint64 returns v's value as a uint64. It panics + * if v is not an unsigned integer. + */ + uint64(): number + } + interface Value { + /** + * Bool returns v's value as a bool. It panics + * if v is not a bool. + */ + bool(): boolean + } + interface Value { + /** + * Duration returns v's value as a time.Duration. It panics + * if v is not a time.Duration. + */ + duration(): time.Duration + } + interface Value { + /** + * Float64 returns v's value as a float64. It panics + * if v is not a float64. + */ + float64(): number + } + interface Value { + /** + * Time returns v's value as a time.Time. It panics + * if v is not a time.Time. + */ + time(): time.Time + } + interface Value { + /** + * LogValuer returns v's value as a LogValuer. It panics + * if v is not a LogValuer. + */ + logValuer(): LogValuer + } + interface Value { + /** + * Group returns v's value as a []Attr. + * It panics if v's Kind is not KindGroup. + */ + group(): Array + } + interface Value { + /** + * Equal reports whether v and w represent the same Go value. + */ + equal(w: Value): boolean + } + interface Value { + /** + * Resolve repeatedly calls LogValue on v while it implements LogValuer, + * and returns the result. + * If v resolves to a group, the group's attributes' values are not recursively + * resolved. + * If the number of LogValue calls exceeds a threshold, a Value containing an + * error is returned. + * Resolve's return value is guaranteed not to be of Kind KindLogValuer. + */ + resolve(): Value + } +} + /** * Package bufio implements buffered I/O. It wraps an io.Reader or io.Writer * object, creating another object (Reader or Writer) that also implements @@ -17864,6 +19658,7 @@ namespace bufio { * the buffered reader to read from r. * Calling Reset on the zero value of Reader initializes the internal buffer * to the default size. + * Calling b.Reset(b) (that is, resetting a Reader to itself) does nothing. */ reset(r: io.Reader): void } @@ -18032,6 +19827,7 @@ namespace bufio { * resets b to write its output to w. * Calling Reset on the zero value of Writer initializes the internal buffer * to the default size. + * Calling w.Reset(w) (that is, resetting a Writer to itself) does nothing. */ reset(w: io.Writer): void } @@ -18104,6 +19900,19 @@ namespace bufio { } } +/** + * Package types implements some commonly used db serializable types + * like datetime, json, etc. + */ +namespace types { +} + +namespace search { +} + +namespace subscriptions { +} + /** * Package mail implements parsing of mail messages. * @@ -18117,6 +19926,7 @@ namespace bufio { * such as breaking addresses across lines. * - No unicode normalization is performed. * - The special characters ()[]:;@\, are allowed to appear unquoted in names. + * - A leading From line is permitted, as in mbox format (RFC 4155). * ``` */ namespace mail { @@ -18139,15 +19949,395 @@ namespace mail { } } -namespace subscriptions { -} - /** - * Package types implements some commonly used db serializable types - * like datetime, json, etc. + * Package slog provides structured logging, + * in which log records include a message, + * a severity level, and various other attributes + * expressed as key-value pairs. + * + * It defines a type, [Logger], + * which provides several methods (such as [Logger.Info] and [Logger.Error]) + * for reporting events of interest. + * + * Each Logger is associated with a [Handler]. + * A Logger output method creates a [Record] from the method arguments + * and passes it to the Handler, which decides how to handle it. + * There is a default Logger accessible through top-level functions + * (such as [Info] and [Error]) that call the corresponding Logger methods. + * + * A log record consists of a time, a level, a message, and a set of key-value + * pairs, where the keys are strings and the values may be of any type. + * As an example, + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * creates a record containing the time of the call, + * a level of Info, the message "hello", and a single + * pair with key "count" and value 3. + * + * The [Info] top-level function calls the [Logger.Info] method on the default Logger. + * In addition to [Logger.Info], there are methods for Debug, Warn and Error levels. + * Besides these convenience methods for common levels, + * there is also a [Logger.Log] method which takes the level as an argument. + * Each of these methods has a corresponding top-level function that uses the + * default logger. + * + * The default handler formats the log record's message, time, level, and attributes + * as a string and passes it to the [log] package. + * + * ``` + * 2022/11/08 15:28:26 INFO hello count=3 + * ``` + * + * For more control over the output format, create a logger with a different handler. + * This statement uses [New] to create a new logger with a TextHandler + * that writes structured records in text form to standard error: + * + * ``` + * logger := slog.New(slog.NewTextHandler(os.Stderr, nil)) + * ``` + * + * [TextHandler] output is a sequence of key=value pairs, easily and unambiguously + * parsed by machine. This statement: + * + * ``` + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * time=2022-11-08T15:28:26.000-05:00 level=INFO msg=hello count=3 + * ``` + * + * The package also provides [JSONHandler], whose output is line-delimited JSON: + * + * ``` + * logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + * logger.Info("hello", "count", 3) + * ``` + * + * produces this output: + * + * ``` + * {"time":"2022-11-08T15:28:26.000000000-05:00","level":"INFO","msg":"hello","count":3} + * ``` + * + * Both [TextHandler] and [JSONHandler] can be configured with [HandlerOptions]. + * There are options for setting the minimum level (see Levels, below), + * displaying the source file and line of the log call, and + * modifying attributes before they are logged. + * + * Setting a logger as the default with + * + * ``` + * slog.SetDefault(logger) + * ``` + * + * will cause the top-level functions like [Info] to use it. + * [SetDefault] also updates the default logger used by the [log] package, + * so that existing applications that use [log.Printf] and related functions + * will send log records to the logger's handler without needing to be rewritten. + * + * Some attributes are common to many log calls. + * For example, you may wish to include the URL or trace identifier of a server request + * with all log events arising from the request. + * Rather than repeat the attribute with every log call, you can use [Logger.With] + * to construct a new Logger containing the attributes: + * + * ``` + * logger2 := logger.With("url", r.URL) + * ``` + * + * The arguments to With are the same key-value pairs used in [Logger.Info]. + * The result is a new Logger with the same handler as the original, but additional + * attributes that will appear in the output of every call. + * + * # Levels + * + * A [Level] is an integer representing the importance or severity of a log event. + * The higher the level, the more severe the event. + * This package defines constants for the most common levels, + * but any int can be used as a level. + * + * In an application, you may wish to log messages only at a certain level or greater. + * One common configuration is to log messages at Info or higher levels, + * suppressing debug logging until it is needed. + * The built-in handlers can be configured with the minimum level to output by + * setting [HandlerOptions.Level]. + * The program's `main` function typically does this. + * The default value is LevelInfo. + * + * Setting the [HandlerOptions.Level] field to a [Level] value + * fixes the handler's minimum level throughout its lifetime. + * Setting it to a [LevelVar] allows the level to be varied dynamically. + * A LevelVar holds a Level and is safe to read or write from multiple + * goroutines. + * To vary the level dynamically for an entire program, first initialize + * a global LevelVar: + * + * ``` + * var programLevel = new(slog.LevelVar) // Info by default + * ``` + * + * Then use the LevelVar to construct a handler, and make it the default: + * + * ``` + * h := slog.NewJSONHandler(os.Stderr, &slog.HandlerOptions{Level: programLevel}) + * slog.SetDefault(slog.New(h)) + * ``` + * + * Now the program can change its logging level with a single statement: + * + * ``` + * programLevel.Set(slog.LevelDebug) + * ``` + * + * # Groups + * + * Attributes can be collected into groups. + * A group has a name that is used to qualify the names of its attributes. + * How this qualification is displayed depends on the handler. + * [TextHandler] separates the group and attribute names with a dot. + * [JSONHandler] treats each group as a separate JSON object, with the group name as the key. + * + * Use [Group] to create a Group attribute from a name and a list of key-value pairs: + * + * ``` + * slog.Group("request", + * "method", r.Method, + * "url", r.URL) + * ``` + * + * TextHandler would display this group as + * + * ``` + * request.method=GET request.url=http://example.com + * ``` + * + * JSONHandler would display it as + * + * ``` + * "request":{"method":"GET","url":"http://example.com"} + * ``` + * + * Use [Logger.WithGroup] to qualify all of a Logger's output + * with a group name. Calling WithGroup on a Logger results in a + * new Logger with the same Handler as the original, but with all + * its attributes qualified by the group name. + * + * This can help prevent duplicate attribute keys in large systems, + * where subsystems might use the same keys. + * Pass each subsystem a different Logger with its own group name so that + * potential duplicates are qualified: + * + * ``` + * logger := slog.Default().With("id", systemID) + * parserLogger := logger.WithGroup("parser") + * parseInput(input, parserLogger) + * ``` + * + * When parseInput logs with parserLogger, its keys will be qualified with "parser", + * so even if it uses the common key "id", the log line will have distinct keys. + * + * # Contexts + * + * Some handlers may wish to include information from the [context.Context] that is + * available at the call site. One example of such information + * is the identifier for the current span when tracing is enabled. + * + * The [Logger.Log] and [Logger.LogAttrs] methods take a context as a first + * argument, as do their corresponding top-level functions. + * + * Although the convenience methods on Logger (Info and so on) and the + * corresponding top-level functions do not take a context, the alternatives ending + * in "Context" do. For example, + * + * ``` + * slog.InfoContext(ctx, "message") + * ``` + * + * It is recommended to pass a context to an output method if one is available. + * + * # Attrs and Values + * + * An [Attr] is a key-value pair. The Logger output methods accept Attrs as well as + * alternating keys and values. The statement + * + * ``` + * slog.Info("hello", slog.Int("count", 3)) + * ``` + * + * behaves the same as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * There are convenience constructors for [Attr] such as [Int], [String], and [Bool] + * for common types, as well as the function [Any] for constructing Attrs of any + * type. + * + * The value part of an Attr is a type called [Value]. + * Like an [any], a Value can hold any Go value, + * but it can represent typical values, including all numbers and strings, + * without an allocation. + * + * For the most efficient log output, use [Logger.LogAttrs]. + * It is similar to [Logger.Log] but accepts only Attrs, not alternating + * keys and values; this allows it, too, to avoid allocation. + * + * The call + * + * ``` + * logger.LogAttrs(ctx, slog.LevelInfo, "hello", slog.Int("count", 3)) + * ``` + * + * is the most efficient way to achieve the same output as + * + * ``` + * slog.Info("hello", "count", 3) + * ``` + * + * # Customizing a type's logging behavior + * + * If a type implements the [LogValuer] interface, the [Value] returned from its LogValue + * method is used for logging. You can use this to control how values of the type + * appear in logs. For example, you can redact secret information like passwords, + * or gather a struct's fields in a Group. See the examples under [LogValuer] for + * details. + * + * A LogValue method may return a Value that itself implements [LogValuer]. The [Value.Resolve] + * method handles these cases carefully, avoiding infinite loops and unbounded recursion. + * Handler authors and others may wish to use Value.Resolve instead of calling LogValue directly. + * + * # Wrapping output methods + * + * The logger functions use reflection over the call stack to find the file name + * and line number of the logging call within the application. This can produce + * incorrect source information for functions that wrap slog. For instance, if you + * define this function in file mylog.go: + * + * ``` + * func Infof(format string, args ...any) { + * slog.Default().Info(fmt.Sprintf(format, args...)) + * } + * ``` + * + * and you call it like this in main.go: + * + * ``` + * Infof(slog.Default(), "hello, %s", "world") + * ``` + * + * then slog will report the source file as mylog.go, not main.go. + * + * A correct implementation of Infof will obtain the source location + * (pc) and pass it to NewRecord. + * The Infof function in the package-level example called "wrapping" + * demonstrates how to do this. + * + * # Working with Records + * + * Sometimes a Handler will need to modify a Record + * before passing it on to another Handler or backend. + * A Record contains a mixture of simple public fields (e.g. Time, Level, Message) + * and hidden fields that refer to state (such as attributes) indirectly. This + * means that modifying a simple copy of a Record (e.g. by calling + * [Record.Add] or [Record.AddAttrs] to add attributes) + * may have unexpected effects on the original. + * Before modifying a Record, use [Record.Clone] to + * create a copy that shares no state with the original, + * or create a new Record with [NewRecord] + * and build up its Attrs by traversing the old ones with [Record.Attrs]. + * + * # Performance considerations + * + * If profiling your application demonstrates that logging is taking significant time, + * the following suggestions may help. + * + * If many log lines have a common attribute, use [Logger.With] to create a Logger with + * that attribute. The built-in handlers will format that attribute only once, at the + * call to [Logger.With]. The [Handler] interface is designed to allow that optimization, + * and a well-written Handler should take advantage of it. + * + * The arguments to a log call are always evaluated, even if the log event is discarded. + * If possible, defer computation so that it happens only if the value is actually logged. + * For example, consider the call + * + * ``` + * slog.Info("starting request", "url", r.URL.String()) // may compute String unnecessarily + * ``` + * + * The URL.String method will be called even if the logger discards Info-level events. + * Instead, pass the URL directly: + * + * ``` + * slog.Info("starting request", "url", &r.URL) // calls URL.String only if needed + * ``` + * + * The built-in [TextHandler] will call its String method, but only + * if the log event is enabled. + * Avoiding the call to String also preserves the structure of the underlying value. + * For example [JSONHandler] emits the components of the parsed URL as a JSON object. + * If you want to avoid eagerly paying the cost of the String call + * without causing the handler to potentially inspect the structure of the value, + * wrap the value in a fmt.Stringer implementation that hides its Marshal methods. + * + * You can also use the [LogValuer] interface to avoid unnecessary work in disabled log + * calls. Say you need to log some expensive value: + * + * ``` + * slog.Debug("frobbing", "value", computeExpensiveValue(arg)) + * ``` + * + * Even if this line is disabled, computeExpensiveValue will be called. + * To avoid that, define a type implementing LogValuer: + * + * ``` + * type expensive struct { arg int } + * + * func (e expensive) LogValue() slog.Value { + * return slog.AnyValue(computeExpensiveValue(e.arg)) + * } + * ``` + * + * Then use a value of that type in log calls: + * + * ``` + * slog.Debug("frobbing", "value", expensive{arg}) + * ``` + * + * Now computeExpensiveValue will only be called when the line is enabled. + * + * The built-in handlers acquire a lock before calling [io.Writer.Write] + * to ensure that each record is written in one piece. User-defined + * handlers are responsible for their own locking. + * + * # Writing a handler + * + * For a guide to writing a custom handler, see https://golang.org/s/slog-handler-guide. */ -namespace types { -} - -namespace search { +namespace slog { + // @ts-ignore + import loginternal = internal + /** + * Kind is the kind of a Value. + */ + interface Kind extends Number{} + interface Kind { + string(): string + } + /** + * A LogValuer is any Go value that can convert itself into a Value for logging. + * + * This mechanism may be used to defer expensive operations until they are + * needed, or to expand a single value into a sequence of components. + */ + interface LogValuer { + [key:string]: any; + logValue(): Value + } } diff --git a/plugins/jsvm/internal/types/types.go b/plugins/jsvm/internal/types/types.go index 05310da8..469b9170 100644 --- a/plugins/jsvm/internal/types/types.go +++ b/plugins/jsvm/internal/types/types.go @@ -429,7 +429,7 @@ declare class DateTime implements types.DateTime { interface ValidationError extends ozzo_validation.Error{} // merge /** * ValidationError defines a single formatted data validation error, - * usually used as part of a error response. + * usually used as part of an error response. * * ` + "```" + `js * new ValidationError("invalid_title", "Title is not valid") diff --git a/plugins/migratecmd/automigrate.go b/plugins/migratecmd/automigrate.go index b65f67c2..f74fa2b4 100644 --- a/plugins/migratecmd/automigrate.go +++ b/plugins/migratecmd/automigrate.go @@ -15,7 +15,7 @@ import ( "github.com/pocketbase/pocketbase/tools/migrate" ) -const collectionsCacheKey = "migratecmd_collections" +const collectionsStoreKey = "migratecmd_collections" // onCollectionChange handles the automigration snapshot generation on // collection change event (create/update/delete). @@ -94,7 +94,7 @@ func (p *plugin) afterCollectionChange() func(*core.ModelEvent) error { } func (p *plugin) updateSingleCachedCollection(new, old *models.Collection) { - cached, _ := p.app.Cache().Get(collectionsCacheKey).(map[string]*models.Collection) + cached, _ := p.app.Store().Get(collectionsStoreKey).(map[string]*models.Collection) switch { case new == nil: @@ -103,7 +103,7 @@ func (p *plugin) updateSingleCachedCollection(new, old *models.Collection) { cached[new.Id] = new } - p.app.Cache().Set(collectionsCacheKey, cached) + p.app.Store().Set(collectionsStoreKey, cached) } func (p *plugin) refreshCachedCollections() error { @@ -121,19 +121,19 @@ func (p *plugin) refreshCachedCollections() error { cached[c.Id] = c } - p.app.Cache().Set(collectionsCacheKey, cached) + p.app.Store().Set(collectionsStoreKey, cached) return nil } func (p *plugin) getCachedCollections() (map[string]*models.Collection, error) { - if !p.app.Cache().Has(collectionsCacheKey) { + if !p.app.Store().Has(collectionsStoreKey) { if err := p.refreshCachedCollections(); err != nil { return nil, err } } - result, _ := p.app.Cache().Get(collectionsCacheKey).(map[string]*models.Collection) + result, _ := p.app.Store().Get(collectionsStoreKey).(map[string]*models.Collection) return result, nil } diff --git a/pocketbase.go b/pocketbase.go index dcfae07c..34d3236a 100644 --- a/pocketbase.go +++ b/pocketbase.go @@ -7,7 +7,6 @@ import ( "strings" "syscall" - "github.com/fatih/color" "github.com/pocketbase/pocketbase/cmd" "github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/tools/list" @@ -31,7 +30,6 @@ type appWrapper struct { type PocketBase struct { *appWrapper - debugFlag bool dataDirFlag string encryptionEnvFlag string hideStartBanner bool @@ -43,7 +41,6 @@ type PocketBase struct { // Config is the PocketBase initialization config struct. type Config struct { // optional default values for the console flags - DefaultDebug bool DefaultDataDir string // if not set, it will fallback to "./pb_data" DefaultEncryptionEnv string @@ -66,11 +63,7 @@ type Config struct { // If you want to initialize the application before calling [Start()], // then you'll have to manually call [Bootstrap()]. func New() *PocketBase { - _, isUsingGoRun := inspectRuntime() - - return NewWithConfig(Config{ - DefaultDebug: isUsingGoRun, - }) + return NewWithConfig(Config{}) } // NewWithConfig creates a new PocketBase instance with the provided config. @@ -100,7 +93,6 @@ func NewWithConfig(config Config) *PocketBase { DisableDefaultCmd: true, }, }, - debugFlag: config.DefaultDebug, dataDirFlag: config.DefaultDataDir, encryptionEnvFlag: config.DefaultEncryptionEnv, hideStartBanner: config.HideStartBanner, @@ -114,7 +106,6 @@ func NewWithConfig(config Config) *PocketBase { pb.appWrapper = &appWrapper{core.NewBaseApp(core.BaseAppConfig{ DataDir: pb.dataDirFlag, EncryptionEnv: pb.encryptionEnvFlag, - IsDebug: pb.debugFlag, DataMaxOpenConns: config.DataMaxOpenConns, DataMaxIdleConns: config.DataMaxIdleConns, LogsMaxOpenConns: config.LogsMaxOpenConns, @@ -162,10 +153,7 @@ func (pb *PocketBase) Execute() error { // execute the root command go func() { if err := pb.RootCmd.Execute(); err != nil { - // @todo replace with db log once generalized logs are added - // and maybe consider reorganizing the code to return os.Exit(1) - // (note may need to update the existing commands to not silence errors) - color.Red(err.Error()) + pb.Logger().Error("rootCmd.Execute error", "error", err) } done <- true @@ -173,9 +161,12 @@ func (pb *PocketBase) Execute() error { <-done - // trigger app cleanups + // trigger cleanups return pb.OnTerminate().Trigger(&core.TerminateEvent{ App: pb, + }, func(e *core.TerminateEvent) error { + e.App.ResetBootstrapState() + return nil }) } @@ -196,13 +187,6 @@ func (pb *PocketBase) eagerParseFlags(config *Config) error { "the env variable whose value of 32 characters will be used \nas encryption key for the app settings (default none)", ) - pb.RootCmd.PersistentFlags().BoolVar( - &pb.debugFlag, - "debug", - config.DefaultDebug, - "enable debug mode, aka. showing more detailed logs", - ) - return pb.RootCmd.ParseFlags(os.Args[1:]) } diff --git a/pocketbase_test.go b/pocketbase_test.go index f24772ae..492c745f 100644 --- a/pocketbase_test.go +++ b/pocketbase_test.go @@ -47,15 +47,10 @@ func TestNew(t *testing.T) { if app.EncryptionEnv() != "test_encryption_env" { t.Fatalf("Expected app.DataDir() test_encryption_env, got %q", app.EncryptionEnv()) } - - if app.IsDebug() != true { - t.Fatal("Expected app.IsDebug() true, got false") - } } func TestNewWithConfig(t *testing.T) { app := NewWithConfig(Config{ - DefaultDebug: true, DefaultDataDir: "test_dir", DefaultEncryptionEnv: "test_encryption_env", HideStartBanner: true, @@ -84,10 +79,6 @@ func TestNewWithConfig(t *testing.T) { if app.EncryptionEnv() != "test_encryption_env" { t.Fatalf("Expected app.DataDir() %q, got %q", "test_encryption_env", app.EncryptionEnv()) } - - if app.IsDebug() != true { - t.Fatal("Expected app.IsDebug() true, got false") - } } func TestNewWithConfigAndFlags(t *testing.T) { @@ -109,7 +100,6 @@ func TestNewWithConfigAndFlags(t *testing.T) { ) app := NewWithConfig(Config{ - DefaultDebug: true, DefaultDataDir: "test_dir", DefaultEncryptionEnv: "test_encryption_env", HideStartBanner: true, @@ -138,10 +128,6 @@ func TestNewWithConfigAndFlags(t *testing.T) { if app.EncryptionEnv() != "test_encryption_env_flag" { t.Fatalf("Expected app.DataDir() %q, got %q", "test_encryption_env_flag", app.EncryptionEnv()) } - - if app.IsDebug() != false { - t.Fatal("Expected app.IsDebug() false, got true") - } } func TestSkipBootstrap(t *testing.T) { diff --git a/tests/app.go b/tests/app.go index 4c5e101c..c4238311 100644 --- a/tests/app.go +++ b/tests/app.go @@ -97,7 +97,6 @@ func NewTestApp(optTestDataDir ...string) (*TestApp, error) { app := core.NewBaseApp(core.BaseAppConfig{ DataDir: tempDir, EncryptionEnv: "pb_test_env", - IsDebug: false, }) // load data dir and db connections diff --git a/tests/data/data.db b/tests/data/data.db index 72a25fbfc6f5b708351f292b1fff6f1f17ab50ec..9f26881e7a5d2dc415f07fae6b5136d59f94dc29 100644 GIT binary patch delta 1356 zcmai!Uu@e%9LIfkS>tpKS*LYnq-)bSPBv}2x_nAQpQg7&ayG{FlGJb?Cy5JFta1an4(<&(~L z-{0@|z0dFDQ&(K4uDC9^JG~S|y-3DkG5~qszvvGEZzFZhg?4t_GVDA0ZLZrLx7L{* zA9V!$J!qnhiEwNr$c0%ZIbV_L$*ibI#dJNH6Zv9R2?!Oct^M-V>9&XKKleOi$}4G&Pii8s{}b@~pZATQ`ufmLXUwpB`fX0p8Cz#O-Olj=Gy(p% zXiqO1ZK}2?;XZ(7fbnb3!0E=&*~Sns8$&RD$w3Yc5k(=&Y`+5sfQ_QI`OVMJk2kEiZ7+bV#<6th0X#HH~DGw8w9W6<1^?(@T&RC z4BGYV{%1A_LN~C9phUR|(|@0piS3<)qHkpmf47Wcw3exq)o@P2pL_{f3%GaIpx3yt zIEc@mM5(@3b`fqiF?Xik-b~hgt`m>Th@%(uOfJaQRD51WOlz`z#-~er=wV3^=hZ?M zzjYmkEfUhG_vnaHj_5*~!;LCx>Elg!34d@BIq;H#Do^`iiJy<(aBTXy#$ks_{G7;W zbyhBj_`xa+T8haknxpf&nwPR_0nasBw#nK5wp*{(WtFKb_{ahZSTa1u(E0BIhGHV z%j}ky;3ZnqbzbGFG7j8;PbC~Qo?qHeOR7?y&qyNv{Ki%|OA);$Wb%3A&QjFks{bZr t@uNkg*z=lF78ez~T18e=L~_yey^R3a(|Q@hVbXl^uN*PIT}CfV{ss6&yZitE delta 888 zcmZvbOK2NM7{_;JlxnO*wG{kl8V7A0d`J}8yOL!|NsM9~2l6VGF)^{@NNZ`mURiIg zw2JaFb{r=?6eoN5j!_`AflwON##`tiR!g3c1m6m!lu`=yp@p2%o4b||O=)5N!^fZb zeSGsDW~S0OQ)yh>ZEt57rq|FBL&#Y9+Xp?Uy&AdSNNhXSHM4E+63^ClEUmY#VQ1$D ze2>rV_4z#A-Qi>*p~&H+phTy_NmF}U|5>bJL#GYqzD@)gNyJ$KHkg|0k+jc;))?5W|M z(EAL33YB>h0Q+++>0?jv!&^uI^C01ffL51y+c9*_G|K$EspftA=o~4^q8e7jWG3vJ zJT=(!UfDl1&^J85o;@)z!baZnBdkH++oWgB|Io_u@+W7vPSwl*q3eDG-i3(R;6H6{ zb~@>-6T~5Mp-GOhLY`H`lCqzbV+X~gASd*nhR6a!XLNCx{DsjexG+LKLnrk=Mo7~~ zR%;(aP!N#~6#TGeT#QGS`Cf~CGn<>cK+Tc>orrl$rIgnX-((37>>IorUcSbyG?t7{ zc?2mA=a=y^Ek`G0PU6b&%RCX_a-RI);QTJ0XL;@r=RU;yIz3*`=-Bw3U_-ro#R_@F z=$@W*Pl>V=gSAKaIxWP~lM~a$5{y^z1eK*iT24fh@T`jGC|}5x`RUXoWQ)WPs|%z9 zzWN&XQzhXq`0^?TF4cIkx_?(C{WMn&O!t%|PD_^-;J`9IK+B>OFQ&4Yt%*|sp`a>> zm{z-ZiKYU%oL3P7kjW6Yws`GhZLu7rDLyL8DK7_|D_EuRc(U6g7W44siZNU|A*j4h z$!e>YLJ)a@ZCcmm4mkP>pP^+r7L8^y-g*}L=_@3HcKs&|w-JW%lV*(2ONh<}x7%kA NZ@24Du9Cx{zX7}iA;zOGaAL6Y7$SZNmGy0q^_E}Q@2e!8jl-09XF#+J&7jmq_X3*N}_4h z)^#J9BO^)h-3Gqn;5*hmhhgs%>z%93`7h>3`7jv^9-cEIQq*IyLQE1soP>+m6uJq?#PyH`6pwC&MwR^ zEo7GF51v@aT=MZtnZ4sl@VTTEE@ir(rG;mfGH1>nJ2`*$V&?e5#muSGOPN#WPn_82 zMRiQI7uSt?c;U(U^Cy-vlaqrnHQ6rLyo7@>OR_x_*|J63vD}o8omyHrvT!!jOPR#+ z!K6jUE_d%@AZeKK!Ney`S*zLdF=Miu$4u~#2$IX<;2$yghnGybD4VhgFBSZgp_q;( zoAV`Ew=Z2UCZI*^-uqMMPM`9#Ir-w}hEkPGS+r%B!@%|TTDDoV6;0l|XX@hqDQ*8$ zAv1M!ZtCRRRPot8)6;`|IY#03(t%~aFLMdz@|ZE0#Wnbw#!_)^;=r!h%1K2p$gQ5r zEq8OYT&_9hvQqGWu##OJJ$CBw!ZVrB_?em>RN%Fl!0|a8-vjQr$KW)$qtV}(*%hk? z??*8Lcad28F1%Pn*S@q8OKh1CCSofGyj0a%$r{cgLm=`K*rqb2Vw;-4i$457=p9&hnDtUg7Gfx%j|hL3zG!ubz$@7 ziP?!*v+s(UY*}JS_OG`kNThqczBqxaUF!aDX?k(f=82h!SgkK%Rc^?tpX}x}lJ#Q* z6LsNB(^pdQEfW(Hv1^WJ9NjyChe4wVv0;PgK6d@)uxFL_?lJeg^paX@%I4m(+}dl3 zdZDJ})mnZpHw`|6kDzxuz>o}@w;|)!W8->;#4Q$(VCKfn$el4Fx0VVtA=A@inO$52nZ1-|SS4&eryRz_l5CLVeywsOQPI87;;qOH_)YkBo_w5t!jnr-zL zP?SYQl`~JzpFMPR{_I|oVW!uv*D|7EsESWYVjyB5VjyB5VjyB5VjyB5VjyB5VjyB5VjyDRCK%W^ z7C*h2UjK)ubxGc_-1c6h_Vxh1MM?IIp5TI039ZmNmKR5kA zEKY#PG%oNwj^oRUuGs$1Cuw(bAA4~G`*ZBu*c;#^`a}#w3`7h>3`7h>3`7h>3`7h> z3`7h>3`7h>4BSZursAh#*Bu`idnkS!#9DV;ApUUtB#5*Ac);k6IFTG42iOF16vsY* z`Pzp46#L)U2V*-&<0CJ{|L5pWWB+C3Z;xdAvwWq3U^7>-?V}UBaw`|M<#M}<4r#Y| zjbqeOo@(o}qM^)!F$h(b++`56bb$ctO&G~(OGQxr*uF_` zso&%rSl732(rz2zIv_oF$s+h8u)Yw;fg6NqZ+RW~?PRT^sH!;2Wbw@2X9(ia%n3zz zTA3ElF0=G>W*#i(kT1yj`V4N)%^+Z82m+pOW2Lw}Jrc!sFcCMV!#xvHyyBFz!I4cR;c3KyJ#wJo-6=0GT` z1uLf%)+t3c%hO<(jJi9ec;nf7-obH__4DY7-Hi5xZf-ZMN|4+f&14yp8&HW={HnMa zs)Y9PaxPbt+5&E{C8deCT6F1lRD#BLTQ$?p?eDI5+-+4AW2t6~YM-{qEdwl5^R;Fj zodFLQLs85E6^nP)*Y@_QK!LF@i0KZ~wf;xs=lX5w# zna@|5c2%plwN8UsOUK+AqtCnm%N$T2m(D5jpe}0iIyyrTSpsJng1hU6rkf$JIC};K zRZ-u%a_SJk-h2Hc=FDxdcumFBFKboA0t?c^3 z{#>roA`GqFWItTjrK*X0K2S;2jV}wLsev8X!v271ceF z0h6+6)=corQd!P)o5gOZn6i~=fcecr#w~~pRGymIo$k!owW_RxV`z}#7u1dWg?fe>Wa}83nW!4 zizSs^L&tg+aL5we6{VpVP`DpK=kK~o)1zTS+ZHm*@qP6%=+38if&+qqLn;C1|0hsp z1bY+xZR{lWW%Tmb(mk+;*IO8w{YFCzqsq&`UP!2W35Ny*8-Mw#^d__xR3 zPrir!DtZk0QToT@BBFuRe;fH)`h4me33gp6+C-t$DHswioPk)iB1!4pLX+<5*eh*6Xv8jeI04ZNY$rDG7Q=N+zWI0kOgvTm41-SnIa-30p~ zu#I-jVdNta6Y9Do(3)DK+Er4;pM+R}t0^L0ZOKjCtZK#r#7Mc6=XJ}j6lk8U5r-jW zsKs)rzzJ%p)=+EuA&9k{N|{#-5inEb%I$*?E8;?4>vTAhEm7r;F%PjapQkLTTrCuA zM`WcZAeJ{9j$R-{TCy5Vy>$R$az|vVyslU^8oWa8JPxsrg7bBy#9Mq>t~AXY#41I; zQ4{rMm3LaDQvNZB85J(ix0+R}Xz>NZd=z5&8qc@LmTIYT(cl_$5Mu4JbiqlBhGTY!;gcu`{ zbyKnoqhdK~qfJ1pL@-v9t5$8R0=mc+4zaqWv@7u6qQkSL#$MgdAh)}ly2l(5;X-ei)*!ttX(j9vBuXs4?_$*&~iO*nVMy` zY=NJESiRh_D{{F=Qn(LfNSJ;Kul!WD$X}WRjX2^YWaSMmDx6# zuUO5NUT);^=5~nLojhKk%Pk_Gx5};JeGtPdctLe)Hl9~H9X!7cVtS3V3$#IM9A)5= zy%l0SQOh@2T5L9rqG8uCh#8RHGL2gW(*PWy5X-kKx+W50!xYU<4M!l>R9Kk?_ zJhmN6W1GMcUqJsRYNA!N0DAjR zqx0w-N}>DEDfBaF5*_hAd_7XaQZbg3;{Sw+nPoqbX z-$%ZM{43-e$UoY+m3?$)5d#qe5d#qe5d#qe5d#qe5d#qe5d(LUfz9#JSnM^?3od!V zvKM^T3toW1$akLig6F*8SueQg1(Ud%;s4c+3lqdchGdc+v|NU=VxluqPezf`eW#@BQ|K7aZ`w$Gsru1&?{b zqh2uQ1%emwUch+)>jjJ#&|W}!0qF&V7vNqn>jhaa*zX1VykN!)9`S-{FWBn^d%R$` z7fgA(Dz2@eT)*a8om;b9XzjKM>EQ#=++jE==)NpJo?(H_BG!+tO>B)^hq zC;mNp7wJCA0uDwyg2CG;BlB3egFpih4e zJ%%0tJ$3~7@5qmkKSq8J`Ca69kQGEjB;+D;8rg$9fNV#S=^tYbc*Ec?v44U6W3blX z5LivH4gC{$#lZ~vAR0$LMBYZehWr}xCFB>7CbED$iV*4lm;Q_NyXikne=q&5^f%LA zzmrc>lvcz*#6ZMA#6ZMA#K6bQz|z>tOl+-1%d=IZ!Qp}hW<=}xdX>M4_sb@nu@&vM z61|l-ly*Khwj!)v74GP4%`O{xcTXnE+v0qdt`jX)QnjL5t2z`lOM$JJh;s`HyU3pB z$gH844%lT!%jXCjZ-MV_cdc}8$I8UmWnwk)zGccom*{`BvhPKio5_+XtG&1N9+@H! zd2bwL0h)beikg>Ol586GUhtC2^!?%GH<h1n5UW1oE*Gkq*zo zt-k}C3b#==m}pNOZ{{t^@jFtc$sO_8RmJG7eouT9G;O&nG;O{kG;Lawrm;QobFmwE zyDENaY-LyMj=k42`apa>Ihocgb+cT)c@^}DIBr`|}tmb#W|rj*okA9E`ux?IFS#6ZMA#6ZMA#6ZMA z#6ZNrjWU45cg6fYrNn@ADIhHeq|XMV7Xs4r0qMDb^lU)77?7R`NEZUq(*fyxKw1h& z=K|8%fV3Ep&IF{>0qImgIvJ2o1f=5u>8XHpEFc{XNJj$FlL2WVARP`!hXT^UfHWVF zo(M<>0@C9FDHo6)3rLR!q`8131SCEnaRG@9NK8PY0}>UG$bduyBs?I^2Bd62+8>bi z1*DmP^hiLO4oG_g(w=~{J0ML3q=y62Ljh?rAUzn6G688AEiO2#K*?k*M+{@G4= z=5CO&!^iIT&$jz#_xWer{Ijk88Rnm%{u$z*rTw#%e>U!)CH=F6f40Rx+w7lh^3TTL znS0N1|7 zr<2?hdgy zy&tDD1O=Rvga2X(eklZB4#7Vgg1-=gKOcfW7lJ<Se<}n&7J?rQ!H4hv2yo{IL-H(GYwt1Q$YZJ_P4Na5e;ILU1|+r$TTt1SdjpJOrN&!LuRw z{t$d$2tE^nKN5mZhv0id@I4{;?ht$`1b^7a{hh#Fdp;3@?+n3rgy8pw;M+s+`$F(- zA^6r191FqG5F81?(;;{&1RoEKfrx>Kfrx>Kfrx>K0gr*+ zJR+XOvqUuiPkKJAh-m)5$3!&$-(zA!&i}j5?E`_Q_-_QHPX{E}Jx2WXK7pTpJ|KN6 zApKlGng~cc1JaIwbbmnF9+2(}NZSI^)_{b;j(uX}r4cll`uoYBB#g}+&;Q@YVZw5^~kgUvNNh6_5P?&0W{?XaB3X>%X}d^duDd{{y}!BmaM%3)~zL zRF261pEBEfHPLr2r<4{$5AHw&Bl4$AMz!C^jny{DAM`Rs8DxJD`pU z*V?(v>M1;+gDk_-AflS@y_y#1y&Y%2*CKbd7XW(~FQ z@M}}|1GTtJeBq&7Zot8euNM7%_8Z)$>Sj#Ojc=djtJHAc1~|~>d6K_NzRho(p*w4w z0Cir1MMYK%R_;36k8N;0r3HLVJ%#wyt=pmbnz{D*TyDVW(e3Ez8r!L@qhx%RCOPoA z`!(SDk6}>Bx`QR%t=9tjq7?3FmAKDWi2(^66Y|z~$NPs6?+eyOFI7*D)V#mLP$PIQH(FkDJkz zKm*!SBde+yOEp_mdjqin+tS_JF<@vmu9@lT&QJ@<$FFYN>YACCW4YXb%e>psshcx1 z1gLrlh9voWOLy+ks>dyRilYZxBR=l+|NnFZO{Kn?{N*iAY}y~^NB;CyyZ;;W@2)Ol zzAYVa3wb+we}`--on-`p5bm+(;b*~?uJ_zrF;S>f$TcyS8*nSSmQLNw&bjN_9RRcEEbvWBMD^!!#hzs-E=zr6($1qti95bjAK7MsE?bj^>Zi8<} zCGJq&LS#vj#5Y1WfBi=xXh%Nbb&IDv9JRJi0sQLLly7DR+)l5lQ|qrjxu4R{^D9hK;rnVZ>4ex0g`$g((? z4A}s~0ym>G0dv!1!c(hH((r(%OT$A>K7PeaLLGCPv;$u3*V3^&)TAZoERQqn-M2HJ z$R@2@xE#r@QP&Vzh{OJWD#nhWJJN5Z{@Hjw(cHppdUx!%;*HUH07suS8MvItp))5Z zMkjU&D;Kuqa=SVT&exR^Z}DZh(llp9Lz(R#(r#LsPSSa&#WiaLL7kajI&^g8JMQG4 z|H??&wvD;jS+ypK-a-}NBM6^8S?egOD$X)lJhS&1f_OA@LeZU8rp2?%EIpmM*=6Gd zcpDA;%bXL7qN#M-&o6#1xb+i3%rR`16uNrjZwa-E`*(erd<>ged1(787nLI4sEK;B z$~&!6DerRO%~TJtFe|D=Sx_nkxmK~QO51gc^psVpb7u<&OY_4{k$@Q*`HnjY?_Yjn zk%kjsUadRz*H2m(_wV{L^(Y{1s*g0I!sYo^vuYJBzF>F?v^Hrxt!tK4Z}YTjDTEF5 zrBqvPNX4g~I>Ic?m$O!5z?IZJ!5YyWq8wxm;H#{Wa|5cDukn0~Y^jzi7Y(klj;al^ z2K{ecQ1ee-ICn(5Al##>hOhB_LRAC!Drt)XAWiI3HAc{?3agd~L$^e|a6MZU=4y+= zcUv{n&h=VM{vbwo)&$JxFV}P#xDkVAny9y3Mcl|X4{%3OYjX3E^d8mirBdp57%{#zYJWjZWpm$*{Z!Ecq*4bC7w#|U8cN_Pfo^-=b5pTR3-4x71( z^)V<&nrKUk)1=A`nj?p_k}eQ=wZ=$JTPli@c&iL{wQ^anElZ*$iG`km0#)q;mrc3u zD5hNKsxSOC7#}Kh-yig;c^^8MjQdBc=~%K_1W|g=i7(y*4+|(#8q{^&fw4eQd$?cJ zmlxRq1Jr5i#fs5x7&2$cq&8I4g3b$u$~3By%~I4YKP;=n-XjJGa0=FFQ=HdW4{++? ztDGj7VEdEj=@QM76_qqdyV1NJr5nEe=~BV5-2ssSDj>c}#UeeRUM;O<6^w>PGeSwm zS!Qb%KnWC}+J=8qK=eoGh>6J1yV4byQNp)Imqf{a~WxYMbX=I&=jnory ziZ;x1Ay z<$2w*D+QWoYs5O{{Q3ihfT!4N8)s;6QZ~(+d04hZMYSg9CgF4vCFzR$k^?1!MWk+o zld@%j6(AtOF})$GN+AQQvyA&LPNrsN9Nlt?MMY9%-OhmJBAQ}ZN=>&wjEpEr;IA`w zSjLFe6o>%AI@61j1a?-Bn}#t&A@2=laS6PYjyCGM}d`sa!1-Y)53*Ytcp~@YYQr zc-4X(>h=Py^zgp&IWSm0d9&f@1wy1HtI^b3Q5E%3R8jDi0CtTgL>KqV=kns?167pV z5!ouQD^`te%BB-lQJ&`>Z<>}8hHR2MtqXCVQ`rAUMvji4XVd>ArH%8+gNYMcmNq{> z_CMnC=yNd%{B%Q~%Rl#Yx2nr|Gvci>YqdD7B1)QIQ$ro7J5kl~xPZ?t-<=t9N|*!c z$@7CFl&iQ;@rrZ4TiJD~AsbX#;Ru#eHMQKVxmtTO?fngq@7^M5zq;$@8{mGvFK<~w zXO8Uv3j@0O)(x5G30|-0j#JdV%Fdk*v}Q%eF7I#l@7HtY^ttO#_HO_t=-FlO;ktpRBlhZbdOII0H#gniS#rBAbw{>r z(0y^|+N_M%1#(p)12v*%Djm@V9iDEF2=sdLat1sqLmeHcer%Q-8r)vR{ld6hI*WPT z?_OarhN|(MqEjg~Y)upgpT~%4k^(N_x?bVBj1G-0ui`$_E6yS?e0{5=id9)IQ-Y-E z4M}Qx)pgJCZS*NAuw@R#fZaX@+bOGfU%t--^DWqQrD%grU#DP5xDZgVdm-OcmhHU) z;p+j+w}-Fh+d3WW)m1x=UKMz$#poha2MdZnWX$F;V);qOQOHx`SoA;_TZ*pdEiwC++v{Xse zifXOuP?Wpuk2trWu#4<@j=bmAVhM2CUSJ1Rh467-RW2Vq0Z2R4H}q>uW}{rJlPp7u zE!yi}_OBZnr0&+I88)`&d1Ue2P>;nW5#m0HR~|S%*h?=LIK67)P{z z(J0C-kD|~_R$$f`Md{+JEhwlSw8NU7VQ7WkoQNx|L7Aj5HS!j5HS!j5HS!j5HS!j5HS!j5HavcVc_c434db| zFcT-&^OmVuX3G|MFg%nQoQ0ZQe|Pd*+*pLoGGMtMdH46Qx=!{!5gUtuU9-XZKVoRF H86W@uE7^v@ literal 69632 zcmeHw3ve9gecyo)3E&>Pq$m=kB#K8+APJE??E3);qQEyqf+Pq~e2CO>Z*OmJ@Ah^3 zxZ69&(*TSowlhttdOTB&orforWZc?K)YMJviQCa6X{=`4R-M|lCzFZg)=8Yi)7q|+ zcwD#r_V%!MyN4Aih7tgCj|BeT|F<9Z_WOPB@Bi)hUzk5HSwgm?8471*@x<1|rcH?# zve`r;F$8|LfuEI63IrZmQGgui2}cEo61mb}Wl}$%7#S`n;OF5thRbj&eKPgu$^Qd= z62hbYEXHF7Vg_OcVg_OcVg`N^82He(!J*N;dj~#Jv$%pRk6^XD?h_%wD*1{`?Uy zs%^+CaobT(o;p2q<@{oHY%Cm85v;Q2-8dLi6s*3;ro~yd*}n7ag~d~6PF>Ef+!;fV z@U1!9DtDeDbZa-^;hT>cf}&Z%tUlIBV>b9lC`RWH@DC0D;cY`G35H;}Ulsh5zL>Tt z7&D@vTDR{O6VSqSp8dszix>Q4j(y;ReRt&zfwP1*hk@@uWLieak`&?4!SU-y$Cabw z#q9Xmsqwj~@zRZh6BA*+Y`ypoyN{dqN3yrwRL<(*B(B2W#1cF_GZ(7>ICR=@K~y#9N)%lHJpd1w>| zG!6uB?^Tz;7i?Mm3%W7;zoJv=Cg8sx_-MNU$;1uFY7K~+&!7ote**PzY?Y$lX(#Wm z=@64cqa?`gpwip`;B_OC+_VmXkYv*pmja8QiCUyk)cr*d=VV{BCn+k ze^szn_%{TV)NNNgu~+%Bm3H^`1p3I9(NlW|676p@YciM@=RpD2yl-Er?PebJgPWHU z14EW-gyNJ9GIEMv@b&_iI^B z*JVj4W>-3%l^$<`+_YtMc7NnkcfSlgcUKt%V~SyST#*4kgYbtF@Z0de1|t5%48#n? z48#n?48#n?48#n?48#n?48#n?48#n)hYUP3ICyRgO3^e;AsEf(ZCwZJDLiKid2fw6 zCu)h!f2Th4b2pD4-ZVG|;!+5Mp(ujqxnj{@QQp1=E=__p2wC9U+aM;1 zB3h6&lDC_DiQ~CRL*O-|Xdcr!QJ6*#=z?*{4dKXv<%Qkw;U%u;-Y9N}hGr0W0judw ztMA^d%CNdj)~mcl;W+XR_ck@dnm*duXLSJVxv&Id`hei*oLZbV1Uav%!Z>!q4Jn-3 zJacL>@g=UPNUFbgrfgaI)a0bB@tj=NOlyikSY$FkIj6NGS>`6m9FjeB4Mm^Lo|jbH z$vO;`r-+H{4A{3JTonrEBx{ny=^RdF51l)^ICuU?R+g$l_Kd(+wTbMBvY{!$B#NT# zU4BS*fh%!_)cKPSd=Nu0{3t?z|5+59B8Vx3$)PNABMSGQdwJI`=&;g5Dvl9k%c_xe zlhSKNK1^yjW5CA718w%kvEwSI2pfYMguqs%#>IVVmh4gJ@WCExnkBBrs4Q=qSkXj_ zZE8%xvLsbBH%PisboF!t+)wxN@tvTe9qUOrCRR~gbTnDz%_eEJ6Yg$IGAF}TtX2_f zGRrcGrK4O+2lYYJ@^!wHuT(@bZ*k>3J7>+FZCV$V8#%Ks9<$1}QkX^&!~s8T5=D3S zn*T8Cs$SvD6oKU^3J;Ok#r@}Ap4kCNobDmfR&x?U|H5K=jE!yqWN;YkUz;W=SW>fC^o078>u?o{3?lTPr-d}yM2HW@2Jmys`4-AkzS6mqzgHdu1*xm*W z=qPqZ&hFJvM*~R_bTprpA z9iH9MojH|7i=qmIP$Y0o6HD!Mw@Z{c=@zM@4GH|xIn!)_3Dc#E3t&pJo+{ER<(kbg z7`aNh_HdtxJ4qP!rzGtbghgc1thY3(Vc3{P-AC&hH!{8RL$~;W*Ts-_W`Jg7>r3Dl zJPUq7)8JPI1HV!Sz_0Y~B=qCN;>fK8{B-J5@a>UWat>xv)6j=9KTLlxvnTlx=#A7w zW-0SU__szr3;#j-%TNveoAj@Zd?nRPzMhuSo8b?`TSsnXKAs#;{bT4g=-bd&GH<1K zr~Wkgiy0Kkq`sTl0e>xNr-YFoLu7g;`G?8xjC>pZBs81(R{94?E~7xVpwDJLoxYO# zT=MIw`OGP3UupohMn05&HFG`5rr*wtq~3(jkGzrGmOeW2TKePVN)6>o7USqwUCb#{rb8Cpgwn)C(>qGmTnH6CGZ1Fse|U zb1{oI>g7@mqezT%2M4_? zZXS2B62cagR*S|c5ihs&85b)v1>EGz)nd`IIf{S5#R^8%g0XmM1P zQ6*C&8iHXz?_wmB%tCX0!#;J`eV>_Z)c+SQ23SD5FM%65tOi?$U zb+LlRFb?L(rYw|nx<2J%B&$>v_MEDsJS<0ZR+ zm+J(L(Jt0%sHKYDtm^`83YbE<7{d@EL17gc(=n^wAlvs-9J8p`6@p|%0TBonQyQXd zJ5*g1(NS7{Fnhm;IwakiG=1j!J zYNk|RE2Lv^8cjCJlkNM_6{V`t2u1P=YL{{@rrDLI3J%6-(S#*y$Wa%gB!;jHn5rO6 zRbbR3E>^@XsiZKJ%xYC#5DvSTE^s6w$znwzstjg4<6<;YZJLSljMdZHo&1BO;Bmb>V6kfs>P;b$acXnTHpoxF&EQXf@)$o zODi^`HTium#;^n~DZGGI4N7;&tc&4%3$NIn>3UgKb&Zp1PqgnBT&aXW&#^sZ zz;>hYgrMsjLD9`7TWN}qyI9B;z1zh?rqo?77P29Zx>(4(w$sHz)}kFQ7P5Xk=3=3> z`|U0kT8w_w#X_rS+gvQP!nD=JLQ5@h68`nXV&-2a;P1hI4gU}LPvNh^{|WvQ{0965 z__yKD!2b+>75*q}!zwJox8dvXW%wL?5}t-BcoIGY?}HzQx5H_8GxUF{yFrk(9c6Z3;i@?Kvk#+X8SKeGtd--Lr0)-=qYFf+LZZG z=6`3tllk+^pJl$5c?h9|Cj z;+iL}dg3KdT=B%BD+XR&@Wf>gocF{fPh9lG1y9U*;=C&cK6cI%FM8mtC(e4}j3-We z;*=`}K6cX6PI%(DCuY2BFL>gZ2R`qKX-_=oiDx}Ac7XxF??W#C}hVd19X@vaT3-b+0F$^1wZw zc+wM3c-P#8iYfyZ>Y84d{2E&w@GqYtS!1 zAA&vr)gTef=@+0`=opx>XEOgY^R3LEWd11g#msMmT?0yn&s@)3%pA<@$!yPzq<;Wb z68;vvU+@L^x8OPW1kA$Qpg)7Y0+G;RXdg6~`C;a*%%?NIocVa>=Q54Vsm!w(H2we5 zf1Q3i{om4GPXB)T^WZ__Ps~8fK+HhQK+HhQK+HhQK+HhQz{A48$l&Nedlx+Chi?0! zydQeS58d)ZH~rAdZm7N0{)UfT_pxh!=&B!j$q!v|L+vM6^g|1N=&~Pg-Va^!Ll^zf z1vk{b%bbs$_px(+=tVy?>xa&|q4v|C@k6Km&?!IONgq4mhmQN989&|&e(0Eg^?5%u z?O%P)4?XLLru=xUA7cCv?T08oMEW7Z58-|Y^Fyc~Lj2IAAIkZmqkia!A3E%Y+U!2# zhbH{1hy2h%KXkwkjk}@t-#+bQ`~A?EAKK@~%le_ce&{Jb-X1^nq#t_1kLOP8N7{Mm zUwqsT?e;^v{LrWyYCqmiKeWTY`j{Wu?uQ=rL)+X?`){}UAu#_xmsm`_oB%fc?*aS& zSAp&S3&8IGOYlE|mthMo!PmeVz&>E*-wZ7L-v-wGF9XZ|>tF@oBz#`dI2isYXfy z4;p`B24V(c24V(c24V(c24V(c2G%D7nZdmS{!7nXK)W5#@&WCYfOadO-3(|i2ecaj z?Rr4F7SOH+w3hP)3TP(-+KGU6JfO`4v=;)}v4Hk`K${L|&jqw+1KLzTV*?r!(CC0h1vE0C5djSk zXjni)0~!+0CIeb7pdAfpM*`a6fc8v4n+Rx!0@}fVb|9dQ2ehXH+Wvqx7SQ$uv}{1z z8_=E#XnO+MlL76CfacESGk$#!TzWj9?G9+W0@`Rm+ZoVy1hmHj+V+63pNqh6 zN8tGg{FMm&Rs?=C0)IIIzY&37kHD`*;8!E?mm=^h5%^*Rz7T<5j=<+5@JkW+#R&XD z1U?smpO3)LMc^++;Ik3<*$Dhh1b#XKKNW$WjKEJs;Kw8InF#!a2>e(C{(J;J9f3a= zfj=98PetHt1kOa@bOcUC;A8|&MBsP?jz!>T1dc@DlM#3>0zVpoABn&ZN8ryy;1dz} zp$Pn71b!d_ACJJF4&#{Dp6`#q$0G235qLHN-y4BH6@l-Gz@Lo3pNPQS+4rc|f8j?l zJd4s^dLyDg9)a(Uz;{L9qY?Pd2z*Bb{#XRQJpz9;0^b&aZ;ilX`~QO*LB)598HgE( z8HgE(8HgE(8HgEpxETl-+G6`Z22Lag|Ipa}zrsXp|6gGuw*Pl3$NO&o&ww^MlQ^1y zekXGwy*c^G5p3w!wtQmquRikO!IPVw8#oOvbwA5H4|Lq(u%7q7&;gS7;ke;d}+IfdXknhiR|>Bars9!utU$Eit&n9wPj@7k%!nx~o!I`Z&S4RAlz%bTC> zxHRdcI&@Cx18`}w<~-mLxexFz4>S8i9=Ae=qlW9n4O6XGdMU%i*rE zpvSGyS+ZdYH@e3yj{=MdRx{w*vrUmLPzSp>&9hGU6*?4BUUdG7{L8> zFArsd9+N`H20wu2WgReqhn-D!N&vupChjEnhCC*PPD{Rz+7Ww9>h+ieNC!Ruai-6s zu8;efu`E6nc7PW=raD|7W2RSOnhN%-?S{|I0f2XzF71I2FAw$jSPdQi9WM6w>TMdh zqFr$UEfvS{lj9gxYjHK;U%*i69HF5qK*s44;Qz{XiB&nNXw?m>W{L#@Twm|*E`gJ1 zlmQ;u`dV5a?-G6bNicvp(?fLVMD+(q^oAu8?dz&NA_3kdvh+l##DBL79Nfa_OQo1&> zbLhWp`Kis!;P*HEXy6;*!u$4FUf2z?lMd{#v z{x0v@6`WUvoK}QM-SG3OHZ@3}M^=wA7x$@IvPXmSs*vxFHZ?ttjPJTswWhNPFWqR^ z?RqEO0Qb|qe0(RUXvcagTF603JK-fs7R)|}>$QqdlUbHgEFI-q`lPIhTE5Pg@|B86 z<}I$AXXmWhvrX%wawBKfH>mIW@RSVrQzft*MfFU{mS=VV5~q7e40&{U2NGqDXkraQ zV;K&3w5m*kMXtPE&dXJYMf2r)A%Bu%&H-Oo2*u`fb%SykE{H1}_7=p2$3iWB$OBHe zaq26M4^4~TVGpDG-7C8#6X4zIJ+nPjGDALu`dEEPRwG@n$ZU?K!lR-t-sN!DqrqM? zxY;YRN@Jqj2mJSp$uU1~%qy!;XLs@3MEr`wE|KYEuxTt=xJONVFWUEF6HjJ&^k z_-EjrE+*uwEL;ljb@>BF4w#x@O&{eAfwP3-%38<)!O?*WzG*{{^O`E;RV~kRCeIax zaqL7tm^Xx)Eg3?w=V~y%!l}*hU6$-^!BJPpb6L3ftm{!%r+)N}HoLf=o6AF6gR9vg z?`-XKw~vA|Cpp_HA8knBm(H1HLoZkJOTaNOeK9V z`K^&(8m5PiZ2sCK-yD2%)6aqn@h8l{@;tUOZ0*>+ouJ>)aQR)^Ve8tN&{1RxL&17p zu&=|x8q^Bz7sKUa=*pnA!)eIxY9FWXRr3uwI&9`gDu<&F)r>Cvt&*N_vVB>^>Vs2*)v{U|EWfU>wbQ!0q&=Ic|I3z zq=L?f!{y;&ZKS|1FOjuc(th@ zh`!dw$GcP%kE|HFI$VT&Sod*36w!jLk-XjHOB~NlMl9XDZ>HHbY`eg|LOMqf!L=N3 zhni=i*%o=MRN? zWTBxsEJJb?rNPvS<-WSSruNM>=XAAh2mzb|yvymagQ1G8s70$$qL~s^(K*uTM5V`s7M?N!H-!uc@__Hbl%fr*b zkzh+gn3^OqCQ}wF4WqBvHB3dth=T3V4Gl%{^*$0r(J2!20BpEf>*9U^TE?CORdBz% zO5N!hDkY|_acZN=*p4U`dU}Qs3zM9TmRYG%6ts$ER+?=?=!<5hMqe%-7iaFz_PKWL z79a;fb3|zS5?Jo=@h)ljvw*bm9@6v*U0|F>)hwAzQTGavHy{a<#t^Dv^0g*I$fkr^ zz6t)t7tfH3Gv)iUy01BFXn6kBVGZD2*08BiQ7dQ+<6w?#%0fw}>+ew1!mNP==da3z z(^nVHC|B>(%)aKNA*<9+w+I5fOWHgONNaDa>eNq?RjLvti>R)ez}$1Uwkm3-c8^x1 zj&aB}1>MVz*|p{r$5-dn#k-syV*sb^%^w|39UO5~q}Zf%*{V0aHjme2S>P>6Q_V@U zMapE0qAigYt2T1KoUU^QktveRA)$9#+Uva?+-LAknT9*I%?^VsuW%MG*$up0Cupp% zRNmwI!9AABuvIc_@Vr0UrkoF1Jj1tXU+&sSO+hY!DD5u?^~6^g9PV)Bv>_YN?_(>$*Uj0;cq3^+P)Eak<05=sdhG)Wy4;4g;6jy(^InLx=>0 zRb))Zta{^al&<^nXPXK-v{lDzNwA!Ycd3{sLdDBb9J8p`6@p|%0TJ%T#r?L$-FoYW zHbj-h@f=HpjR&B3b#R~4J7ql7Ix7uPwjHW2ifF5>Hv2e@TW7RyJH{FgW!hPa^^d82 z+|TN^{Xg-E1oW9qIwdFTBe#Y}wn&@JM{W#m8F&j^Si8?MJ_~Ag?<5JwSx&ck0<9x; zsm8ZU;lnXW0`JG+IlRwEh5ERkq087=z*_HoyjHO3vTo~$K?v%*np$q~Nm82}EcBKH z=tO+HOWORIP$yEhD@3DYNmRY5*<^nw5}uVun6vJ2IJ$8rNq{>n$M)IXT~0l`%jwS3 z!3_y)P32iaku|(o#bhMhhivQ(2_6At-(ewL+$UzqJQduKP^2}9L#mF@K#Z!Qw~5&p z8xlIHBm3se?czWJ+)wqLJtwywUTVM03ub)F1Jl!cF+nUas%ce<1Vd@)J2dBaUnm4K zaM%GqMyHt{RNl>k_)Z9{hFIDhpXdFg4rYh1}Q&gGcy- z{Be(1B7^(7+f85x_w#3Y{zRw=)a6oHEYhqjYIRvt!}WFY;cWsjuwjJmo2CJ-J-o~5 z&f~!*(6K9JM$$R7C|2om-!OW^H-Ufvyx(ZhCdS2mVwTLAU=vtE*n-k((HJG-W$<3v z#@UnQRxyxj0u5P!ySSg~J9}OTH-TlQfSY`|S}a;NN4?XCHf{p%zX`;11l2d~1^MRT zJ^6DioIeGlZmUINAcwf9^Yfz%dmBwaO5pgZufjJpX*CixOHKRb^Dk z)QE;)*l`zy5Lpy-?``uf&i1uQKJIhs&i^xsvkB;O`d_7#Br|e+`25h~mYa`!Z&29u z@&FGm-P31z*Gs`S=A1HRI|z1x)TBo{(&Je4J}YDq%XDb}f4tr~8)?xA+XZ#;G1c=9rX%F%s`+iqrf zc(+)JmqRbGf>-Sord6^lV%<_WE?ggDrdMIQZ*955bnkwRC3_w;d_DW+OI1NA<18Kaohk*clg z1jibRw{Egh$~Q!+`?eKzQXSYf&DOD`8`wW_N`nO9A|RBE@c z@htrTFC-IWjwM%FMd{$({5kw0$e$GhWP72XB3c&9>I_=4!I1X>?+A{U{a0J|cg@B9 zyR+JsPZ#%dtG)j}@!J76wXQ3B#G1DXxi+db7vRl&L7FjQdP*F5%{V$kv&m1G)0(1 zQMB#e1j#ONCC-pKfAWEKVhAEwaI$!gV#A}jF7B6zJ43g_If3a~tH!kq*=gV?*Sks` z=ft};$q~RYDFJdKJY4AF-JIB)U&)E-PMxSTT+Nm(3?tB@T%me;x(AXIeS4VR*QKWQ zQdd9@flY>e@8`NX99nqvfvsntA7*6OWR_>}}pFs*!% zLJK%PUp#pwXF1kG-)vF9i|;CvPjFm&2k&OZ(OV!Z+QW{O%0kyv)Txxkl2k%#hPTgn z^{lvi2Xf3R+e%>?yq@lWpH=cDt~$W*08SevfyGV$`t#Jj^A zE8CbMHDyPxa+1?K@ecP1Vcs6Z{=RiUTi<#`ht9xy#lj6hTkq-8vduTds?M{lB9q0w zCHToOdG|l{b`R5gmplB{o>htro3=bwUA$X~iR+=lC}9QB!BwZBP@E(78qC8>8Slj^ z&|1<47QitC7_!5sr*!cyZ6~h*+D^E`hLyGtoRUSG7Ea5prctW2$928$kA=y*|H61L z>p<&(Ml^y(fOlz}xe93PJ%hPODI!?~lR~a!F^)I*>ZS30eEWZmIRtwr*pQEv6_cfl H`yBp%y`Lz{ diff --git a/tests/logs.go b/tests/logs.go index 39ed2172..3014e01f 100644 --- a/tests/logs.go +++ b/tests/logs.go @@ -1,49 +1,31 @@ package tests -func MockRequestLogsData(app *TestApp) error { +func MockLogsData(app *TestApp) error { _, err := app.LogsDB().NewQuery(` - delete from {{_requests}}; + delete from {{_logs}}; - insert into {{_requests}} ( + insert into {{_logs}} ( [[id]], - [[url]], - [[method]], - [[status]], - [[auth]], - [[userIp]], - [[remoteIp]], - [[referer]], - [[userAgent]], - [[meta]], + [[level]], + [[message]], + [[data]], [[created]], [[updated]] ) values ( "873f2133-9f38-44fb-bf82-c8f53b310d91", - "/test1", - "get", - 200, - "guest", - "127.0.0.1", - "127.0.0.1", - "", - "", - "{}", + 0, + "test_message1", + '{"status":200}', "2022-05-01 10:00:00.123Z", "2022-05-01 10:00:00.123Z" ), ( "f2133873-44fb-9f38-bf82-c918f53b310d", - "/test2", - "post", - 400, - "admin", - "127.0.0.1", - "127.0.0.1", - "", - "", - '{"errorDetails":"error_details..."}', + 8, + "test_message2", + '{"status":400}', "2022-05-02 10:00:00.123Z", "2022-05-02 10:00:00.123Z" ); diff --git a/tools/logger/batch_handler.go b/tools/logger/batch_handler.go new file mode 100644 index 00000000..5ee25a05 --- /dev/null +++ b/tools/logger/batch_handler.go @@ -0,0 +1,264 @@ +package logger + +import ( + "context" + "log/slog" + "sync" + + "github.com/pocketbase/pocketbase/tools/types" +) + +var _ slog.Handler = (*BatchHandler)(nil) + +// BatchOptions are options for the BatchHandler. +type BatchOptions struct { + // WriteFunc processes the batched logs. + WriteFunc func(ctx context.Context, logs []*Log) error + + // BeforeAddFunc is optional function that is invoked every time + // before a new log is added to the batch queue. + // + // Return false to skip adding the log into the batch queue. + BeforeAddFunc func(ctx context.Context, log *Log) bool + + // Level reports the minimum level to log. + // Levels with lower levels are discarded. + // If nil, the Handler uses [slog.LevelInfo]. + Level slog.Leveler + + // BatchSize specifies how many logs to accumulate before calling WriteFunc. + // If not set or 0, fallback to 100 by default. + BatchSize int +} + +// NewBatchHandler creates a slog compatible handler that writes JSON +// logs on batches (default to 100), using the given options. +// +// Panics if [BatchOptions.WriteFunc] is not defined. +// +// Example: +// +// l := slog.New(logger.NewBatchHandler(logger.BatchOptions{ +// WriteFunc: func(ctx context.Context, logs []*Log) error { +// for _, l := range logs { +// fmt.Println(l.Level, l.Message, l.Data) +// } +// return nil +// } +// })) +// l.Info("Example message", "title", "lorem ipsum") +func NewBatchHandler(options BatchOptions) *BatchHandler { + h := &BatchHandler{ + mux: &sync.Mutex{}, + options: &options, + } + + if h.options.WriteFunc == nil { + panic("options.WriteFunc must be set") + } + + if h.options.Level == nil { + h.options.Level = slog.LevelInfo + } + + if h.options.BatchSize == 0 { + h.options.BatchSize = 100 + } + + h.logs = make([]*Log, 0, h.options.BatchSize) + + return h +} + +// BatchHandler is a slog handler that writes records on batches. +// +// The log records attributes are formatted in JSON. +// +// Requires the [BatchOptions.WriteFunc] option to be defined. +type BatchHandler struct { + mux *sync.Mutex + parent *BatchHandler + options *BatchOptions + group string + attrs []slog.Attr + logs []*Log +} + +// Enabled reports whether the handler handles records at the given level. +// +// The handler ignores records whose level is lower. +func (h *BatchHandler) Enabled(ctx context.Context, level slog.Level) bool { + return level >= h.options.Level.Level() +} + +// WithGroup returns a new BatchHandler that starts a group. +// +// All logger attributes will be resolved under the specified group name. +func (h *BatchHandler) WithGroup(name string) slog.Handler { + if name == "" { + return h + } + + return &BatchHandler{ + parent: h, + mux: h.mux, + options: h.options, + group: name, + } +} + +// WithAttrs returns a new BatchHandler loaded with the specified attributes. +func (h *BatchHandler) WithAttrs(attrs []slog.Attr) slog.Handler { + if len(attrs) == 0 { + return h + } + + return &BatchHandler{ + parent: h, + mux: h.mux, + options: h.options, + attrs: attrs, + } +} + +// Handle formats the slog.Record argument as JSON object and adds it +// to the batch queue. +// +// If the batch queue threshold has been reached, the WriteFunc option +// is invoked with the accumulated logs which in turn will reset the batch queue. +func (h *BatchHandler) Handle(ctx context.Context, r slog.Record) error { + if h.group != "" { + h.mux.Lock() + attrs := make([]any, 0, len(h.attrs)+r.NumAttrs()) + for _, a := range h.attrs { + attrs = append(attrs, a) + } + h.mux.Unlock() + + r.Attrs(func(a slog.Attr) bool { + attrs = append(attrs, a) + return true + }) + + r = slog.NewRecord(r.Time, r.Level, r.Message, r.PC) + r.AddAttrs(slog.Group(h.group, attrs...)) + } else if len(h.attrs) > 0 { + r = r.Clone() + + h.mux.Lock() + r.AddAttrs(h.attrs...) + h.mux.Unlock() + } + + if h.parent != nil { + return h.parent.Handle(ctx, r) + } + + data := make(map[string]any, r.NumAttrs()) + + r.Attrs(func(a slog.Attr) bool { + if err := h.resolveAttr(data, a); err != nil { + return false + } + + return true + }) + + log := &Log{ + Time: r.Time, + Level: r.Level, + Message: r.Message, + Data: types.JsonMap(data), + } + + if h.options.BeforeAddFunc != nil && !h.options.BeforeAddFunc(ctx, log) { + return nil + } + + h.mux.Lock() + h.logs = append(h.logs, log) + totalLogs := len(h.logs) + h.mux.Unlock() + + if totalLogs >= h.options.BatchSize { + if err := h.WriteAll(ctx); err != nil { + return err + } + } + + return nil +} + +// SetLevel updates the handler options level to the specified one. +func (h *BatchHandler) SetLevel(level slog.Level) { + h.mux.Lock() + h.options.Level = level + h.mux.Unlock() +} + +// WriteAll writes all accumulated Log entries and resets the batch queue. +func (h *BatchHandler) WriteAll(ctx context.Context) error { + if h.parent != nil { + // invoke recursively the parent level handler since the most + // top level one is holding the logs queue. + return h.parent.WriteAll(ctx) + } + + h.mux.Lock() + + totalLogs := len(h.logs) + + // no logs to write + if totalLogs == 0 { + h.mux.Unlock() + return nil + } + + // create a copy of the logs slice to prevent blocking during write + logs := make([]*Log, totalLogs) + copy(logs, h.logs) + h.logs = h.logs[:0] // reset + + h.mux.Unlock() + + return h.options.WriteFunc(ctx, logs) +} + +// resolveAttr writes attr into data. +func (h *BatchHandler) resolveAttr(data map[string]any, attr slog.Attr) error { + // ensure that the attr value is resolved before doing anything else + attr.Value = attr.Value.Resolve() + + if attr.Equal(slog.Attr{}) { + return nil // ignore empty attrs + } + + switch attr.Value.Kind() { + case slog.KindGroup: + attrs := attr.Value.Group() + if len(attrs) == 0 { + return nil // ignore empty groups + } + + // create a submap to wrap the resolved group attributes + groupData := make(map[string]any, len(attrs)) + + for _, subAttr := range attrs { + h.resolveAttr(groupData, subAttr) + } + + if len(groupData) > 0 { + data[attr.Key] = groupData + } + default: + v := attr.Value.Any() + + if err, ok := v.(error); ok { + data[attr.Key] = err.Error() + } else { + data[attr.Key] = v + } + } + + return nil +} diff --git a/tools/logger/batch_handler_test.go b/tools/logger/batch_handler_test.go new file mode 100644 index 00000000..f73652e9 --- /dev/null +++ b/tools/logger/batch_handler_test.go @@ -0,0 +1,324 @@ +package logger + +import ( + "context" + "errors" + "fmt" + "log/slog" + "testing" + "time" +) + +func TestNewBatchHandlerPanic(t *testing.T) { + defer func() { + if r := recover(); r == nil { + t.Errorf("Expected to panic.") + } + }() + + NewBatchHandler(BatchOptions{}) +} + +func TestNewBatchHandlerDefaults(t *testing.T) { + h := NewBatchHandler(BatchOptions{ + WriteFunc: func(ctx context.Context, logs []*Log) error { + return nil + }, + }) + + if h.options.BatchSize != 100 { + t.Fatalf("Expected default BatchSize %d, got %d", 100, h.options.BatchSize) + } + + if h.options.Level != slog.LevelInfo { + t.Fatalf("Expected default Level Info, got %v", h.options.Level) + } + + if h.options.BeforeAddFunc != nil { + t.Fatal("Expected default BeforeAddFunc to be nil") + } + + if h.options.WriteFunc == nil { + t.Fatal("Expected default WriteFunc to be set") + } + + if h.group != "" { + t.Fatalf("Expected empty group, got %s", h.group) + } + + if len(h.attrs) != 0 { + t.Fatalf("Expected empty attrs, got %v", h.attrs) + } + + if len(h.logs) != 0 { + t.Fatalf("Expected empty logs queue, got %v", h.logs) + } +} + +func TestBatchHandlerEnabled(t *testing.T) { + h := NewBatchHandler(BatchOptions{ + Level: slog.LevelWarn, + WriteFunc: func(ctx context.Context, logs []*Log) error { + return nil + }, + }) + + l := slog.New(h) + + scenarios := []struct { + level slog.Level + expected bool + }{ + {slog.LevelDebug, false}, + {slog.LevelInfo, false}, + {slog.LevelWarn, true}, + {slog.LevelError, true}, + } + + for _, s := range scenarios { + t.Run(fmt.Sprintf("Level %v", s.level), func(t *testing.T) { + result := l.Enabled(context.Background(), s.level) + + if result != s.expected { + t.Fatalf("Expected %v, got %v", s.expected, result) + } + }) + } +} + +func TestBatchHandlerSetLevel(t *testing.T) { + h := NewBatchHandler(BatchOptions{ + Level: slog.LevelWarn, + WriteFunc: func(ctx context.Context, logs []*Log) error { + return nil + }, + }) + + if h.options.Level != slog.LevelWarn { + t.Fatalf("Expected the initial level to be %d, got %d", slog.LevelWarn, h.options.Level) + } + + h.SetLevel(slog.LevelDebug) + + if h.options.Level != slog.LevelDebug { + t.Fatalf("Expected the updated level to be %d, got %d", slog.LevelDebug, h.options.Level) + } +} + +func TestBatchHandlerWithAttrsAndWithGroup(t *testing.T) { + h0 := NewBatchHandler(BatchOptions{ + WriteFunc: func(ctx context.Context, logs []*Log) error { + return nil + }, + }) + + h1 := h0.WithAttrs([]slog.Attr{slog.Int("test1", 1)}).(*BatchHandler) + h2 := h1.WithGroup("h2_group").(*BatchHandler) + h3 := h2.WithAttrs([]slog.Attr{slog.Int("test2", 2)}).(*BatchHandler) + + scenarios := []struct { + name string + handler *BatchHandler + expectedParent *BatchHandler + expectedGroup string + expectedAttrs int + }{ + { + "h0", + h0, + nil, + "", + 0, + }, + { + "h1", + h1, + h0, + "", + 1, + }, + { + "h2", + h2, + h1, + "h2_group", + 0, + }, + { + "h3", + h3, + h2, + "", + 1, + }, + } + + for _, s := range scenarios { + t.Run(s.name, func(t *testing.T) { + if s.handler.group != s.expectedGroup { + t.Fatalf("Expected group %q, got %q", s.expectedGroup, s.handler.group) + } + + if s.handler.parent != s.expectedParent { + t.Fatalf("Expected parent %v, got %v", s.expectedParent, s.handler.parent) + } + + if totalAttrs := len(s.handler.attrs); totalAttrs != s.expectedAttrs { + t.Fatalf("Expected %d attrs, got %d", s.expectedAttrs, totalAttrs) + } + }) + } +} + +func TestBatchHandlerHandle(t *testing.T) { + ctx := context.Background() + + beforeLogs := []*Log{} + writeLogs := []*Log{} + + h := NewBatchHandler(BatchOptions{ + BatchSize: 3, + BeforeAddFunc: func(_ context.Context, log *Log) bool { + beforeLogs = append(beforeLogs, log) + + if log.Message == "test2" { + return false // skip test2 log + } + + return true + }, + WriteFunc: func(_ context.Context, logs []*Log) error { + writeLogs = logs + return nil + }, + }) + + h.Handle(ctx, slog.NewRecord(time.Now(), slog.LevelInfo, "test1", 0)) + h.Handle(ctx, slog.NewRecord(time.Now(), slog.LevelInfo, "test2", 0)) + h.Handle(ctx, slog.NewRecord(time.Now(), slog.LevelInfo, "test3", 0)) + + // no batch write + { + checkLogMessages([]string{"test1", "test2", "test3"}, beforeLogs, t) + + checkLogMessages([]string{"test1", "test3"}, h.logs, t) + + // should be empty because no batch write has happened yet + if totalWriteLogs := len(writeLogs); totalWriteLogs != 0 { + t.Fatalf("Expected %d writeLogs, got %d", 0, totalWriteLogs) + } + } + + // add one more log to trigger the batch write + { + h.Handle(ctx, slog.NewRecord(time.Now(), slog.LevelInfo, "test4", 0)) + + // should be empty after the batch write + checkLogMessages([]string{}, h.logs, t) + + checkLogMessages([]string{"test1", "test3", "test4"}, writeLogs, t) + } +} + +func TestBatchHandlerWriteAll(t *testing.T) { + ctx := context.Background() + + beforeLogs := []*Log{} + writeLogs := []*Log{} + + h := NewBatchHandler(BatchOptions{ + BatchSize: 3, + BeforeAddFunc: func(_ context.Context, log *Log) bool { + beforeLogs = append(beforeLogs, log) + return true + }, + WriteFunc: func(_ context.Context, logs []*Log) error { + writeLogs = logs + return nil + }, + }) + + h.Handle(ctx, slog.NewRecord(time.Now(), slog.LevelInfo, "test1", 0)) + h.Handle(ctx, slog.NewRecord(time.Now(), slog.LevelInfo, "test2", 0)) + + checkLogMessages([]string{"test1", "test2"}, beforeLogs, t) + checkLogMessages([]string{"test1", "test2"}, h.logs, t) + checkLogMessages([]string{}, writeLogs, t) // empty because the batch size hasn't been reached + + // force trigger the batch write + h.WriteAll(ctx) + + checkLogMessages([]string{"test1", "test2"}, beforeLogs, t) + checkLogMessages([]string{}, h.logs, t) // reset + checkLogMessages([]string{"test1", "test2"}, writeLogs, t) +} + +func TestBatchHandlerAttrsFormat(t *testing.T) { + ctx := context.Background() + + beforeLogs := []*Log{} + + h0 := NewBatchHandler(BatchOptions{ + BeforeAddFunc: func(_ context.Context, log *Log) bool { + beforeLogs = append(beforeLogs, log) + return true + }, + WriteFunc: func(_ context.Context, logs []*Log) error { + return nil + }, + }) + + h1 := h0.WithAttrs([]slog.Attr{slog.Int("a", 1), slog.String("b", "123")}) + + h2 := h1.WithGroup("sub").WithAttrs([]slog.Attr{ + slog.Int("c", 3), + slog.Any("d", map[string]any{"d.1": 1}), + slog.Any("e", errors.New("example error")), + }) + + record := slog.NewRecord(time.Now(), slog.LevelInfo, "hello", 0) + record.AddAttrs(slog.String("name", "test")) + + h0.Handle(ctx, record) + h1.Handle(ctx, record) + h2.Handle(ctx, record) + + expected := []string{ + `{"name":"test"}`, + `{"a":1,"b":"123","name":"test"}`, + `{"a":1,"b":"123","sub":{"c":3,"d":{"d.1":1},"e":"example error","name":"test"}}`, + } + + if len(beforeLogs) != len(expected) { + t.Fatalf("Expected %d logs, got %d", len(beforeLogs), len(expected)) + } + + for i, data := range expected { + t.Run(fmt.Sprintf("log handler %d", i), func(t *testing.T) { + log := beforeLogs[i] + raw, _ := log.Data.MarshalJSON() + if string(raw) != data { + t.Fatalf("Expected \n%s \ngot \n%s", data, raw) + } + }) + } +} + +func checkLogMessages(expected []string, logs []*Log, t *testing.T) { + if len(logs) != len(expected) { + t.Fatalf("Expected %d batched logs, got %d (expected: %v)", len(expected), len(logs), expected) + } + + for _, message := range expected { + exists := false + for _, l := range logs { + if l.Message == message { + exists = true + continue + } + } + if !exists { + t.Fatalf("Missing %q log message", message) + } + } +} diff --git a/tools/logger/log.go b/tools/logger/log.go new file mode 100644 index 00000000..6a9b506d --- /dev/null +++ b/tools/logger/log.go @@ -0,0 +1,17 @@ +package logger + +import ( + "log/slog" + "time" + + "github.com/pocketbase/pocketbase/tools/types" +) + +// Log is similar to [slog.Record] bit contains the log attributes as +// preformatted JSON map. +type Log struct { + Time time.Time + Message string + Level slog.Level + Data types.JsonMap +} diff --git a/tools/osutils/dir.go b/tools/osutils/dir.go index 1b4dfc43..e7766e11 100644 --- a/tools/osutils/dir.go +++ b/tools/osutils/dir.go @@ -1,7 +1,7 @@ package osutils import ( - "log" + "errors" "os" "path/filepath" @@ -65,9 +65,8 @@ func MoveDirContent(src string, dest string, rootExclude ...string) error { if err := os.Rename(old, new); err != nil { if errs := tryRollback(); len(errs) > 0 { - // currently just log the rollback errors - // in the future we may require go 1.20+ to use errors.Join() - log.Println(errs) + errs = append(errs, err) + err = errors.Join(errs...) } return err diff --git a/tools/routine/routine.go b/tools/routine/routine.go index 7974d58b..a18f8559 100644 --- a/tools/routine/routine.go +++ b/tools/routine/routine.go @@ -22,8 +22,8 @@ func FireAndForget(f func(), wg ...*sync.WaitGroup) { defer func() { if err := recover(); err != nil { - log.Printf("RECOVERED FROM PANIC: %v", err) - log.Printf("%s\n", string(debug.Stack())) + log.Printf("RECOVERED FROM PANIC (safe to ignore): %v", err) + log.Println(string(debug.Stack())) } }() diff --git a/tools/search/filter_test.go b/tools/search/filter_test.go index 7b45065c..549e178c 100644 --- a/tools/search/filter_test.go +++ b/tools/search/filter_test.go @@ -13,7 +13,7 @@ import ( ) func TestFilterDataBuildExpr(t *testing.T) { - resolver := search.NewSimpleFieldResolver("test1", "test2", "test3", `^test4.\w+$`) + resolver := search.NewSimpleFieldResolver("test1", "test2", "test3", `^test4_\w+$`) scenarios := []struct { name string @@ -96,35 +96,35 @@ func TestFilterDataBuildExpr(t *testing.T) { { "macros", ` - test4.1 > @now && - test4.2 > @second && - test4.3 > @minute && - test4.4 > @hour && - test4.5 > @day && - test4.6 > @year && - test4.7 > @month && - test4.9 > @weekday && - test4.9 > @todayStart && - test4.10 > @todayEnd && - test4.11 > @monthStart && - test4.12 > @monthEnd && - test4.13 > @yearStart && - test4.14 > @yearEnd + test4_1 > @now && + test4_2 > @second && + test4_3 > @minute && + test4_4 > @hour && + test4_5 > @day && + test4_6 > @year && + test4_7 > @month && + test4_9 > @weekday && + test4_9 > @todayStart && + test4_10 > @todayEnd && + test4_11 > @monthStart && + test4_12 > @monthEnd && + test4_13 > @yearStart && + test4_14 > @yearEnd `, false, - "([[test4.1]] > {:TEST} AND [[test4.2]] > {:TEST} AND [[test4.3]] > {:TEST} AND [[test4.4]] > {:TEST} AND [[test4.5]] > {:TEST} AND [[test4.6]] > {:TEST} AND [[test4.7]] > {:TEST} AND [[test4.9]] > {:TEST} AND [[test4.9]] > {:TEST} AND [[test4.10]] > {:TEST} AND [[test4.11]] > {:TEST} AND [[test4.12]] > {:TEST} AND [[test4.13]] > {:TEST} AND [[test4.14]] > {:TEST})", + "([[test4_1]] > {:TEST} AND [[test4_2]] > {:TEST} AND [[test4_3]] > {:TEST} AND [[test4_4]] > {:TEST} AND [[test4_5]] > {:TEST} AND [[test4_6]] > {:TEST} AND [[test4_7]] > {:TEST} AND [[test4_9]] > {:TEST} AND [[test4_9]] > {:TEST} AND [[test4_10]] > {:TEST} AND [[test4_11]] > {:TEST} AND [[test4_12]] > {:TEST} AND [[test4_13]] > {:TEST} AND [[test4_14]] > {:TEST})", }, { "complex expression", - "((test1 > 1) || (test2 != 2)) && test3 ~ '%%example' && test4.sub = null", + "((test1 > 1) || (test2 != 2)) && test3 ~ '%%example' && test4_sub = null", false, - "(([[test1]] > {:TEST} OR [[test2]] != {:TEST}) AND [[test3]] LIKE {:TEST} ESCAPE '\\' AND ([[test4.sub]] = '' OR [[test4.sub]] IS NULL))", + "(([[test1]] > {:TEST} OR [[test2]] != {:TEST}) AND [[test3]] LIKE {:TEST} ESCAPE '\\' AND ([[test4_sub]] = '' OR [[test4_sub]] IS NULL))", }, { "combination of special literals (null, true, false)", - "test1=true && test2 != false && null = test3 || null != test4.sub", + "test1=true && test2 != false && null = test3 || null != test4_sub", false, - "([[test1]] = 1 AND [[test2]] != 0 AND ('' = [[test3]] OR [[test3]] IS NULL) OR ('' != [[test4.sub]] AND [[test4.sub]] IS NOT NULL))", + "([[test1]] = 1 AND [[test2]] != 0 AND ('' = [[test3]] OR [[test3]] IS NULL) OR ('' != [[test4_sub]] AND [[test4_sub]] IS NOT NULL))", }, { "all operators", diff --git a/tools/search/simple_field_resolver.go b/tools/search/simple_field_resolver.go index da5d771a..d3911e38 100644 --- a/tools/search/simple_field_resolver.go +++ b/tools/search/simple_field_resolver.go @@ -2,6 +2,8 @@ package search import ( "fmt" + "strconv" + "strings" "github.com/pocketbase/dbx" "github.com/pocketbase/pocketbase/tools/inflector" @@ -73,7 +75,34 @@ func (r *SimpleFieldResolver) Resolve(field string) (*ResolverResult, error) { return nil, fmt.Errorf("Failed to resolve field %q.", field) } + parts := strings.Split(field, ".") + + // single regular field + if len(parts) == 1 { + return &ResolverResult{ + Identifier: "[[" + inflector.Columnify(parts[0]) + "]]", + }, nil + } + + // treat as json path + var jsonPath strings.Builder + jsonPath.WriteString("$") + for _, part := range parts[1:] { + if _, err := strconv.Atoi(part); err == nil { + jsonPath.WriteString("[") + jsonPath.WriteString(inflector.Columnify(part)) + jsonPath.WriteString("]") + } else { + jsonPath.WriteString(".") + jsonPath.WriteString(inflector.Columnify(part)) + } + } + return &ResolverResult{ - Identifier: "[[" + inflector.Columnify(field) + "]]", + Identifier: fmt.Sprintf( + "JSON_EXTRACT([[%s]], '%s')", + inflector.Columnify(parts[0]), + jsonPath.String(), + ), }, nil } diff --git a/tools/search/simple_field_resolver_test.go b/tools/search/simple_field_resolver_test.go index bba96aea..0bb2814a 100644 --- a/tools/search/simple_field_resolver_test.go +++ b/tools/search/simple_field_resolver_test.go @@ -43,7 +43,7 @@ func TestSimpleFieldResolverUpdateQuery(t *testing.T) { } func TestSimpleFieldResolverResolve(t *testing.T) { - r := search.NewSimpleFieldResolver("test", `^test_regex\d+$`, "Test columnify!") + r := search.NewSimpleFieldResolver("test", `^test_regex\d+$`, "Test columnify!", "data.test") scenarios := []struct { fieldName string @@ -58,6 +58,7 @@ func TestSimpleFieldResolverResolve(t *testing.T) { {"test_regex", true, ""}, {"test_regex1", false, "[[test_regex1]]"}, {"Test columnify!", false, "[[Testcolumnify]]"}, + {"data.test", false, "JSON_EXTRACT([[data]], '$.test')"}, } for i, s := range scenarios { diff --git a/tools/store/store.go b/tools/store/store.go index b3121e62..d71d085f 100644 --- a/tools/store/store.go +++ b/tools/store/store.go @@ -4,8 +4,8 @@ import "sync" // Store defines a concurrent safe in memory key-value data store. type Store[T any] struct { - mux sync.RWMutex data map[string]T + mux sync.RWMutex } // New creates a new Store[T] instance with a shallow copy of the provided data (if any). diff --git a/ui/.env b/ui/.env index 8cf51260..bc0f7918 100644 --- a/ui/.env +++ b/ui/.env @@ -9,4 +9,4 @@ PB_DOCS_URL = "https://pocketbase.io/docs/" PB_JS_SDK_URL = "https://github.com/pocketbase/js-sdk" PB_DART_SDK_URL = "https://github.com/pocketbase/dart-sdk" PB_RELEASES = "https://github.com/pocketbase/pocketbase/releases" -PB_VERSION = "v0.20.0-rc3" +PB_VERSION = "v0.20.0-rc4" diff --git a/ui/dist/assets/AuthMethodsDocs-33f5e9f2.js b/ui/dist/assets/AuthMethodsDocs-932fac77.js similarity index 97% rename from ui/dist/assets/AuthMethodsDocs-33f5e9f2.js rename to ui/dist/assets/AuthMethodsDocs-932fac77.js index f9fb7908..9b8e188e 100644 --- a/ui/dist/assets/AuthMethodsDocs-33f5e9f2.js +++ b/ui/dist/assets/AuthMethodsDocs-932fac77.js @@ -1,4 +1,4 @@ -import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-7d33ef4c.js";import{S as Ke}from"./SdkTabs-f0532e58.js";import{F as qe}from"./FieldsQueryParam-f6b769d1.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` +import{S as Se,i as ye,s as Te,O as G,e as c,w,b as k,c as se,f as p,g as d,h as a,m as ae,x as U,P as ve,Q as je,k as Ae,R as Be,n as Oe,t as W,a as V,o as u,d as ne,C as Fe,p as Qe,r as L,u as Ne,N as He}from"./index-6c8f1731.js";import{S as Ke}from"./SdkTabs-821a5c7e.js";import{F as qe}from"./FieldsQueryParam-2d478986.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Pe(n,l,o){const s=n.slice();return s[5]=l[o],s}function $e(n,l){let o,s=l[5].code+"",_,f,i,h;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=c("button"),_=w(s),f=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(v,C){d(v,o,C),a(o,_),a(o,f),i||(h=Ne(o,"click",m),i=!0)},p(v,C){l=v,C&4&&s!==(s=l[5].code+"")&&U(_,s),C&6&&L(o,"active",l[1]===l[5].code)},d(v){v&&u(o),i=!1,h()}}}function Me(n,l){let o,s,_,f;return s=new He({props:{content:l[5].body}}),{key:n,first:null,c(){o=c("div"),se(s.$$.fragment),_=k(),p(o,"class","tab-item"),L(o,"active",l[1]===l[5].code),this.first=o},m(i,h){d(i,o,h),ae(s,o,null),a(o,_),f=!0},p(i,h){l=i;const m={};h&4&&(m.content=l[5].body),s.$set(m),(!f||h&6)&&L(o,"active",l[1]===l[5].code)},i(i){f||(W(s.$$.fragment,i),f=!0)},o(i){V(s.$$.fragment,i),f=!1},d(i){i&&u(o),ne(s)}}}function ze(n){var be,ke;let l,o,s=n[0].name+"",_,f,i,h,m,v,C,H=n[0].name+"",E,ie,I,P,J,j,Y,$,K,ce,q,A,re,R,z=n[0].name+"",X,de,Z,B,x,M,ee,ue,te,T,le,O,oe,S,F,g=[],he=new Map,me,Q,b=[],fe=new Map,y;P=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/AuthRefreshDocs-335aea06.js b/ui/dist/assets/AuthRefreshDocs-cba47500.js similarity index 97% rename from ui/dist/assets/AuthRefreshDocs-335aea06.js rename to ui/dist/assets/AuthRefreshDocs-cba47500.js index 485247e7..50efd378 100644 --- a/ui/dist/assets/AuthRefreshDocs-335aea06.js +++ b/ui/dist/assets/AuthRefreshDocs-cba47500.js @@ -1,4 +1,4 @@ -import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-7d33ef4c.js";import{S as Ze}from"./SdkTabs-f0532e58.js";import{F as et}from"./FieldsQueryParam-f6b769d1.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,z,ue,Q,q,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` +import{S as je,i as xe,s as Je,N as Ue,O as J,e as s,w as k,b as p,c as K,f as b,g as d,h as o,m as I,x as de,P as Ee,Q as Ke,k as Ie,R as We,n as Ge,t as N,a as V,o as u,d as W,C as Le,p as Xe,r as G,u as Ye}from"./index-6c8f1731.js";import{S as Ze}from"./SdkTabs-821a5c7e.js";import{F as et}from"./FieldsQueryParam-2d478986.js";function Ne(r,l,a){const n=r.slice();return n[5]=l[a],n}function Ve(r,l,a){const n=r.slice();return n[5]=l[a],n}function ze(r,l){let a,n=l[5].code+"",m,_,i,h;function g(){return l[4](l[5])}return{key:r,first:null,c(){a=s("button"),m=k(n),_=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(v,w){d(v,a,w),o(a,m),o(a,_),i||(h=Ye(a,"click",g),i=!0)},p(v,w){l=v,w&4&&n!==(n=l[5].code+"")&&de(m,n),w&6&&G(a,"active",l[1]===l[5].code)},d(v){v&&u(a),i=!1,h()}}}function Qe(r,l){let a,n,m,_;return n=new Ue({props:{content:l[5].body}}),{key:r,first:null,c(){a=s("div"),K(n.$$.fragment),m=p(),b(a,"class","tab-item"),G(a,"active",l[1]===l[5].code),this.first=a},m(i,h){d(i,a,h),I(n,a,null),o(a,m),_=!0},p(i,h){l=i;const g={};h&4&&(g.content=l[5].body),n.$set(g),(!_||h&6)&&G(a,"active",l[1]===l[5].code)},i(i){_||(N(n.$$.fragment,i),_=!0)},o(i){V(n.$$.fragment,i),_=!1},d(i){i&&u(a),W(n)}}}function tt(r){var De,Fe;let l,a,n=r[0].name+"",m,_,i,h,g,v,w,M,X,S,z,ue,Q,q,pe,Y,U=r[0].name+"",Z,he,fe,j,ee,D,te,T,oe,be,F,C,le,me,ae,_e,f,ke,R,ge,ve,$e,se,ye,ne,Se,we,Te,re,Ce,Pe,A,ie,O,ce,P,H,y=[],Re=new Map,Ae,E,$=[],Be=new Map,B;v=new Ze({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${r[3]}'); diff --git a/ui/dist/assets/AuthWithOAuth2Docs-a6296efb.js b/ui/dist/assets/AuthWithOAuth2Docs-c73de73c.js similarity index 98% rename from ui/dist/assets/AuthWithOAuth2Docs-a6296efb.js rename to ui/dist/assets/AuthWithOAuth2Docs-c73de73c.js index aa4d4859..c6ecfd51 100644 --- a/ui/dist/assets/AuthWithOAuth2Docs-a6296efb.js +++ b/ui/dist/assets/AuthWithOAuth2Docs-c73de73c.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-7d33ef4c.js";import{S as Xe}from"./SdkTabs-f0532e58.js";import{F as Ye}from"./FieldsQueryParam-f6b769d1.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,J,be,N,R,me,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` +import{S as Ee,i as Je,s as Ne,N as Le,O as z,e as o,w as k,b as h,c as I,f as p,g as r,h as a,m as K,x as pe,P as Ue,Q as Qe,k as xe,R as ze,n as Ie,t as L,a as E,o as c,d as G,C as Be,p as Ke,r as X,u as Ge}from"./index-6c8f1731.js";import{S as Xe}from"./SdkTabs-821a5c7e.js";import{F as Ye}from"./FieldsQueryParam-2d478986.js";function Fe(s,l,n){const i=s.slice();return i[5]=l[n],i}function He(s,l,n){const i=s.slice();return i[5]=l[n],i}function je(s,l){let n,i=l[5].code+"",f,g,d,b;function _(){return l[4](l[5])}return{key:s,first:null,c(){n=o("button"),f=k(i),g=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(v,O){r(v,n,O),a(n,f),a(n,g),d||(b=Ge(n,"click",_),d=!0)},p(v,O){l=v,O&4&&i!==(i=l[5].code+"")&&pe(f,i),O&6&&X(n,"active",l[1]===l[5].code)},d(v){v&&c(n),d=!1,b()}}}function Ve(s,l){let n,i,f,g;return i=new Le({props:{content:l[5].body}}),{key:s,first:null,c(){n=o("div"),I(i.$$.fragment),f=h(),p(n,"class","tab-item"),X(n,"active",l[1]===l[5].code),this.first=n},m(d,b){r(d,n,b),K(i,n,null),a(n,f),g=!0},p(d,b){l=d;const _={};b&4&&(_.content=l[5].body),i.$set(_),(!g||b&6)&&X(n,"active",l[1]===l[5].code)},i(d){g||(L(i.$$.fragment,d),g=!0)},o(d){E(i.$$.fragment,d),g=!1},d(d){d&&c(n),G(i)}}}function Ze(s){let l,n,i=s[0].name+"",f,g,d,b,_,v,O,P,Y,A,J,be,N,R,me,Z,Q=s[0].name+"",ee,fe,te,M,ae,W,le,U,ne,S,oe,ge,B,y,se,ke,ie,_e,m,ve,C,we,$e,Oe,re,Ae,ce,Se,ye,Te,de,Ce,qe,q,ue,F,he,T,H,$=[],De=new Map,Pe,j,w=[],Re=new Map,D;v=new Xe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[3]}'); diff --git a/ui/dist/assets/AuthWithPasswordDocs-107160ee.js b/ui/dist/assets/AuthWithPasswordDocs-0a927386.js similarity index 98% rename from ui/dist/assets/AuthWithPasswordDocs-107160ee.js rename to ui/dist/assets/AuthWithPasswordDocs-0a927386.js index 3d720289..53e9b639 100644 --- a/ui/dist/assets/AuthWithPasswordDocs-107160ee.js +++ b/ui/dist/assets/AuthWithPasswordDocs-0a927386.js @@ -1,4 +1,4 @@ -import{S as we,i as ye,s as $e,N as ve,O as ot,e as n,w as p,b as d,c as nt,f as m,g as r,h as e,m as st,x as Dt,P as pe,Q as Pe,k as Re,R as Ce,n as Oe,t as Z,a as x,o as c,d as it,C as fe,p as Ae,r as rt,u as Te}from"./index-7d33ef4c.js";import{S as Ue}from"./SdkTabs-f0532e58.js";import{F as Me}from"./FieldsQueryParam-f6b769d1.js";function he(s,l,a){const i=s.slice();return i[8]=l[a],i}function be(s,l,a){const i=s.slice();return i[8]=l[a],i}function De(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Ee(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function We(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function me(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _e(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ke(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ge(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),e(a,g),e(a,b),f||(u=Te(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Dt(g,i),C&24&&rt(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function Se(s,l){let a,i,g,b;return i=new ve({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),nt(i.$$.fragment),g=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),st(i,a,null),e(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&rt(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),it(i)}}}function Le(s){var re,ce;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Et,ct,T,dt,N,ut,U,tt,Wt,et,I,Lt,pt,lt=s[0].name+"",ft,Bt,ht,V,bt,M,mt,qt,Q,D,_t,Ft,kt,Ht,$,Yt,gt,St,vt,Nt,wt,yt,j,$t,E,Pt,It,J,W,Rt,Vt,Ct,Qt,k,jt,q,Jt,Kt,zt,Ot,Gt,At,Xt,Zt,xt,Tt,te,ee,F,Ut,K,Mt,L,z,A=[],le=new Map,ae,G,S=[],oe=new Map,H;function ne(t,o){if(t[1]&&t[2])return We;if(t[1])return Ee;if(t[2])return De}let Y=ne(s),P=Y&&Y(s);T=new Ue({props:{js:` +import{S as we,i as ye,s as $e,N as ve,O as ot,e as n,w as p,b as d,c as nt,f as m,g as r,h as e,m as st,x as Dt,P as pe,Q as Pe,k as Re,R as Ce,n as Oe,t as Z,a as x,o as c,d as it,C as fe,p as Ae,r as rt,u as Te}from"./index-6c8f1731.js";import{S as Ue}from"./SdkTabs-821a5c7e.js";import{F as Me}from"./FieldsQueryParam-2d478986.js";function he(s,l,a){const i=s.slice();return i[8]=l[a],i}function be(s,l,a){const i=s.slice();return i[8]=l[a],i}function De(s){let l;return{c(){l=p("email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function Ee(s){let l;return{c(){l=p("username")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function We(s){let l;return{c(){l=p("username/email")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function me(s){let l;return{c(){l=n("strong"),l.textContent="username"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function _e(s){let l;return{c(){l=p("or")},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ke(s){let l;return{c(){l=n("strong"),l.textContent="email"},m(a,i){r(a,l,i)},d(a){a&&c(l)}}}function ge(s,l){let a,i=l[8].code+"",g,b,f,u;function _(){return l[7](l[8])}return{key:s,first:null,c(){a=n("button"),g=p(i),b=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(R,C){r(R,a,C),e(a,g),e(a,b),f||(u=Te(a,"click",_),f=!0)},p(R,C){l=R,C&16&&i!==(i=l[8].code+"")&&Dt(g,i),C&24&&rt(a,"active",l[3]===l[8].code)},d(R){R&&c(a),f=!1,u()}}}function Se(s,l){let a,i,g,b;return i=new ve({props:{content:l[8].body}}),{key:s,first:null,c(){a=n("div"),nt(i.$$.fragment),g=d(),m(a,"class","tab-item"),rt(a,"active",l[3]===l[8].code),this.first=a},m(f,u){r(f,a,u),st(i,a,null),e(a,g),b=!0},p(f,u){l=f;const _={};u&16&&(_.content=l[8].body),i.$set(_),(!b||u&24)&&rt(a,"active",l[3]===l[8].code)},i(f){b||(Z(i.$$.fragment,f),b=!0)},o(f){x(i.$$.fragment,f),b=!1},d(f){f&&c(a),it(i)}}}function Le(s){var re,ce;let l,a,i=s[0].name+"",g,b,f,u,_,R,C,O,B,Et,ct,T,dt,N,ut,U,tt,Wt,et,I,Lt,pt,lt=s[0].name+"",ft,Bt,ht,V,bt,M,mt,qt,Q,D,_t,Ft,kt,Ht,$,Yt,gt,St,vt,Nt,wt,yt,j,$t,E,Pt,It,J,W,Rt,Vt,Ct,Qt,k,jt,q,Jt,Kt,zt,Ot,Gt,At,Xt,Zt,xt,Tt,te,ee,F,Ut,K,Mt,L,z,A=[],le=new Map,ae,G,S=[],oe=new Map,H;function ne(t,o){if(t[1]&&t[2])return We;if(t[1])return Ee;if(t[2])return De}let Y=ne(s),P=Y&&Y(s);T=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${s[6]}'); diff --git a/ui/dist/assets/CodeEditor-c4a370cf.js b/ui/dist/assets/CodeEditor-c4a370cf.js new file mode 100644 index 00000000..778168c6 --- /dev/null +++ b/ui/dist/assets/CodeEditor-c4a370cf.js @@ -0,0 +1,14 @@ +import{S as ft,i as gt,s as mt,e as Pt,f as Zt,U as K,g as bt,y as ze,o as Xt,J as xt,K as Yt,L as yt,I as kt,C as wt,M as vt}from"./index-6c8f1731.js";import{P as Tt,N as _t,u as Wt,D as Ut,v as we,T as ee,I as ve,w as D,x as n,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as V,J as bO,K as XO,M as xO,E as U,O as YO,Q as P,R as Rt,U as qt,V as yO,W as jt,X as Vt,a as z,h as zt,b as Gt,c as At,d as Et,e as It,s as Nt,t as Bt,f as Dt,g as Jt,r as Lt,i as Ft,k as Mt,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as Ge,C as H}from"./index-102ce751.js";class re{constructor(e,a,t,r,s,i,l,o,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=o,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new re(e,[],a,t,t,0,[],0,r?new Ae(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,o)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new re(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new ra(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;so&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let o=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],o,!1)>=0)return l<<19|65536|o}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ae{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class ra{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class ie{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new ie(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ie(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class Oe{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ee=new Oe;class ia{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ee,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ee,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;kO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class se{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(kO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}se.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class x{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function kO(O,e,a,t,r,s){let i=0,l=1<0){let u=O[p];if(o.allows(u)&&(e.token.value==-1||e.token.value==u||sa(u,e.token.value,r,s))){e.acceptToken(u);break}}let d=e.next,c=0,S=O[i+2];if(e.next<0&&S>c&&O[Q+S*3-3]==65535){i=O[Q+S*3-1];continue e}for(;c>1,u=Q+p+(p<<1),f=O[u],g=O[u+1]||65536;if(d=g)c=p+1;else{i=O[u+2],e.advance();continue e}}break}}function Ie(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function sa(O,e,a,t){let r=Ie(a,t,e);return r<0||Ie(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class la{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ne(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ne(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof ee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class na{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Oe)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let S=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>S))break}}for(;this.actions.length>a;)this.actions.pop();return o&&e.setLookAhead(o),!t&&e.pos==this.stream.end&&(t=new Oe,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new Oe,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,e))continue;{r||(r=[],s=[]),r.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!t.length){let i=r&&Qa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,o)=>o.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(o--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let S=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(S>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,S),Z&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof ee&&c.positions[0]==0)c=p;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let Q=0;Qr?a.push(u):t.push(u)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Be(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),S=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(S+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(S=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,o=0),l.recoverByDelete(o,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),Be(l,t)):(!r||r.scoreO;class wO{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Tt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(d,o,l[Q++]);else{let c=l[Q+-d];for(let S=-d;S>0;S--)s(l[Q++],o,c);Q++}}}this.nodeSet=new _t(a.map((l,o)=>Wt.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:t.indexOf(o)>-1,error:o==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Ut;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new R(i,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new oa(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,o=r[s++];if(l&&t)return o;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;r=a(k(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=De(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const pa=54,da=1,ha=55,ua=2,Sa=56,$a=3,Je=4,fa=5,le=6,vO=7,TO=8,_O=9,WO=10,ga=11,ma=12,Pa=13,ue=57,Za=14,Le=58,UO=20,ba=22,CO=23,Xa=24,Xe=26,RO=27,xa=28,Ya=31,ya=34,ka=36,wa=37,va=0,Ta=1,_a={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Fe={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ua(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function qO(O){return O==9||O==10||O==13||O==32}let Me=null,Ke=null,He=0;function xe(O,e){let a=O.pos+e;if(He==a&&Ke==O)return Me;let t=O.peek(e);for(;qO(t);)t=O.peek(++e);let r="";for(;Ua(t);)r+=String.fromCharCode(t),t=O.peek(++e);return Ke=O,He=a,Me=r?r.toLowerCase():t==Ca||t==Ra?void 0:null}const jO=60,ne=62,_e=47,Ca=63,Ra=33,qa=45;function eO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new eO(xe(t,1)||"",O):O},reduce(O,e){return e==UO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==le||r==ka?new eO(xe(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new x((O,e)=>{if(O.next!=jO){O.next<0&&e.context&&O.acceptToken(ue);return}O.advance();let a=O.next==_e;a&&O.advance();let t=xe(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Za:le);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ga);if(r&&Wa[r])return O.acceptToken(ue,-2);if(e.dialectEnabled(va))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Pa)}else{if(t=="script")return O.acceptToken(vO);if(t=="style")return O.acceptToken(TO);if(t=="textarea")return O.acceptToken(_O);if(_a.hasOwnProperty(t))return O.acceptToken(WO);r&&Fe[r]&&Fe[r][t]?O.acceptToken(ue,-1):O.acceptToken(le)}},{contextual:!0}),Ga=new x(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Le);break}if(O.next==qa)e++;else if(O.next==ne&&e>=2){a>=3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Aa(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Ea=new x((O,e)=>{if(O.next==_e&&O.peek(1)==ne){let a=e.dialectEnabled(Ta)||Aa(e.context);O.acceptToken(a?fa:Je,2)}else O.next==ne&&O.acceptToken(Je,1)});function We(O,e,a){let t=2+O.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==jO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ia=We("script",pa,da),Na=We("style",ha,ua),Ba=We("textarea",Sa,$a),Da=D({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),Ja=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:Va,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Da],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==xa)return Se(l,o,a);if(Q==Ya)return Se(l,o,t);if(Q==ya)return Se(l,o,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,S=c&&OO(c,o),p;if(S){for(let u of s)if(u.tag==S&&(!u.attrs||u.attrs(p||(p=VO(d,o))))){let f=d.lastChild,g=f.type.id==wa?f.from:d.to;if(g>c.to)return{parser:u.parser,overlay:[{from:c.to,to:g}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let S=i[o.read(c.from,c.to)];if(S)for(let p of S){if(p.tagName&&p.tagName!=OO(d.parent,o))continue;let u=d.lastChild;if(u.type.id==Xe){let f=u.from+1,g=u.lastChild,X=u.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(u.type.id==RO)return{parser:p.parser,overlay:[{from:u.from,to:u.to}]}}}}return null})}const La=96,tO=1,Fa=97,Ma=98,aO=2,GO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ka=58,Ha=40,AO=95,er=91,te=45,Or=46,tr=35,ar=37,rr=38,ir=92,sr=10;function oe(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function lr(O){return O>=48&&O<=57}const nr=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(oe(s)||s==te||s==AO||a&&lr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else if(s==ir&&O.peek(1)!=sr)O.advance(),O.next>-1&&O.advance(),a=!0;else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),or=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(oe(e)||e==AO||e==tr||e==Or||e==er||e==Ka||e==te||e==rr)&&O.acceptToken(La)}}),cr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),oe(e)){do O.advance();while(oe(O.next));O.acceptToken(tO)}}}),Qr=D({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),pr={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},dr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},hr={__proto__:null,not:128,only:128},ur=T.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[or,cr,nr,1,2,3,4,new se("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>pr[O]||-1},{term:56,get:O=>dr[O]||-1},{term:98,get:O=>hr[O]||-1}],tokenPrec:1169});let $e=null;function fe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const rO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),iO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),Sr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),v=/^(\w[\w-]*|-\w[\w-]*|)$/,$r=/^-(-[\w-]*)?$/;function fr(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const sO=new bO,gr=["Declaration"];function mr(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function EO(O,e,a){if(e.to-e.from>4096){let t=sO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let l of EO(O,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return sO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(gr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=O.sliceString(s.from,s.to);r.has(l)||(r.add(l),t.push({label:l,type:"variable"}))}}),t}}const Pr=O=>e=>{let{state:a,pos:t}=e,r=V(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:fe(),validFor:v};if(r.name=="ValueName")return{from:r.from,options:iO,validFor:v};if(r.name=="PseudoClassName")return{from:r.from,options:rO,validFor:v};if(O(r)||(e.explicit||s)&&fr(r,a.doc))return{from:O(r)||s?r.from:t,options:EO(a.doc,mr(r),O),validFor:$r};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:Sr,validFor:v}}if(!e.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:rO,validFor:v}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:iO,validFor:v}:i.name=="Block"||i.name=="Styles"?{from:t,options:fe(),validFor:v}:null},Zr=Pr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:ur.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function br(){return new M(ce,ce.data.of({autocomplete:Zr}))}const Xr=304,lO=1,xr=2,Yr=305,yr=307,kr=308,wr=3,vr=4,Tr=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],IO=125,_r=59,nO=47,Wr=42,Ur=43,Cr=45,Rr=new wO({start:!1,shift(O,e){return e==wr||e==vr||e==yr?O:e==kr},strict:!1}),qr=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(Yr)},{contextual:!0,fallback:!0}),jr=new x((O,e)=>{let{next:a}=O,t;Tr.indexOf(a)>-1||a==nO&&((t=O.peek(1))==nO||t==Wr)||a!=IO&&a!=_r&&a!=-1&&!e.context&&O.acceptToken(Xr)},{contextual:!0}),Vr=new x((O,e)=>{let{next:a}=O;if((a==Ur||a==Cr)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:xr)}},{contextual:!0}),zr=D({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const using function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),Gr={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},Ar={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},Er={__proto__:null,"<":139},Ir=T.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-ElOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-ExQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AfQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AnQSO,5=sO!AsQSO,5=sO!AxQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BWQWO,5=`O!B`Q,UO,5=aO!BkQSO,5=cO!BpQ`O,5=fO!BxQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!B}QSO'#HRO9{Q,UO'#HTO!CSQSO'#HTOOQQ,5=i,5=iO!CXQSO'#HUO!CjQSO'#CmO!CoQSO,58}O!CyQSO,58}O!FOQUO,58}OOQQ,58},58}O!F`Q(C[O,58}O%[QUO,58}O!HkQUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!IRQSO,5=uO`QUO,5={O`QUO,5=}O!IWQSO,5>PO`QUO,5>RO!I]QSO,5>UO!IbQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!MlQSO,5>fOOQQ,5>h,5>hO!MlQSO,5>hOOQQ,5>j,5>jO!MqQWO'#DYO%[QUO'#JiO!N`QWO'#JiO!N}QWO'#DhO# `QWO'#DhO##qQUO'#DhO##xQSO'#JhO#$QQSO,5:RO#$VQSO'#EnO#$eQSO'#JvO#$mQSO,5;XO#$rQWO'#DhO#%PQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#%WQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%`QSO,5@TO#%eQ!LQO,5:pOOQO-E<_-E<_O#&kQ(C`O,5:{OChQWO,5:oO#&uQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#'SQ(C[O,5:{O#'_Q(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'mQ(C[O,5:{POOO'#IU'#IUP#(RO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(mQUO'#I[OOQO-EWQ(CjO1G0yO#>_Q(CjO1G0yO#@VQ(CjO1G0yO#CVQ$IUO'#CgO#ETQ$IUO1G1[O#E[Q$IUO'#JfO!,YQSO1G1bO#ElQ(CjO,5?SOOQ(CW-EeQSO1G3kO$.fQUO1G3mO$2jQUO'#HlOOQQ1G3p1G3pO$2wQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$3PQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$7WQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$7]Q$IUO,5:SOOQO,5;Y,5;YO$7gQWO'#I]O$7}QSO,5@SOOQ(CY1G/m1G/mO$8VQWO'#IcO$8aQSO,5@bOOQ(CW1G0s1G0sO# `QWO,5:SOOQO'#I`'#I`O$8iQWO,5:nOOQ(CY,5:n,5:nO#%ZQSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8pQ(C[O1G0gO$8{Q(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$9ZQ(C[O1G0gOOQO1G0Z1G0ZO$9oQ(CjO1G0gPOOO-EvO$:]QSO1G5mO$:eQSO1G5zO$:mQbO1G5{O9TQSO,5>|O$:wQ(CjO1G5xO%[QUO1G5xO$;XQ(C[O1G5xO$;jQSO1G5wO$;jQSO1G5wO9TQSO1G5wO$;rQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$WOOQQ,5>W,5>WO%[QUO'#HmO%(vQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%({QWO1G5oO%)aQ$IUO1G0tO%)kQSO1G0tOOQO1G/n1G/nO%)vQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9oQ(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%*QQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%*]Q(C[O7+&RO%*kQ(CjO7++dO%[QUO7++dO%*{QSO7++cO%*{QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%+TQSO1G4kOOQO7+%z7+%zO#%ZQSO<xOOQO-E<[-E<[O%2yQbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%3TQSO1G5qOOQ(CY<tQ$IUO1G0yO%>{Q$IUO1G0yO%@sQ$IUO1G0yO%AWQ(CjO<XOOQQ,5>Z,5>ZO& PQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO& UQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&6mQSO<{AN>{O%[QUOAN?XOOQO<PQSO7+*ZO&>[QSO<= ZO&>dQ`O7+*]OOQ(CW<nQ`O<uQSO<= dOOQQG27kG27kO9eQ(C[OG27kO!*SQUO1G4vO&>}QSO7++uO%MbQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&?VQSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#NWQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&?_QSOANBTOOQQ<fOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#APOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#C^O#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,sO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#C^O!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,sO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,sO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ tOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!jOz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#]O#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$zOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O`0gO'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+sO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#C^Om!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ tO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!jO#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#]O#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,sO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#C^O#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,sO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,sOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$J]Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$KOO(d$ZO~P#,sO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,sO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,sO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O`4`O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,sO!Y$|O~P#,sO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%%QOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O`5TO'v#mO'xTO'{UO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#C^O#Y5lO!W#bi!X#bi~O!W![i!X![i~P#C^O_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$J]O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$KOO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,sOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#C^OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%3jO#h9zO~P%3jOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5uOl9|O~P%5uOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%8QOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%8QOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:lO(k#|O~P%:lOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%yP?^P?^PPP?^PAOP?^P?^P?^PASPPAXPArPFjPPPFnPPPPFnIoPPPIuJpPFnPMOPPPP! ^FnPPPFnPFnP!#lFnP!'Q!(S!(]P!)P!)T!)PPPPPP!,`!(SPP!,|!-vP!0jFnFn!0o!3y!8`!8`!}P#@^#@e#@mPPPP#D{#Gr#NZ#N^#Na$ Y$ ]$ `$ g$ oPP$ u$ y$!q$#p$#t$$YPP$$^$$d$$hP$$k$$o$$r$%h$&P$&h$&l$&o$&r$&x$&{$'P$'TR!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ,T&^Q/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5T1VQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:Rr,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[zr],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Gr[O]||-1},{term:330,get:O=>Ar[O]||-1},{term:68,get:O=>Er[O]||-1}],tokenPrec:12868}),NO=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { + \${} +} catch (\${error}) { + \${} +}`,{label:"try",detail:"/ catch block",type:"keyword"}),P("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),P(`if (\${}) { + \${} +} else { + \${} +}`,{label:"if",detail:"/ else block",type:"keyword"}),P(`class \${name} { + constructor(\${params}) { + \${} + } +}`,{label:"class",detail:"definition",type:"keyword"}),P('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),P('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Nr=NO.concat([P("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),P("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),P("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),oO=new bO,BO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function G(O){return(e,a)=>{let t=e.node.getChild("VariableDefinition");return t&&a(t,O),!0}}const Br=["FunctionDeclaration"],Dr={FunctionDeclaration:G("function"),ClassDeclaration:G("class"),ClassExpression:()=>!0,EnumDeclaration:G("constant"),TypeAliasDeclaration:G("type"),NamespaceDeclaration:G("namespace"),VariableDefinition(O,e){O.matchContext(Br)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function DO(O,e){let a=oO.get(e);if(a)return a;let t=[],r=!0;function s(i,l){let o=O.sliceString(i.from,i.to);t.push({label:o,type:l})}return e.cursor(ve.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let l=Dr[i.name];if(l&&l(i,s)||BO.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of DO(O,i.node))t.push(l);return!1}}),oO.set(e,t),t}const cO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,JO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Jr(O){let e=V(O.state).resolveInner(O.pos,-1);if(JO.indexOf(e.name)>-1)return null;let a=e.name=="VariableName"||e.to-e.from<20&&cO.test(O.state.sliceDoc(e.from,e.to));if(!a&&!O.explicit)return null;let t=[];for(let r=e;r;r=r.parent)BO.has(r.name)&&(t=t.concat(DO(O.state.doc,r)));return{options:t,from:a?e.from:O.pos,validFor:cO}}const Y=J.define({name:"javascript",parser:Ir.configure({props:[L.add({IfStatement:C({except:/^\s*({|else\b)/}),TryStatement:C({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Rt,SwitchBody:O=>{let e=O.textAfter,a=/^\s*\}/.test(e),t=/^\s*(case|default)\b/.test(e);return O.baseIndent+(a?0:t?1:2)*O.unit},Block:qt({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":C({except:/^{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),F.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Te,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),LO={test:O=>/^JSX/.test(O.name),facet:jt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},FO=Y.configure({dialect:"ts"},"typescript"),MO=Y.configure({dialect:"jsx",props:[yO.add(O=>O.isTop?[LO]:void 0)]}),KO=Y.configure({dialect:"jsx ts",props:[yO.add(O=>O.isTop?[LO]:void 0)]},"typescript");let HO=O=>({label:O,type:"keyword"});const et="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(HO),Lr=et.concat(["declare","implements","private","protected","public"].map(HO));function Ot(O={}){let e=O.jsx?O.typescript?KO:MO:O.typescript?FO:Y,a=O.typescript?Nr.concat(Lr):NO.concat(et);return new M(e,[Y.data.of({autocomplete:XO(JO,xO(a))}),Y.data.of({autocomplete:Jr}),O.jsx?Kr:[]])}function Fr(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function QO(O,e,a=O.length){for(let t=e==null?void 0:e.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return O.sliceString(t.from,Math.min(t.to,a));return""}const Mr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Kr=U.inputHandler.of((O,e,a,t,r)=>{if((Mr?O.composing:O.compositionStarted)||O.state.readOnly||e!=a||t!=">"&&t!="/"||!Y.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var Q;let{head:d}=o,c=V(i).resolveInner(d-1,-1),S;if(c.name=="JSXStartTag"&&(c=c.parent),!(i.doc.sliceString(d-1,d)!=t||c.name=="JSXAttributeValue"&&c.to>d)){if(t==">"&&c.name=="JSXFragmentTag")return{range:o,changes:{from:d,insert:""}};if(t=="/"&&c.name=="JSXStartCloseTag"){let p=c.parent,u=p.parent;if(u&&p.from==d-2&&((S=QO(i.doc,u.firstChild,d))||((Q=u.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let f=`${S}>`;return{range:YO.cursor(d+f.length,-1),changes:{from:d,insert:f}}}}else if(t==">"){let p=Fr(c);if(p&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(S=QO(i.doc,p,d)))return{range:o,changes:{from:d,insert:``}}}}return{range:o}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),A=["_blank","_self","_top","_parent"],ge=["ascii","utf-8","utf-16","latin1","latin1"],me=["get","post","put","delete"],Pe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],h={},Hr={a:{attrs:{href:null,ping:null,type:null,media:null,target:A,hreflang:null}},abbr:h,address:h,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:h,aside:h,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:h,base:{attrs:{href:null,target:A}},bdi:h,bdo:h,blockquote:{attrs:{cite:null}},body:h,br:h,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:A,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:h,center:h,cite:h,code:h,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:h,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:h,div:h,dl:h,dt:h,em:h,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:h,figure:h,footer:h,form:{attrs:{action:null,name:null,"accept-charset":ge,autocomplete:["on","off"],enctype:Pe,method:me,novalidate:["novalidate"],target:A}},h1:h,h2:h,h3:h,h4:h,h5:h,h6:h,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:h,hgroup:h,hr:h,html:{attrs:{manifest:null}},i:h,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:A,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:h,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:h,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:h,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ge,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:h,noscript:h,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:h,param:{attrs:{name:null,value:null}},pre:h,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:h,rt:h,ruby:h,samp:h,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ge}},section:h,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:h,source:{attrs:{src:null,type:null,media:null}},span:h,strong:h,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:h,summary:h,sup:h,table:h,tbody:h,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:h,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:h,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:h,time:{attrs:{datetime:null}},title:h,tr:h,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:h,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:h},tt={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},at="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(O=>"on"+O);for(let O of at)tt[O]=null;class Qe{constructor(e,a){this.tags=Object.assign(Object.assign({},Hr),e),this.globalAttrs=Object.assign(Object.assign({},tt),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Qe.default=new Qe;function q(O,e,a=O.length){if(!e)return"";let t=e.firstChild,r=t&&t.getChild("TagName");return r?O.sliceString(r.from,Math.min(r.to,a)):""}function j(O,e=!1){for(;O;O=O.parent)if(O.name=="Element")if(e)e=!1;else return O;return null}function rt(O,e,a){let t=a.tags[q(O,j(e))];return(t==null?void 0:t.children)||a.allTags}function Ue(O,e){let a=[];for(let t=j(e);t&&!t.type.isTop;t=j(t.parent)){let r=q(O,t);if(r&&t.lastChild.name=="CloseTag")break;r&&a.indexOf(r)<0&&(e.name=="EndTag"||e.from>=t.firstChild.to)&&a.push(r)}return a}const it=/^[:\-\.\w\u00b7-\uffff]*$/;function pO(O,e,a,t,r){let s=/\s*>/.test(O.sliceDoc(r,r+5))?"":">",i=j(a,!0);return{from:t,to:r,options:rt(O.doc,i,e).map(l=>({label:l,type:"type"})).concat(Ue(O.doc,a).map((l,o)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-o}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function dO(O,e,a,t){let r=/\s*>/.test(O.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:Ue(O.doc,e).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:it}}function ei(O,e,a,t){let r=[],s=0;for(let i of rt(O.doc,a,e))r.push({label:"<"+i,type:"type"});for(let i of Ue(O.doc,a))r.push({label:"",type:"type",boost:99-s++});return{from:t,to:t,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Oi(O,e,a,t,r){let s=j(a),i=s?e.tags[q(O.doc,s)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],o=i&&i.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:t,to:r,options:o.map(Q=>({label:Q,type:"property"})),validFor:it}}function ti(O,e,a,t,r){var s;let i=(s=a.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],o;if(i){let Q=O.sliceDoc(i.from,i.to),d=e.globalAttrs[Q];if(!d){let c=j(a),S=c?e.tags[q(O.doc,c)]:null;d=(S==null?void 0:S.attrs)&&S.attrs[Q]}if(d){let c=O.sliceDoc(t,r).toLowerCase(),S='"',p='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,S="",p=O.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let u of d)l.push({label:u,apply:S+u+p,type:"constant"})}}return{from:t,to:r,options:l,validFor:o}}function ai(O,e){let{state:a,pos:t}=e,r=V(a).resolveInner(t,-1),s=r.resolve(t);for(let i=t,l;s==r&&(l=r.childBefore(i));){let o=l.lastChild;if(!o||!o.type.isError||o.fromai(t,r)}const ii=Y.parser.configure({top:"SingleExpression"}),st=[{tag:"script",attrs:O=>O.type=="text/typescript"||O.lang=="ts",parser:FO.parser},{tag:"script",attrs:O=>O.type=="text/babel"||O.type=="text/jsx",parser:MO.parser},{tag:"script",attrs:O=>O.type=="text/typescript-jsx",parser:KO.parser},{tag:"script",attrs:O=>O.type=="importmap"||O.type=="speculationrules",parser:ii},{tag:"script",attrs(O){return!O.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(O.type)},parser:Y.parser},{tag:"style",attrs(O){return(!O.lang||O.lang=="css")&&(!O.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(O.type))},parser:ce.parser}],lt=[{name:"style",parser:ce.parser.configure({top:"Styles"})}].concat(at.map(O=>({name:O,parser:Y.parser}))),nt=J.define({name:"html",parser:Ja.configure({props:[L.add({Element(O){let e=/^(\s*)(<\/)?/.exec(O.textAfter);return O.node.to<=O.pos+e[0].length?O.continue():O.lineIndent(O.node.from)+(e[2]?0:O.unit)},"OpenTag CloseTag SelfClosingTag"(O){return O.column(O.node.from)+O.unit},Document(O){if(O.pos+/\s*/.exec(O.textAfter)[0].lengthO.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ae=nt.configure({wrap:zO(st,lt)});function si(O={}){let e="",a;O.matchClosingTags===!1&&(e="noMatch"),O.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(a=zO((O.nestedLanguages||[]).concat(st),(O.nestedAttributes||[]).concat(lt)));let t=a?nt.configure({wrap:a,dialect:e}):e?ae.configure({dialect:e}):ae;return new M(t,[ae.data.of({autocomplete:ri(O)}),O.autoCloseTags!==!1?li:[],Ot().support,br().support])}const hO=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),li=U.inputHandler.of((O,e,a,t,r)=>{if(O.composing||O.state.readOnly||e!=a||t!=">"&&t!="/"||!ae.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var Q,d,c;let S=i.doc.sliceString(o.from-1,o.to)==t,{head:p}=o,u=V(i).resolveInner(p-1,-1),f;if((u.name=="TagName"||u.name=="StartTag")&&(u=u.parent),S&&t==">"&&u.name=="OpenTag"){if(((d=(Q=u.parent)===null||Q===void 0?void 0:Q.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(f=q(i.doc,u.parent,p))&&!hO.has(f)){let g=p+(i.doc.sliceString(p,p+1)===">"?1:0),X=``;return{range:o,changes:{from:p,to:g,insert:X}}}}else if(S&&t=="/"&&u.name=="IncompleteCloseTag"){let g=u.parent;if(u.from==p-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(f=q(i.doc,g,p))&&!hO.has(f)){let X=p+(i.doc.sliceString(p,p+1)===">"?1:0),y=`${f}>`;return{range:YO.cursor(p+y.length,-1),changes:{from:p,to:X,insert:y}}}}return{range:o}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),ni=D({String:n.string,Number:n.number,"True False":n.bool,PropertyName:n.propertyName,Null:n.null,",":n.separator,"[ ]":n.squareBracket,"{ }":n.brace}),oi=T.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[ni],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),ci=J.define({name:"json",parser:oi.configure({props:[L.add({Object:C({except:/^\s*\}/}),Array:C({except:/^\s*\]/})}),F.add({"Object Array":Te})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Qi(){return new M(ci)}const pi=36,uO=1,di=2,E=3,Ze=4,hi=5,ui=6,Si=7,$i=8,fi=9,gi=10,mi=11,Pi=12,Zi=13,bi=14,Xi=15,xi=16,Yi=17,SO=18,yi=19,ot=20,ct=21,$O=22,ki=23,wi=24;function Ye(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function vi(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function W(O,e,a){for(let t=!1;;){if(O.next<0)return;if(O.next==e&&!t){O.advance();return}t=a&&!t&&O.next==92,O.advance()}}function Ti(O){for(;;){if(O.next<0||O.peek(1)<0)return;if(O.next==36&&O.peek(1)==36){O.advance(2);return}O.advance()}}function _i(O,e){let a="[{<(".indexOf(String.fromCharCode(e)),t=a<0?e:"]}>)".charCodeAt(a);for(;;){if(O.next<0)return;if(O.next==t&&O.peek(1)==39){O.advance(2);return}O.advance()}}function Qt(O,e){for(;!(O.next!=95&&!Ye(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function Wi(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),W(O,e,!1)}else Qt(O)}function fO(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function gO(O,e){for(;;){if(O.next==46){if(e)break;e=!0}else if(O.next<48||O.next>57)break;O.advance()}if(O.next==69||O.next==101)for(O.advance(),(O.next==43||O.next==45)&&O.advance();O.next>=48&&O.next<=57;)O.advance()}function mO(O){for(;!(O.next<0||O.next==10);)O.advance()}function _(O,e){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:pt(Ci,Ui)};function Ri(O,e,a,t){let r={};for(let s in ye)r[s]=(O.hasOwnProperty(s)?O:ye)[s];return e&&(r.words=pt(e,a||"",t)),r}function dt(O){return new x(e=>{var a;let{next:t}=e;if(e.advance(),_(t,be)){for(;_(e.next,be);)e.advance();e.acceptToken(pi)}else if(t==36&&e.next==36&&O.doubleDollarQuotedStrings)Ti(e),e.acceptToken(E);else if(t==39||t==34&&O.doubleQuotedStrings)W(e,t,O.backslashEscapes),e.acceptToken(E);else if(t==35&&O.hashComments||t==47&&e.next==47&&O.slashComments)mO(e),e.acceptToken(uO);else if(t==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))mO(e),e.acceptToken(uO);else if(t==47&&e.next==42){e.advance();for(let r=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(r--,e.advance(),!r)break}else s==47&&e.next==42&&(r++,e.advance())}e.acceptToken(di)}else if((t==101||t==69)&&e.next==39)e.advance(),W(e,39,!0);else if((t==110||t==78)&&e.next==39&&O.charSetCasts)e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(E);else if(t==95&&O.charSetCasts)for(let r=0;;r++){if(e.next==39&&r>1){e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(E);break}if(!Ye(e.next))break;e.advance()}else if(O.plsqlQuotingMechanism&&(t==113||t==81)&&e.next==39&&e.peek(1)>0&&!_(e.peek(1),be)){let r=e.peek(1);e.advance(2),_i(e,r),e.acceptToken(E)}else if(t==40)e.acceptToken(Si);else if(t==41)e.acceptToken($i);else if(t==123)e.acceptToken(fi);else if(t==125)e.acceptToken(gi);else if(t==91)e.acceptToken(mi);else if(t==93)e.acceptToken(Pi);else if(t==59)e.acceptToken(Zi);else if(O.unquotedBitLiterals&&t==48&&e.next==98)e.advance(),fO(e),e.acceptToken($O);else if((t==98||t==66)&&(e.next==39||e.next==34)){const r=e.next;e.advance(),O.treatBitsAsBytes?(W(e,r,O.backslashEscapes),e.acceptToken(ki)):(fO(e,r),e.acceptToken($O))}else if(t==48&&(e.next==120||e.next==88)||(t==120||t==88)&&e.next==39){let r=e.next==39;for(e.advance();vi(e.next);)e.advance();r&&e.next==39&&e.advance(),e.acceptToken(Ze)}else if(t==46&&e.next>=48&&e.next<=57)gO(e,!0),e.acceptToken(Ze);else if(t==46)e.acceptToken(bi);else if(t>=48&&t<=57)gO(e,!1),e.acceptToken(Ze);else if(_(t,O.operatorChars)){for(;_(e.next,O.operatorChars);)e.advance();e.acceptToken(Xi)}else if(_(t,O.specialVar))e.next==t&&e.advance(),Wi(e),e.acceptToken(Yi);else if(_(t,O.identifierQuotes))W(e,t,!1),e.acceptToken(yi);else if(t==58||t==44)e.acceptToken(xi);else if(Ye(t)){let r=Qt(e,String.fromCharCode(t));e.acceptToken(e.next==46?SO:(a=O.words[r.toLowerCase()])!==null&&a!==void 0?a:SO)}})}const ht=dt(ye),qi=T.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ht],topRules:{Script:[0,25]},tokenPrec:0});function ke(O){let e=O.cursor().moveTo(O.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function N(O,e){let a=O.sliceString(e.from,e.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function pe(O){return O&&(O.name=="Identifier"||O.name=="QuotedIdentifier")}function ji(O,e){if(e.name=="CompositeIdentifier"){let a=[];for(let t=e.firstChild;t;t=t.nextSibling)pe(t)&&a.push(N(O,t));return a}return[N(O,e)]}function PO(O,e){for(let a=[];;){if(!e||e.name!=".")return a;let t=ke(e);if(!pe(t))return a;a.unshift(N(O,t)),e=ke(t)}}function Vi(O,e){let a=V(O).resolveInner(e,-1),t=Gi(O.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?O.doc.sliceString(a.from,a.from+1):null,parents:PO(O.doc,ke(a)),aliases:t}:a.name=="."?{from:e,quoted:null,parents:PO(O.doc,a),aliases:t}:{from:e,quoted:null,parents:[],empty:!0,aliases:t}}const zi=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function Gi(O,e){let a;for(let r=e;!a;r=r.parent){if(!r)return null;r.name=="Statement"&&(a=r)}let t=null;for(let r=a.firstChild,s=!1,i=null;r;r=r.nextSibling){let l=r.name=="Keyword"?O.sliceString(r.from,r.to).toLowerCase():null,o=null;if(!s)s=l=="from";else if(l=="as"&&i&&pe(r.nextSibling))o=N(O,r.nextSibling);else{if(l&&zi.has(l))break;i&&pe(r)&&(o=N(O,r))}o&&(t||(t=Object.create(null)),t[o]=ji(O,i)),i=/Identifier$/.test(r.name)?r:null}return t}function Ai(O,e){return O?e.map(a=>Object.assign(Object.assign({},a),{label:O+a.label+O,apply:void 0})):e}const Ei=/^\w*$/,Ii=/^[`'"]?\w*[`'"]?$/;class Ce{constructor(){this.list=[],this.children=void 0}child(e,a){let t=this.children||(this.children=Object.create(null)),r=t[e];return r||(e&&this.list.push(ut(e,"type",a)),t[e]=new Ce)}addCompletions(e){for(let a of e){let t=this.list.findIndex(r=>r.label==a.label);t>-1?this.list[t]=a:this.list.push(a)}}}function ut(O,e,a){return/[^\w\xb5-\uffff]/.test(O)?{label:O,type:e,apply:a+O+a}:{label:O,type:e}}function Ni(O,e,a,t,r,s){var i;let l=new Ce,o=((i=s==null?void 0:s.spec.identifierQuotes)===null||i===void 0?void 0:i[0])||'"',Q=l.child(r||"",o);for(let d in O){let c=d.replace(/\\?\./g,p=>p=="."?"\0":p).split("\0"),S=c.length==1?Q:l;for(let p of c)S=S.child(p.replace(/\\\./g,"."),o);for(let p of O[d])p&&S.list.push(typeof p=="string"?ut(p,"property",o):p)}return e&&Q.addCompletions(e),a&&l.addCompletions(a),l.addCompletions(Q.list),t&&l.addCompletions(Q.child(t,o).list),d=>{let{parents:c,from:S,quoted:p,empty:u,aliases:f}=Vi(d.state,d.pos);if(u&&!d.explicit)return null;f&&c.length==1&&(c=f[c[0]]||c);let g=l;for(let w of c){for(;!g.children||!g.children[w];)if(g==l)g=Q;else if(g==Q&&t)g=g.child(t,o);else return null;g=g.child(w,o)}let X=p&&d.state.sliceDoc(d.pos,d.pos+1)==p,y=g.list;return g==l&&f&&(y=y.concat(Object.keys(f).map(w=>({label:w,type:"constant"})))),{from:S,to:X?d.pos+1:void 0,options:Ai(p,y),validFor:p?Ii:Ei}}}function Bi(O,e){let a=Object.keys(O).map(t=>({label:e?t.toUpperCase():t,type:O[t]==ct?"type":O[t]==ot?"keyword":"variable",boost:-1}));return XO(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],xO(a))}let Di=qi.configure({props:[L.add({Statement:C()}),F.add({Statement(O){return{from:O.firstChild.to,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}}),D({Keyword:n.keyword,Type:n.typeName,Builtin:n.standard(n.name),Bits:n.number,Bytes:n.string,Bool:n.bool,Null:n.null,Number:n.number,String:n.string,Identifier:n.name,QuotedIdentifier:n.special(n.string),SpecialVar:n.special(n.name),LineComment:n.lineComment,BlockComment:n.blockComment,Operator:n.operator,"Semi Punctuation":n.punctuation,"( )":n.paren,"{ }":n.brace,"[ ]":n.squareBracket})]});class B{constructor(e,a,t){this.dialect=e,this.language=a,this.spec=t}get extension(){return this.language.extension}static define(e){let a=Ri(e,e.keywords,e.types,e.builtin),t=J.define({name:"sql",parser:Di.configure({tokenizers:[{from:ht,to:dt(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new B(a,t,e)}}function Ji(O,e=!1){return Bi(O.dialect.words,e)}function Li(O,e=!1){return O.language.data.of({autocomplete:Ji(O,e)})}function Fi(O){return O.schema?Ni(O.schema,O.tables,O.schemas,O.defaultTable,O.defaultSchema,O.dialect||Re):()=>null}function Mi(O){return O.schema?(O.dialect||Re).language.data.of({autocomplete:Fi(O)}):[]}function ZO(O={}){let e=O.dialect||Re;return new M(e.language,[Mi(O),Li(e,!!O.upperCaseKeywords)])}const Re=B.define({});function Ki(O){let e;return{c(){e=Pt("div"),Zt(e,"class","code-editor"),K(e,"min-height",O[0]?O[0]+"px":null),K(e,"max-height",O[1]?O[1]+"px":"auto")},m(a,t){bt(a,e,t),O[11](e)},p(a,[t]){t&1&&K(e,"min-height",a[0]?a[0]+"px":null),t&2&&K(e,"max-height",a[1]?a[1]+"px":"auto")},i:ze,o:ze,d(a){a&&Xt(e),O[11](null)}}}function Hi(O,e,a){let t;xt(O,Yt,$=>a(12,t=$));const r=yt();let{id:s=""}=e,{value:i=""}=e,{minHeight:l=null}=e,{maxHeight:o=null}=e,{disabled:Q=!1}=e,{placeholder:d=""}=e,{language:c="javascript"}=e,{singleLine:S=!1}=e,p,u,f=new H,g=new H,X=new H,y=new H;function w(){p==null||p.focus()}function St(){u==null||u.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function qe(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.removeEventListener("click",w)}function je(){if(!s)return;qe();const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.addEventListener("click",w)}function Ve(){switch(c){case"html":return si();case"json":return Qi();case"sql-create-index":return ZO({dialect:B.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let m of t)$[m.name]=wt.getAllCollectionIdentifiers(m);return ZO({dialect:B.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return Ot()}}kt(()=>{const $={key:"Enter",run:m=>{S&&r("submit",i)}};return je(),a(10,p=new U({parent:u,state:z.create({doc:i,extensions:[zt(),Gt(),At(),Et(),It(),z.allowMultipleSelections.of(!0),Nt(Bt,{fallback:!0}),Dt(),Jt(),Lt(),Ft(),Mt.of([$,...Kt,...Ht,ea.find(m=>m.key==="Mod-d"),...Oa,...ta]),U.lineWrapping,aa({icons:!1}),f.of(Ve()),y.of(Ge(d)),g.of(U.editable.of(!0)),X.of(z.readOnly.of(!1)),z.transactionFilter.of(m=>S&&m.newDoc.lines>1?[]:m),U.updateListener.of(m=>{!m.docChanged||Q||(a(3,i=m.state.doc.toString()),St())})]})})),()=>{qe(),p==null||p.destroy()}});function $t($){vt[$?"unshift":"push"](()=>{u=$,a(2,u)})}return O.$$set=$=>{"id"in $&&a(4,s=$.id),"value"in $&&a(3,i=$.value),"minHeight"in $&&a(0,l=$.minHeight),"maxHeight"in $&&a(1,o=$.maxHeight),"disabled"in $&&a(5,Q=$.disabled),"placeholder"in $&&a(6,d=$.placeholder),"language"in $&&a(7,c=$.language),"singleLine"in $&&a(8,S=$.singleLine)},O.$$.update=()=>{O.$$.dirty&16&&s&&je(),O.$$.dirty&1152&&p&&c&&p.dispatch({effects:[f.reconfigure(Ve())]}),O.$$.dirty&1056&&p&&typeof Q<"u"&&p.dispatch({effects:[g.reconfigure(U.editable.of(!Q)),X.reconfigure(z.readOnly.of(Q))]}),O.$$.dirty&1032&&p&&i!=p.state.doc.toString()&&p.dispatch({changes:{from:0,to:p.state.doc.length,insert:i}}),O.$$.dirty&1088&&p&&typeof d<"u"&&p.dispatch({effects:[y.reconfigure(Ge(d))]})},[l,o,u,i,s,Q,d,c,S,w,p,$t]}class ts extends ft{constructor(e){super(),gt(this,e,Hi,Ki,mt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{ts as default}; diff --git a/ui/dist/assets/CodeEditor-c648ece6.js b/ui/dist/assets/CodeEditor-c648ece6.js deleted file mode 100644 index fa875484..00000000 --- a/ui/dist/assets/CodeEditor-c648ece6.js +++ /dev/null @@ -1,14 +0,0 @@ -import{S as ft,i as gt,s as mt,e as Pt,f as Zt,U as K,g as bt,y as ze,o as Xt,J as xt,K as Yt,L as yt,I as kt,C as wt,M as vt}from"./index-7d33ef4c.js";import{P as Tt,N as _t,u as Wt,D as Ut,v as we,T as ee,I as ve,w as D,x as n,y as Ct,L as J,z as L,A as C,B as F,F as Te,G as M,H as j,J as bO,K as XO,M as xO,E as U,O as YO,Q as P,R as Rt,U as qt,V as yO,W as Vt,X as jt,a as z,h as zt,b as Gt,c as Et,d as At,e as It,s as Nt,t as Bt,f as Dt,g as Jt,r as Lt,i as Ft,k as Mt,j as Kt,l as Ht,m as ea,n as Oa,o as ta,p as aa,q as Ge,C as H}from"./index-30dee195.js";class re{constructor(e,a,t,r,s,i,l,o,Q,d=0,c){this.p=e,this.stack=a,this.state=t,this.reducePos=r,this.pos=s,this.score=i,this.buffer=l,this.bufferBase=o,this.curContext=Q,this.lookAhead=d,this.parent=c}toString(){return`[${this.stack.filter((e,a)=>a%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,a,t=0){let r=e.parser.context;return new re(e,[],a,t,t,0,[],0,r?new Ee(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,a){this.stack.push(this.state,a,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var a;let t=e>>19,r=e&65535,{parser:s}=this.p,i=s.dynamicPrecedence(r);if(i&&(this.score+=i),t==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r=2e3&&!(!((a=this.p.parser.nodeSet.types[r])===null||a===void 0)&&a.isAnonymous)&&(o==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=Q):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(r,o)}storeNode(e,a,t,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&i.buffer[l-4]==0&&i.buffer[l-1]>-1){if(a==t)return;if(i.buffer[l-2]>=a){i.buffer[l-2]=t;return}}}if(!s||this.pos==t)this.buffer.push(e,a,t,r);else{let i=this.buffer.length;if(i>0&&this.buffer[i-4]!=0)for(;i>0&&this.buffer[i-2]>t;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4);this.buffer[i]=e,this.buffer[i+1]=a,this.buffer[i+2]=t,this.buffer[i+3]=r}}shift(e,a,t,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(a,t),a<=this.p.parser.maxNode&&this.buffer.push(a,t,r,4);else{let s=e,{parser:i}=this.p;(r>this.pos||a<=i.maxNode)&&(this.pos=r,i.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,t),this.shiftContext(a,t),a<=i.maxNode&&this.buffer.push(a,t,r,4)}}apply(e,a,t,r){e&65536?this.reduce(e):this.shift(e,a,t,r)}useNode(e,a){let t=this.p.reused.length-1;(t<0||this.p.reused[t]!=e)&&(this.p.reused.push(e),t++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(a,r),this.buffer.push(t,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,a=e.buffer.length;for(;a>0&&e.buffer[a-2]>e.reducePos;)a-=4;let t=e.buffer.slice(a),r=e.bufferBase+a;for(;e&&r==e.bufferBase;)e=e.parent;return new re(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,t,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,a){let t=e<=this.p.parser.maxNode;t&&this.storeNode(e,this.pos,a,4),this.storeNode(0,this.pos,a,t?8:4),this.pos=this.reducePos=a,this.score-=190}canShift(e){for(let a=new ra(this);;){let t=this.p.parser.stateSlot(a.state,4)||this.p.parser.hasAction(a.state,e);if(t==0)return!1;if(!(t&65536))return!0;a.reduce(t)}}recoverByInsert(e){if(this.stack.length>=300)return[];let a=this.p.parser.nextStates(this.state);if(a.length>8||this.stack.length>=120){let r=[];for(let s=0,i;so&1&&l==i)||r.push(a[s],i)}a=r}let t=[];for(let r=0;r>19,r=a&65535,s=this.stack.length-t*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let i=this.findForcedReduction();if(i==null)return!1;a=i}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(a),!0}findForcedReduction(){let{parser:e}=this.p,a=[],t=(r,s)=>{if(!a.includes(r))return a.push(r),e.allActions(r,i=>{if(!(i&393216))if(i&65536){let l=(i>>19)-s;if(l>1){let o=i&65535,Q=this.stack.length-l*3;if(Q>=0&&e.getGoto(this.stack[Q],o,!1)>=0)return l<<19|65536|o}}else{let l=t(i,s+1);if(l!=null)return l}})};return t(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let a=0;athis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Ee{constructor(e,a){this.tracker=e,this.context=a,this.hash=e.strict?e.hash(a):0}}class ra{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let a=e&65535,t=e>>19;t==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],a,!0);this.state=r}}class ie{constructor(e,a,t){this.stack=e,this.pos=a,this.index=t,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,a=e.bufferBase+e.buffer.length){return new ie(e,a,a-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ie(this.stack,this.pos,this.index)}}function I(O,e=Uint16Array){if(typeof O!="string")return O;let a=null;for(let t=0,r=0;t=92&&i--,i>=34&&i--;let o=i-32;if(o>=46&&(o-=46,l=!0),s+=o,l)break;s*=46}a?a[r++]=s:a=new e(s)}return a}class Oe{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ae=new Oe;class ia{constructor(e,a){this.input=e,this.ranges=a,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ae,this.rangeIndex=0,this.pos=this.chunkPos=a[0].from,this.range=a[0],this.end=a[a.length-1].to,this.readNext()}resolveOffset(e,a){let t=this.range,r=this.rangeIndex,s=this.pos+e;for(;st.to:s>=t.to;){if(r==this.ranges.length-1)return null;let i=this.ranges[++r];s+=i.from-t.to,t=i}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,a.from);return this.end}peek(e){let a=this.chunkOff+e,t,r;if(a>=0&&a=this.chunk2Pos&&tl.to&&(this.chunk2=this.chunk2.slice(0,l.to-t)),r=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),r}acceptToken(e,a=0){let t=a?this.resolveOffset(a,-1):this.pos;if(t==null||t=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,a){if(a?(this.token=a,a.start=e,a.lookAhead=e+1,a.value=a.extended=-1):this.token=Ae,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&a<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,a-this.chunkPos);if(e>=this.chunk2Pos&&a<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,a-this.chunk2Pos);if(e>=this.range.from&&a<=this.range.to)return this.input.read(e,a);let t="";for(let r of this.ranges){if(r.from>=a)break;r.to>e&&(t+=this.input.read(Math.max(r.from,e),Math.min(r.to,a)))}return t}}class R{constructor(e,a){this.data=e,this.id=a}token(e,a){let{parser:t}=a.p;kO(this.data,e,a,this.id,t.data,t.tokenPrecTable)}}R.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class se{constructor(e,a,t){this.precTable=a,this.elseToken=t,this.data=typeof e=="string"?I(e):e}token(e,a){let t=e.pos,r=0;for(;;){let s=e.next<0,i=e.resolveOffset(1,1);if(kO(this.data,e,a,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(t,e.token),e.acceptToken(this.elseToken,r))}}se.prototype.contextual=R.prototype.fallback=R.prototype.extend=!1;class x{constructor(e,a={}){this.token=e,this.contextual=!!a.contextual,this.fallback=!!a.fallback,this.extend=!!a.extend}}function kO(O,e,a,t,r,s){let i=0,l=1<0){let u=O[p];if(o.allows(u)&&(e.token.value==-1||e.token.value==u||sa(u,e.token.value,r,s))){e.acceptToken(u);break}}let d=e.next,c=0,S=O[i+2];if(e.next<0&&S>c&&O[Q+S*3-3]==65535&&O[Q+S*3-3]==65535){i=O[Q+S*3-1];continue e}for(;c>1,u=Q+p+(p<<1),f=O[u],g=O[u+1]||65536;if(d=g)c=p+1;else{i=O[u+2],e.advance();continue e}}break}}function Ie(O,e,a){for(let t=e,r;(r=O[t])!=65535;t++)if(r==a)return t-e;return-1}function sa(O,e,a,t){let r=Ie(a,t,e);return r<0||Ie(a,t,O)e)&&!t.type.isError)return a<0?Math.max(0,Math.min(t.to-1,e-25)):Math.min(O.length,Math.max(t.from+1,e+25));if(a<0?t.prevSibling():t.nextSibling())break;if(!t.parent())return a<0?0:O.length}}class la{constructor(e,a){this.fragments=e,this.nodeSet=a,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Ne(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Ne(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=i,null;if(s instanceof ee){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(i),this.index.push(0))}else this.index[a]++,this.nextStart=i+s.length}}}class na{constructor(e,a){this.stream=a,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(t=>new Oe)}getActions(e){let a=0,t=null,{parser:r}=e.p,{tokenizers:s}=r,i=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,o=0;for(let Q=0;Qc.end+25&&(o=Math.max(c.lookAhead,o)),c.value!=0)){let S=a;if(c.extended>-1&&(a=this.addActions(e,c.extended,c.end,a)),a=this.addActions(e,c.value,c.end,a),!d.extend&&(t=c,a>S))break}}for(;this.actions.length>a;)this.actions.pop();return o&&e.setLookAhead(o),!t&&e.pos==this.stream.end&&(t=new Oe,t.value=e.p.parser.eofTerm,t.start=t.end=e.pos,a=this.addActions(e,t.value,t.end,a)),this.mainToken=t,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let a=new Oe,{pos:t,p:r}=e;return a.start=t,a.end=Math.min(t+1,r.stream.end),a.value=t==r.stream.end?r.parser.eofTerm:0,a}updateCachedToken(e,a,t){let r=this.stream.clipPos(t.pos);if(a.token(this.stream.reset(r,e),t),e.value>-1){let{parser:s}=t.p;for(let i=0;i=0&&t.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,a,t,r){for(let s=0;se.bufferLength*4?new la(t,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,a=this.minStackPos,t=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[i]=e;for(;i.forceReduce()&&i.stack.length&&i.stack[i.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;ia)t.push(l);else{if(this.advanceStack(l,t,e))continue;{r||(r=[],s=[]),r.push(l);let o=this.tokens.getMainToken(l);s.push(o.value,o.end)}}break}}if(!t.length){let i=r&&Qa(r);if(i)return Z&&console.log("Finish with "+this.stackID(i)),this.stackToTree(i);if(this.parser.strict)throw Z&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+a);this.recovering||(this.recovering=5)}if(this.recovering&&r){let i=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,t);if(i)return Z&&console.log("Force-finish "+this.stackID(i)),this.stackToTree(i.forceAll())}if(this.recovering){let i=this.recovering==1?1:this.recovering*3;if(t.length>i)for(t.sort((l,o)=>o.score-l.score);t.length>i;)t.pop();t.some(l=>l.reducePos>a)&&this.recovering--}else if(t.length>1){e:for(let i=0;i500&&Q.buffer.length>500)if((l.score-Q.score||l.buffer.length-Q.buffer.length)>0)t.splice(o--,1);else{t.splice(i--,1);continue e}}}t.length>12&&t.splice(12,t.length-12)}this.minStackPos=t[0].pos;for(let i=1;i ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let Q=e.curContext&&e.curContext.tracker.strict,d=Q?e.curContext.hash:0;for(let c=this.fragments.nodeAt(r);c;){let S=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(S>-1&&c.length&&(!Q||(c.prop(we.contextHash)||0)==d))return e.useNode(c,S),Z&&console.log(i+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let p=c.children[0];if(p instanceof ee&&c.positions[0]==0)c=p;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),Z&&console.log(i+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let o=this.tokens.getActions(e);for(let Q=0;Qr?a.push(u):t.push(u)}return!1}advanceFully(e,a){let t=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>t)return Be(e,a),!0}}runRecovery(e,a,t){let r=null,s=!1;for(let i=0;i ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),Z&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,t))))continue;let c=l.split(),S=d;for(let p=0;c.forceReduce()&&p<10&&(Z&&console.log(S+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,t));p++)Z&&(S=this.stackID(c)+" -> ");for(let p of l.recoverByInsert(o))Z&&console.log(d+this.stackID(p)+" (via recover-insert)"),this.advanceFully(p,t);this.stream.end>l.pos?(Q==l.pos&&(Q++,o=0),l.recoverByDelete(o,Q),Z&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(o)})`),Be(l,t)):(!r||r.scoreO;class wO{constructor(e){this.start=e.start,this.shift=e.shift||he,this.reduce=e.reduce||he,this.reuse=e.reuse||he,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class T extends Tt{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let a=e.nodeNames.split(" ");this.minRepeatTerm=a.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(d,o,l[Q++]);else{let c=l[Q+-d];for(let S=-d;S>0;S--)s(l[Q++],o,c);Q++}}}this.nodeSet=new _t(a.map((l,o)=>Wt.define({name:o>=this.minRepeatTerm?void 0:l,id:o,props:r[o],top:t.indexOf(o)>-1,error:o==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(o)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Ut;let i=I(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new R(i,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,a,t){let r=new oa(this,e,a,t);for(let s of this.wrappers)r=s(r,e,a,t);return r}getGoto(e,a,t=!1){let r=this.goto;if(a>=r[0])return-1;for(let s=r[a+1];;){let i=r[s++],l=i&1,o=r[s++];if(l&&t)return o;for(let Q=s+(i>>1);s0}validAction(e,a){return!!this.allActions(e,t=>t==a?!0:null)}allActions(e,a){let t=this.stateSlot(e,4),r=t?a(t):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;r=a(k(this.data,s+1))}return r}nextStates(e){let a=[];for(let t=this.stateSlot(e,1);;t+=3){if(this.data[t]==65535)if(this.data[t+1]==1)t=k(this.data,t+2);else break;if(!(this.data[t+2]&1)){let r=this.data[t+1];a.some((s,i)=>i&1&&s==r)||a.push(this.data[t],r)}}return a}configure(e){let a=Object.assign(Object.create(T.prototype),this);if(e.props&&(a.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw new RangeError(`Invalid top rule name ${e.top}`);a.top=t}return e.tokenizers&&(a.tokenizers=this.tokenizers.map(t=>{let r=e.tokenizers.find(s=>s.from==t);return r?r.to:t})),e.specializers&&(a.specializers=this.specializers.slice(),a.specializerSpecs=this.specializerSpecs.map((t,r)=>{let s=e.specializers.find(l=>l.from==t.external);if(!s)return t;let i=Object.assign(Object.assign({},t),{external:s.to});return a.specializers[r]=De(i),i})),e.contextTracker&&(a.context=e.contextTracker),e.dialect&&(a.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(a.strict=e.strict),e.wrap&&(a.wrappers=a.wrappers.concat(e.wrap)),e.bufferLength!=null&&(a.bufferLength=e.bufferLength),a}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let a=this.dynamicPrecedences;return a==null?0:a[e]||0}parseDialect(e){let a=Object.keys(this.dialects),t=a.map(()=>!1);if(e)for(let s of e.split(" ")){let i=a.indexOf(s);i>=0&&(t[i]=!0)}let r=null;for(let s=0;st)&&a.p.parser.stateFlag(a.state,2)&&(!e||e.scoreO.external(a,t)<<1|e}return O.get}const pa=54,da=1,ha=55,ua=2,Sa=56,$a=3,Je=4,fa=5,le=6,vO=7,TO=8,_O=9,WO=10,ga=11,ma=12,Pa=13,ue=57,Za=14,Le=58,UO=20,ba=22,CO=23,Xa=24,Xe=26,RO=27,xa=28,Ya=31,ya=34,ka=36,wa=37,va=0,Ta=1,_a={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Wa={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Fe={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ua(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function qO(O){return O==9||O==10||O==13||O==32}let Me=null,Ke=null,He=0;function xe(O,e){let a=O.pos+e;if(He==a&&Ke==O)return Me;let t=O.peek(e);for(;qO(t);)t=O.peek(++e);let r="";for(;Ua(t);)r+=String.fromCharCode(t),t=O.peek(++e);return Ke=O,He=a,Me=r?r.toLowerCase():t==Ca||t==Ra?void 0:null}const VO=60,ne=62,_e=47,Ca=63,Ra=33,qa=45;function eO(O,e){this.name=O,this.parent=e,this.hash=e?e.hash:0;for(let a=0;a-1?new eO(xe(t,1)||"",O):O},reduce(O,e){return e==UO&&O?O.parent:O},reuse(O,e,a,t){let r=e.type.id;return r==le||r==ka?new eO(xe(t,1)||"",O):O},hash(O){return O?O.hash:0},strict:!1}),za=new x((O,e)=>{if(O.next!=VO){O.next<0&&e.context&&O.acceptToken(ue);return}O.advance();let a=O.next==_e;a&&O.advance();let t=xe(O,0);if(t===void 0)return;if(!t)return O.acceptToken(a?Za:le);let r=e.context?e.context.name:null;if(a){if(t==r)return O.acceptToken(ga);if(r&&Wa[r])return O.acceptToken(ue,-2);if(e.dialectEnabled(va))return O.acceptToken(ma);for(let s=e.context;s;s=s.parent)if(s.name==t)return;O.acceptToken(Pa)}else{if(t=="script")return O.acceptToken(vO);if(t=="style")return O.acceptToken(TO);if(t=="textarea")return O.acceptToken(_O);if(_a.hasOwnProperty(t))return O.acceptToken(WO);r&&Fe[r]&&Fe[r][t]?O.acceptToken(ue,-1):O.acceptToken(le)}},{contextual:!0}),Ga=new x(O=>{for(let e=0,a=0;;a++){if(O.next<0){a&&O.acceptToken(Le);break}if(O.next==qa)e++;else if(O.next==ne&&e>=2){a>3&&O.acceptToken(Le,-2);break}else e=0;O.advance()}});function Ea(O){for(;O;O=O.parent)if(O.name=="svg"||O.name=="math")return!0;return!1}const Aa=new x((O,e)=>{if(O.next==_e&&O.peek(1)==ne){let a=e.dialectEnabled(Ta)||Ea(e.context);O.acceptToken(a?fa:Je,2)}else O.next==ne&&O.acceptToken(Je,1)});function We(O,e,a){let t=2+O.length;return new x(r=>{for(let s=0,i=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==VO||s==1&&r.next==_e||s>=2&&si?r.acceptToken(e,-i):r.acceptToken(a,-(i-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=i=0;r.advance()}})}const Ia=We("script",pa,da),Na=We("style",ha,ua),Ba=We("textarea",Sa,$a),Da=D({"Text RawText":n.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":n.angleBracket,TagName:n.tagName,"MismatchedCloseTag/TagName":[n.tagName,n.invalid],AttributeName:n.attributeName,"AttributeValue UnquotedAttributeValue":n.attributeValue,Is:n.definitionOperator,"EntityReference CharacterReference":n.character,Comment:n.blockComment,ProcessingInst:n.processingInstruction,DoctypeDecl:n.documentMeta}),Ja=T.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOOOd1G/T1G/TO(nQ&rO1G/WOOO`1G/W1G/WOOO`1G/Y1G/YO(yQ&rO1G/YOOOa-E7[-E7[O)RQ#tO'#CyOOO`1G.v1G.vOOOb-E7]-E7]O)WQ#tO'#C|OOOd-E7^-E7^O)]Q#tO'#DPOOO`-E7_-E7_O)bQ#|O,59mOOOp-E7`-E7`OOO`1G/Z1G/ZOOO`1G/]1G/]OOO`1G/^1G/^O)gQ,UO,59_OOQW-E7X-E7XOOOa7+$c7+$cOOOb7+$l7+$lOOOd7+$o7+$oOOO`7+$r7+$rOOO`7+$t7+$tO)rQ#|O,59eO)wQ#|O,59hO)|Q#|O,59kOOO`1G/X1G/XO*RO7[O'#CvO*dOMhO'#CvOOQW1G.y1G.yOOO`1G/P1G/POOO`1G/S1G/SOOO`1G/V1G/VOOOO'#D['#D[O*uO7[O,59bOOQW,59b,59bOOOO'#D]'#D]O+WOMhO,59bOOOO-E7Y-E7YOOQW1G.|1G.|OOOO-E7Z-E7Z",stateData:"+s~O!^OS~OUSOVPOWQOXROYTO[]O][O^^O`^Oa^Ob^Oc^Ox^O{_O!dZO~OfaO~OfbO~OfcO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:ja,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[Da],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TakWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOb!R!RAwP;=`<%lAY!ZBRYkWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhhSkWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbhSkWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbhSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXhSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!bx`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYlhS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_khS`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_X`P!a`!cp!eQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZhSfQ`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!a`!cpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!a`!cpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!a`!cp!dPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!a`!cpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!a`!cpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!a`!cpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!a`!cpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!a`!cpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!a`!cpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!a`!cpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!cpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO{PP!-nP;=`<%l!-Sq!-xS!cp{POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!a`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!a`{POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!a`!cp{POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!a`!cpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!a`!cpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!a`!cpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!a`!cpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!a`!cpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!a`!cpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!cpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let Q=l.type.id;if(Q==xa)return Se(l,o,a);if(Q==Ya)return Se(l,o,t);if(Q==ya)return Se(l,o,r);if(Q==UO&&s.length){let d=l.node,c=d.firstChild,S=c&&OO(c,o),p;if(S){for(let u of s)if(u.tag==S&&(!u.attrs||u.attrs(p||(p=jO(d,o))))){let f=d.lastChild;return{parser:u.parser,overlay:[{from:c.to,to:f.type.id==wa?f.from:d.to}]}}}}if(i&&Q==CO){let d=l.node,c;if(c=d.firstChild){let S=i[o.read(c.from,c.to)];if(S)for(let p of S){if(p.tagName&&p.tagName!=OO(d.parent,o))continue;let u=d.lastChild;if(u.type.id==Xe){let f=u.from+1,g=u.lastChild,X=u.to-(g&&g.isError?0:1);if(X>f)return{parser:p.parser,overlay:[{from:f,to:X}]}}else if(u.type.id==RO)return{parser:p.parser,overlay:[{from:u.from,to:u.to}]}}}}return null})}const La=96,tO=1,Fa=97,Ma=98,aO=2,GO=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Ka=58,Ha=40,EO=95,er=91,te=45,Or=46,tr=35,ar=37;function oe(O){return O>=65&&O<=90||O>=97&&O<=122||O>=161}function rr(O){return O>=48&&O<=57}const ir=new x((O,e)=>{for(let a=!1,t=0,r=0;;r++){let{next:s}=O;if(oe(s)||s==te||s==EO||a&&rr(s))!a&&(s!=te||r>0)&&(a=!0),t===r&&s==te&&t++,O.advance();else{a&&O.acceptToken(s==Ha?Fa:t==2&&e.canShift(aO)?aO:Ma);break}}}),sr=new x(O=>{if(GO.includes(O.peek(-1))){let{next:e}=O;(oe(e)||e==EO||e==tr||e==Or||e==er||e==Ka||e==te)&&O.acceptToken(La)}}),lr=new x(O=>{if(!GO.includes(O.peek(-1))){let{next:e}=O;if(e==ar&&(O.advance(),O.acceptToken(tO)),oe(e)){do O.advance();while(oe(O.next));O.acceptToken(tO)}}}),nr=D({"AtKeyword import charset namespace keyframes media supports":n.definitionKeyword,"from to selector":n.keyword,NamespaceName:n.namespace,KeyframeName:n.labelName,KeyframeRangeName:n.operatorKeyword,TagName:n.tagName,ClassName:n.className,PseudoClassName:n.constant(n.className),IdName:n.labelName,"FeatureName PropertyName":n.propertyName,AttributeName:n.attributeName,NumberLiteral:n.number,KeywordQuery:n.keyword,UnaryQueryOp:n.operatorKeyword,"CallTag ValueName":n.atom,VariableName:n.variableName,Callee:n.operatorKeyword,Unit:n.unit,"UniversalSelector NestingSelector":n.definitionOperator,MatchOp:n.compareOperator,"ChildOp SiblingOp, LogicOp":n.logicOperator,BinOp:n.arithmeticOperator,Important:n.modifier,Comment:n.blockComment,ColorLiteral:n.color,"ParenthesizedContent StringLiteral":n.string,":":n.punctuation,"PseudoOp #":n.derefOperator,"; ,":n.separator,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace}),or={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},cr={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Qr={__proto__:null,not:128,only:128},pr=T.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{QWO,5:kO-TQWO,5:mOOQS-E8S-E8SO${QdO,59{O-]Q[O'#EZO-jQWO,5;[O-jQWO,5;[POOO'#ET'#ETP-uO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO.lQXO,5:sOOQO-E8V-E8VOOQS1G.g1G.gOOQP1G.n1G.nO)dQWO1G.nO)iQWO1G.nOOQP1G/V1G/VO.yQ`O1G/ZO/dQXO1G/_O/zQXO1G/aO0bQXO1G/bO0xQWO,59zO0}Q[O'#DOO1UQdO'#CoOOQP1G/Z1G/ZO${QdO1G/ZO1]QpO,59]OOQS,59_,59_O${QdO,59aO1eQWO1G/kOOQS,59c,59cO1jQ!bO,59eO1rQWO'#DhO1}QWO,5:TO2SQWO,5:ZO&]Q[O,5:VO&]Q[O'#E[O2[QWO,5;]O2gQWO,5:XO(^Q[O,5:[OOQS1G/x1G/xOOQS1G/z1G/zOOQS1G/|1G/|O2xQWO1G/|O2}QdO'#D|OOQS1G0P1G0POOQS1G0V1G0VOOQS1G0X1G0XO3YQtO1G/gOOQO,5:u,5:uO3pQ[O,5:uOOQO-E8X-E8XO3}QWO1G0vPOOO-E8R-E8RPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$u7+$uO${QdO7+$uOOQS1G/f1G/fO4YQXO'#EoO4aQWO,59jO4fQtO'#EVO5ZQdO'#ElO5eQWO,59ZO5jQpO7+$uOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%V7+%VO5rQWO1G/PO${QdO1G/oOOQO1G/u1G/uOOQO1G/q1G/qO5wQWO,5:vOOQO-E8Y-E8YO6VQXO1G/vOOQS7+%h7+%hO6^QYO'#CsOOQO'#EO'#EOO6iQ`O'#D}OOQO'#D}'#D}O6tQWO'#E]O6|QdO,5:hOOQS,5:h,5:hO7XQtO'#EYO${QdO'#EYO8VQdO7+%ROOQO7+%R7+%ROOQO1G0a1G0aO8jQpO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#b[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSp^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#_QOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#X~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#b[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!W^Oy%^z;'S%^;'S;=`%o<%lO%^dCoSzSOy%^z;'S%^;'S;=`%o<%lO%^bDQU|QOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS|Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[!YQo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bFfSxQOy%^z;'S%^;'S;=`%o<%lO%^lFwSv[Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!`Qo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[sr,lr,ir,1,2,3,4,new se("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:O=>or[O]||-1},{term:56,get:O=>cr[O]||-1},{term:98,get:O=>Qr[O]||-1}],tokenPrec:1169});let $e=null;function fe(){if(!$e&&typeof document=="object"&&document.body){let{style:O}=document.body,e=[],a=new Set;for(let t in O)t!="cssText"&&t!="cssFloat"&&typeof O[t]=="string"&&(/[A-Z]/.test(t)&&(t=t.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),a.has(t)||(e.push(t),a.add(t)));$e=e.sort().map(t=>({type:"property",label:t}))}return $e||[]}const rO=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(O=>({type:"class",label:O})),iO=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(O=>({type:"keyword",label:O})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(O=>({type:"constant",label:O}))),dr=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(O=>({type:"type",label:O})),v=/^(\w[\w-]*|-\w[\w-]*|)$/,hr=/^-(-[\w-]*)?$/;function ur(O,e){var a;if((O.name=="("||O.type.isError)&&(O=O.parent||O),O.name!="ArgList")return!1;let t=(a=O.parent)===null||a===void 0?void 0:a.firstChild;return(t==null?void 0:t.name)!="Callee"?!1:e.sliceString(t.from,t.to)=="var"}const sO=new bO,Sr=["Declaration"];function $r(O){for(let e=O;;){if(e.type.isTop)return e;if(!(e=e.parent))return O}}function AO(O,e,a){if(e.to-e.from>4096){let t=sO.get(e);if(t)return t;let r=[],s=new Set,i=e.cursor(ve.IncludeAnonymous);if(i.firstChild())do for(let l of AO(O,i.node,a))s.has(l.label)||(s.add(l.label),r.push(l));while(i.nextSibling());return sO.set(e,r),r}else{let t=[],r=new Set;return e.cursor().iterate(s=>{var i;if(a(s)&&s.matchContext(Sr)&&((i=s.node.nextSibling)===null||i===void 0?void 0:i.name)==":"){let l=O.sliceString(s.from,s.to);r.has(l)||(r.add(l),t.push({label:l,type:"variable"}))}}),t}}const fr=O=>e=>{let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.type.isError&&r.from==r.to-1&&a.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:fe(),validFor:v};if(r.name=="ValueName")return{from:r.from,options:iO,validFor:v};if(r.name=="PseudoClassName")return{from:r.from,options:rO,validFor:v};if(O(r)||(e.explicit||s)&&ur(r,a.doc))return{from:O(r)||s?r.from:t,options:AO(a.doc,$r(r),O),validFor:hr};if(r.name=="TagName"){for(let{parent:o}=r;o;o=o.parent)if(o.name=="Block")return{from:r.from,options:fe(),validFor:v};return{from:r.from,options:dr,validFor:v}}if(!e.explicit)return null;let i=r.resolve(t),l=i.childBefore(t);return l&&l.name==":"&&i.name=="PseudoClassSelector"?{from:t,options:rO,validFor:v}:l&&l.name==":"&&i.name=="Declaration"||i.name=="ArgList"?{from:t,options:iO,validFor:v}:i.name=="Block"||i.name=="Styles"?{from:t,options:fe(),validFor:v}:null},gr=fr(O=>O.name=="VariableName"),ce=J.define({name:"css",parser:pr.configure({props:[L.add({Declaration:C()}),F.add({"Block KeyframeList":Te})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function mr(){return new M(ce,ce.data.of({autocomplete:gr}))}const Pr=304,lO=1,Zr=2,br=305,Xr=307,xr=308,Yr=3,yr=4,kr=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],IO=125,wr=59,nO=47,vr=42,Tr=43,_r=45,Wr=new wO({start:!1,shift(O,e){return e==Yr||e==yr||e==Xr?O:e==xr},strict:!1}),Ur=new x((O,e)=>{let{next:a}=O;(a==IO||a==-1||e.context)&&O.acceptToken(br)},{contextual:!0,fallback:!0}),Cr=new x((O,e)=>{let{next:a}=O,t;kr.indexOf(a)>-1||a==nO&&((t=O.peek(1))==nO||t==vr)||a!=IO&&a!=wr&&a!=-1&&!e.context&&O.acceptToken(Pr)},{contextual:!0}),Rr=new x((O,e)=>{let{next:a}=O;if((a==Tr||a==_r)&&(O.advance(),a==O.next)){O.advance();let t=!e.context&&e.canShift(lO);O.acceptToken(t?lO:Zr)}},{contextual:!0}),qr=D({"get set async static":n.modifier,"for while do if else switch try catch finally return throw break continue default case":n.controlKeyword,"in of await yield void typeof delete instanceof":n.operatorKeyword,"let var const using function class extends":n.definitionKeyword,"import export from":n.moduleKeyword,"with debugger as new":n.keyword,TemplateString:n.special(n.string),super:n.atom,BooleanLiteral:n.bool,this:n.self,null:n.null,Star:n.modifier,VariableName:n.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":n.function(n.variableName),VariableDefinition:n.definition(n.variableName),Label:n.labelName,PropertyName:n.propertyName,PrivatePropertyName:n.special(n.propertyName),"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),"FunctionDeclaration/VariableDefinition":n.function(n.definition(n.variableName)),"ClassDeclaration/VariableDefinition":n.definition(n.className),PropertyDefinition:n.definition(n.propertyName),PrivatePropertyDefinition:n.definition(n.special(n.propertyName)),UpdateOp:n.updateOperator,"LineComment Hashbang":n.lineComment,BlockComment:n.blockComment,Number:n.number,String:n.string,Escape:n.escape,ArithOp:n.arithmeticOperator,LogicOp:n.logicOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,RegExp:n.regexp,Equals:n.definitionOperator,Arrow:n.function(n.punctuation),": Spread":n.punctuation,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,"InterpolationStart InterpolationEnd":n.special(n.brace),".":n.derefOperator,", ;":n.separator,"@":n.meta,TypeName:n.typeName,TypeDefinition:n.definition(n.typeName),"type enum interface implements namespace module declare":n.definitionKeyword,"abstract global Privacy readonly override":n.modifier,"is keyof unique infer":n.operatorKeyword,JSXAttributeValue:n.attributeValue,JSXText:n.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":n.angleBracket,"JSXIdentifier JSXNameSpacedName":n.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":n.attributeName,"JSXBuiltin/JSXIdentifier":n.standard(n.tagName)}),Vr={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},jr={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},zr={__proto__:null,"<":139},Gr=T.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-ElOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-ExQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AcQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AkQSO,5=sO!ApQSO,5=sO!AuQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BTQWO,5=`O!B]Q,UO,5=aO!BhQSO,5=cO!BmQ`O,5=fO!BuQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!BzQSO'#HRO9{Q,UO'#HTO!CPQSO'#HTOOQQ,5=i,5=iO!CUQSO'#HUO!C^QSO'#CmO!CcQSO,58}O!CmQSO,58}O!ErQUO,58}OOQQ,58},58}O!FSQ(C[O,58}O%[QUO,58}O!H_QUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!HuQSO,5=uO`QUO,5={O`QUO,5=}O!HzQSO,5>PO`QUO,5>RO!IPQSO,5>UO!IUQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!M`QSO,5>fOOQQ,5>h,5>hO!M`QSO,5>hOOQQ,5>j,5>jO!MeQWO'#DYO%[QUO'#JiO!NSQWO'#JiO!NqQWO'#DhO# SQWO'#DhO##eQUO'#DhO##lQSO'#JhO##tQSO,5:RO##yQSO'#EnO#$XQSO'#JvO#$aQSO,5;XO#$fQWO'#DhO#$sQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#$zQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%SQSO,5@TO#%XQ!LQO,5:pOOQO-E<_-E<_O#&_Q(C`O,5:{OChQWO,5:oO#&iQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#&vQ(C[O,5:{O#'RQ(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'aQ(C[O,5:{POOO'#IU'#IUP#'uO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#(aQUO'#I[OOQO-ERQ(CjO1G0yO#?yQ(CjO1G0yO#ByQ$IUO'#CgO#DwQ$IUO1G1[O#EOQ$IUO'#JfO!,YQSO1G1bO#E`Q(CjO,5?SOOQ(CW-EeQSO1G3kO$.VQUO1G3mO$2ZQUO'#HlOOQQ1G3p1G3pO$2hQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$2pQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$6wQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$6|Q$IUO,5:SOOQO,5;Y,5;YO$7WQWO'#I]O$7nQSO,5@SOOQ(CY1G/m1G/mO$7vQWO'#IcO$8QQSO,5@bOOQ(CW1G0s1G0sO# SQWO,5:SOOQO'#I`'#I`O$8YQWO,5:nOOQ(CY,5:n,5:nO#$}QSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8aQ(C[O1G0gO$8lQ(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$8zQ(C[O1G0gOOQO1G0Z1G0ZO$9`Q(CjO1G0gPOOO-EvO$9|QSO1G5mO$:UQSO1G5zO$:^QbO1G5{O9TQSO,5>|O$:hQ(CjO1G5xO%[QUO1G5xO$:xQ(C[O1G5xO$;ZQSO1G5wO$;ZQSO1G5wO9TQSO1G5wO$;cQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$;wQSO,5?PO$$XQSO,5?POOQO-ExQ(CjO,5WOOQQ,5>W,5>WO%[QUO'#HmO%(ZQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%(`QWO1G5oO%(tQ$IUO1G0tO%)OQSO1G0tOOQO1G/n1G/nO%)ZQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EjQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9`Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%)eQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%)pQ(C[O7+&RO%*OQ(CjO7++dO%[QUO7++dO%*`QSO7++cO%*`QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%*hQSO1G4kOOQO7+%z7+%zO#$}QSO<xOOQO-E<[-E<[O%2^QbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%2hQSO1G5qOOQ(CY<XQ$IUO1G0yO%>`Q$IUO1G0yO%@WQ$IUO1G0yO%@kQ(CjO<XOOQQ,5>Z,5>ZO%NUQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO%NZQ$IUO1G5{O>jQSO7+%YOOQ(CY<jQSO<jQSO7+)dO&5rQSO<{AN>{O%[QUOAN?XOOQO<SQSO7++uO%LgQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&>[QSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#MzQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&>dQSOANBTOOQQ<iQSOLD,jO&>qQ$IUO7+'tO&@gQ$IUO7+'vO&B]Q,UOG26|OOQO<YOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#@sOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#CQO#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,gO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#CQO!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,gO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,gO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ hOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!^Oz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#PO#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$nOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+dO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#CQOm!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ hO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!^O#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#PO#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,gO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#CQO#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,gO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,gOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$I|Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$JoO(d$ZO~P#,gO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,gO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,gO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,gO!Y$|O~P#,gO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%$nOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O'v#mO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#CQO#Y5lO!W#bi!X#bi~O!W![i!X![i~P#CQO_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$I|O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$JoO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,gOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#CQOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%2}O#h9zO~P%2}OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5YOl9|O~P%5YOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%7eOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%7eOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:PO(k#|O~P%:POP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%<[O(l#}O~P%<[OP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO(TVO(k#|O(l#}O~O#w#gi#z#gi(d#gi!W#gi!X#gi~P%>gO_#xy!W#xy'm#xy'k#xy!T#xy!h#xyp#xy!Y#xy%b#xy!b#xy~P!7zOh;mOz)vO})wO(k)yO(l){O~OP#giY#gil#gi{#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(T#gi(d#gi!W#gi!X#gi~P%A_O!g#wOP(SXY(SXh(SXl(SXz(SX{(SX}(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX#z(SX(T(SX(d(SX(k(SX(l(SX!W(SX!X(SX~O#z#{i!W#{i!X#{i~P#CQO#z!oi!X!oi~P$$nO!X6`O~O!W'[a!X'[a~P#CQO!b#uO(d'gO!W']a!h']a~O!W/VO!h(qi~O!W/VO!b#uO!h(qi~Oe$vq!W$vq#Y$vq#z$vq~P!0kO!T'_a!W'_a~P#,gO!b6gO~O!W/_O!T(ri~P#,gO!W/_O!T(ri~O!T6kO~O!b#uO#p6pO~Ol6qO!b#uO(d'gO~O!T6sO~Oe$xq!W$xq#Y$xq#z$xq~P!0kO_$jy!W$jy'm$jy'k$jy!T$jy!h$jyp$jy!Y$jy%b$jy!b$jy~P!7zO!b5kO~O!W4WO!Y(sa~O_#]y!W#]y'm#]y'k#]y!T#]y!h#]yp#]y!Y#]y%b#]y!b#]y~P!7zOY6xO~O!W0bO!X(zi~O^7OO~O(W(tO!W'dX!X'dX~O!W4nO!X(wa~OjkO'v7VO~P.iO!X7YO~P%$nOm!nO}7ZO'xTO'{UO(W!mO(c!sO~O!Y0zO~O!Y0zO%b7]O~Oh7`O!Y0zO%b7]O~OY7eO!W'ga!X'ga~O!W1VO!X(xi~O!h7iO~O!h7jO~O!h7mO~O!h7mO~P%[O_7oO~O!b7pO~O!h7qO~O!W(ii!X(ii~P#CQO_%gO#Y7yO'm%gO~O!W(fy!h(fy_(fy'm(fy~P!7zO!W(`O!h(ey~O!Y'VO%b7|O~O#e$vqP$vqY$vq_$vql$vq{$vq!W$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq'm$vq(T$vq(d$vq!h$vq!T$vq'k$vq#Y$vqp$vq!Y$vq%b$vq!b$vq~P#,gO#e$xqP$xqY$xq_$xql$xq{$xq!W$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq'm$xq(T$xq(d$xq!h$xq!T$xq'k$xq#Y$xqp$xq!Y$xq%b$xq!b$xq~P#,gO!W'Ri!h'Ri~P!7zO#z#]q!W#]q!X#]q~P#CQOz/yO{/yO}/zOPwaYwahwalwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa#zwa(Twa(dwa(kwa(lwa!Wwa!Xwa~Oz)vO})wOP$maY$mah$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma#z$ma(T$ma(d$ma(k$ma(l$ma!W$ma!X$ma~Oz)vO})wOP$oaY$oah$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa#z$oa(T$oa(d$oa(k$oa(l$oa!W$oa!X$oa~OP$}aY$}al$}a{$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a#z$}a(T$}a(d$}a!W$}a!X$}a~P%A_O#z$iq!W$iq!X$iq~P#CQO#z$jq!W$jq!X$jq~P#CQO!X8WO~O#z8XO~P!0kO!b#uO!W']i!h']i~O!b#uO(d'gO!W']i!h']i~O!W/VO!h(qq~O!T'_i!W'_i~P#,gO!W/_O!T(rq~O!T8_O~P#,gO!T8_O~Oe(Ry!W(Ry~P!0kO!W'ba!Y'ba~P#,gO_%Uq!Y%Uq'm%Uq!W%Uq~P#,gOY8dO~O!W0bO!X(zq~O#Y8hO!W'da!X'da~O!W4nO!X(wi~P#CQOPZXYZXlZXzZX{ZX}ZX!TZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!b%SX#p%SX~P&2_O!Y0zO%b8lO~O'xTO'{UO(W8qO~O!W1VO!X(xq~O!h8tO~O!h8uO~O!h8vO~O!h8vO~P%[O#Y8yO!W#by!X#by~O!W#by!X#by~P#CQO!Y'VO%b9OO~O#z#xy!W#xy!X#xy~P#CQOP$viY$vil$vi{$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi#z$vi(T$vi(d$vi!W$vi!X$vi~P%A_Oz)vO})wO(l){OP%YiY%Yih%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi#z%Yi(T%Yi(d%Yi(k%Yi!W%Yi!X%Yi~Oz)vO})wOP%[iY%[ih%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i#z%[i(T%[i(d%[i(k%[i(l%[i!W%[i!X%[i~O#z$jy!W$jy!X$jy~P#CQO#z#]y!W#]y!X#]y~P#CQO!b#uO!W']q!h']q~O!W/VO!h(qy~O!T'_q!W'_q~P#,gO!T9VO~P#,gO!W0bO!X(zy~O!W4nO!X(wq~O!Y0zO%b9^O~O!h9aO~O!Y'VO%b9fO~OP$vqY$vql$vq{$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq#z$vq(T$vq(d$vq!W$vq!X$vq~P%A_OP$xqY$xql$xq{$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq#z$xq(T$xq(d$xq!W$xq!X$xq~P%A_Oe%^!Z!W%^!Z#Y%^!Z#z%^!Z~P!0kO!W'dq!X'dq~P#CQO!W#b!Z!X#b!Z~P#CQO#e%^!ZP%^!ZY%^!Z_%^!Zl%^!Z{%^!Z!W%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z'm%^!Z(T%^!Z(d%^!Z!h%^!Z!T%^!Z'k%^!Z#Y%^!Zp%^!Z!Y%^!Z%b%^!Z!b%^!Z~P#,gOP%^!ZY%^!Zl%^!Z{%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z#z%^!Z(T%^!Z(d%^!Z!W%^!Z!X%^!Z~P%A_Op(XX~P1qO'w!lO~P!*SO!TdX!WdX#YdX~P&2_OPZXYZXlZXzZX{ZX}ZX!WZX!WdX!fZX!gZX!iZX!mZX#YZX#YdX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!bdX!hZX!hdX(ddX~P&GuOP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!YXO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O!W:VO!X$la~Oj%SOl$tOm$sOn$sOt%TOv%UOx:]O}${O!Y$|O!d;gO!i$xO#d:cO$R%YO$n:_O$p:aO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#q)]O~P&LkO!XZX!XdX~P&GuO#e9yO~O!b#uO#e9yO~O#Y:ZO~O#p:OO~O#Y:eO!W(iX!X(iX~O#Y:ZO!W(gX!X(gX~O#e:fO~Oe:hO~P!0kO#e:mO~O#e:nO~O!b#uO#e:oO~O!b#uO#e:fO~O#z:pO~P#CQO#e:qO~O#e:rO~O#e:sO~O#e:tO~O#e:uO~O#e:vO~O#z:wO~P!0kO#z:xO~P!0kO$V~!g!}#O#Q#R#U#c#d#o(p$n$p$s%V%a%b%c%j%l%o%p%r%t~'qR$V(p#i!S'o'w#jm#h#klz'p(W'p'v$X$Z$X~",goto:"$'R)OPPPP)PPP)SP)eP*t.xPPPP5YPP5pP;l>sP?WP?WPPP?WP@xP?WP?WP?WP@|PPARPAlPFdPPPFhPPPPFhIiPPPIoJjPFhPLxPPPP! WFhPPPFhPFhP!#fFhP!&z!'|!(VP!(y!(}!(yPPPPP!,Y!'|PP!,v!-pP!0dFhFh!0i!3s!8Y!8Y!wP#@W#@_#@gPPPP#Du#Gl#NT#NW#NZ$ S$ V$ Y$ a$ iPP$ o$ s$!k$#j$#n$$SPP$$W$$^$$bP$$e$$i$$l$%b$%y$&b$&f$&i$&l$&r$&u$&y$&}R!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:Wr,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[qr],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#Vr[O]||-1},{term:330,get:O=>jr[O]||-1},{term:68,get:O=>zr[O]||-1}],tokenPrec:12827}),NO=[P("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),P("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),P("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),P("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),P("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),P(`try { - \${} -} catch (\${error}) { - \${} -}`,{label:"try",detail:"/ catch block",type:"keyword"}),P("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),P(`if (\${}) { - \${} -} else { - \${} -}`,{label:"if",detail:"/ else block",type:"keyword"}),P(`class \${name} { - constructor(\${params}) { - \${} - } -}`,{label:"class",detail:"definition",type:"keyword"}),P('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),P('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Er=NO.concat([P("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),P("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),P("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),oO=new bO,BO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function G(O){return(e,a)=>{let t=e.node.getChild("VariableDefinition");return t&&a(t,O),!0}}const Ar=["FunctionDeclaration"],Ir={FunctionDeclaration:G("function"),ClassDeclaration:G("class"),ClassExpression:()=>!0,EnumDeclaration:G("constant"),TypeAliasDeclaration:G("type"),NamespaceDeclaration:G("namespace"),VariableDefinition(O,e){O.matchContext(Ar)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function DO(O,e){let a=oO.get(e);if(a)return a;let t=[],r=!0;function s(i,l){let o=O.sliceString(i.from,i.to);t.push({label:o,type:l})}return e.cursor(ve.IncludeAnonymous).iterate(i=>{if(r)r=!1;else if(i.name){let l=Ir[i.name];if(l&&l(i,s)||BO.has(i.name))return!1}else if(i.to-i.from>8192){for(let l of DO(O,i.node))t.push(l);return!1}}),oO.set(e,t),t}const cO=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,JO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function Nr(O){let e=j(O.state).resolveInner(O.pos,-1);if(JO.indexOf(e.name)>-1)return null;let a=e.name=="VariableName"||e.to-e.from<20&&cO.test(O.state.sliceDoc(e.from,e.to));if(!a&&!O.explicit)return null;let t=[];for(let r=e;r;r=r.parent)BO.has(r.name)&&(t=t.concat(DO(O.state.doc,r)));return{options:t,from:a?e.from:O.pos,validFor:cO}}const Y=J.define({name:"javascript",parser:Gr.configure({props:[L.add({IfStatement:C({except:/^\s*({|else\b)/}),TryStatement:C({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Rt,SwitchBody:O=>{let e=O.textAfter,a=/^\s*\}/.test(e),t=/^\s*(case|default)\b/.test(e);return O.baseIndent+(a?0:t?1:2)*O.unit},Block:qt({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":C({except:/^{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),F.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Te,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),LO={test:O=>/^JSX/.test(O.name),facet:Vt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},FO=Y.configure({dialect:"ts"},"typescript"),MO=Y.configure({dialect:"jsx",props:[yO.add(O=>O.isTop?[LO]:void 0)]}),KO=Y.configure({dialect:"jsx ts",props:[yO.add(O=>O.isTop?[LO]:void 0)]},"typescript");let HO=O=>({label:O,type:"keyword"});const et="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(HO),Br=et.concat(["declare","implements","private","protected","public"].map(HO));function Ot(O={}){let e=O.jsx?O.typescript?KO:MO:O.typescript?FO:Y,a=O.typescript?Er.concat(Br):NO.concat(et);return new M(e,[Y.data.of({autocomplete:XO(JO,xO(a))}),Y.data.of({autocomplete:Nr}),O.jsx?Lr:[]])}function Dr(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function QO(O,e,a=O.length){for(let t=e==null?void 0:e.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return O.sliceString(t.from,Math.min(t.to,a));return""}const Jr=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Lr=U.inputHandler.of((O,e,a,t,r)=>{if((Jr?O.composing:O.compositionStarted)||O.state.readOnly||e!=a||t!=">"&&t!="/"||!Y.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var Q;let{head:d}=o,c=j(i).resolveInner(d-1,-1),S;if(c.name=="JSXStartTag"&&(c=c.parent),!(i.doc.sliceString(d-1,d)!=t||c.name=="JSXAttributeValue"&&c.to>d)){if(t==">"&&c.name=="JSXFragmentTag")return{range:o,changes:{from:d,insert:""}};if(t=="/"&&c.name=="JSXStartCloseTag"){let p=c.parent,u=p.parent;if(u&&p.from==d-2&&((S=QO(i.doc,u.firstChild,d))||((Q=u.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let f=`${S}>`;return{range:YO.cursor(d+f.length,-1),changes:{from:d,insert:f}}}}else if(t==">"){let p=Dr(c);if(p&&!/^\/?>|^<\//.test(i.doc.sliceString(d,d+2))&&(S=QO(i.doc,p,d)))return{range:o,changes:{from:d,insert:``}}}}return{range:o}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),E=["_blank","_self","_top","_parent"],ge=["ascii","utf-8","utf-16","latin1","latin1"],me=["get","post","put","delete"],Pe=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],b=["true","false"],h={},Fr={a:{attrs:{href:null,ping:null,type:null,media:null,target:E,hreflang:null}},abbr:h,address:h,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:h,aside:h,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:h,base:{attrs:{href:null,target:E}},bdi:h,bdo:h,blockquote:{attrs:{cite:null}},body:h,br:h,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:E,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:h,center:h,cite:h,code:h,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:h,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:h,div:h,dl:h,dt:h,em:h,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:h,figure:h,footer:h,form:{attrs:{action:null,name:null,"accept-charset":ge,autocomplete:["on","off"],enctype:Pe,method:me,novalidate:["novalidate"],target:E}},h1:h,h2:h,h3:h,h4:h,h5:h,h6:h,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:h,hgroup:h,hr:h,html:{attrs:{manifest:null}},i:h,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Pe,formmethod:me,formnovalidate:["novalidate"],formtarget:E,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:h,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:h,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:h,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ge,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:h,noscript:h,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:h,param:{attrs:{name:null,value:null}},pre:h,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:h,rt:h,ruby:h,samp:h,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ge}},section:h,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:h,source:{attrs:{src:null,type:null,media:null}},span:h,strong:h,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:h,summary:h,sup:h,table:h,tbody:h,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:h,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:h,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:h,time:{attrs:{datetime:null}},title:h,tr:h,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:h,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:h},tt={accesskey:null,class:null,contenteditable:b,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:b,autocorrect:b,autocapitalize:b,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":b,"aria-autocomplete":["inline","list","both","none"],"aria-busy":b,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":b,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":b,"aria-hidden":b,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":b,"aria-multiselectable":b,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":b,"aria-relevant":null,"aria-required":b,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},at="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(O=>"on"+O);for(let O of at)tt[O]=null;class Qe{constructor(e,a){this.tags=Object.assign(Object.assign({},Fr),e),this.globalAttrs=Object.assign(Object.assign({},tt),a),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Qe.default=new Qe;function q(O,e,a=O.length){if(!e)return"";let t=e.firstChild,r=t&&t.getChild("TagName");return r?O.sliceString(r.from,Math.min(r.to,a)):""}function V(O,e=!1){for(;O;O=O.parent)if(O.name=="Element")if(e)e=!1;else return O;return null}function rt(O,e,a){let t=a.tags[q(O,V(e))];return(t==null?void 0:t.children)||a.allTags}function Ue(O,e){let a=[];for(let t=V(e);t&&!t.type.isTop;t=V(t.parent)){let r=q(O,t);if(r&&t.lastChild.name=="CloseTag")break;r&&a.indexOf(r)<0&&(e.name=="EndTag"||e.from>=t.firstChild.to)&&a.push(r)}return a}const it=/^[:\-\.\w\u00b7-\uffff]*$/;function pO(O,e,a,t,r){let s=/\s*>/.test(O.sliceDoc(r,r+5))?"":">",i=V(a,!0);return{from:t,to:r,options:rt(O.doc,i,e).map(l=>({label:l,type:"type"})).concat(Ue(O.doc,a).map((l,o)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-o}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function dO(O,e,a,t){let r=/\s*>/.test(O.sliceDoc(t,t+5))?"":">";return{from:a,to:t,options:Ue(O.doc,e).map((s,i)=>({label:s,apply:s+r,type:"type",boost:99-i})),validFor:it}}function Mr(O,e,a,t){let r=[],s=0;for(let i of rt(O.doc,a,e))r.push({label:"<"+i,type:"type"});for(let i of Ue(O.doc,a))r.push({label:"",type:"type",boost:99-s++});return{from:t,to:t,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Kr(O,e,a,t,r){let s=V(a),i=s?e.tags[q(O.doc,s)]:null,l=i&&i.attrs?Object.keys(i.attrs):[],o=i&&i.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:t,to:r,options:o.map(Q=>({label:Q,type:"property"})),validFor:it}}function Hr(O,e,a,t,r){var s;let i=(s=a.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],o;if(i){let Q=O.sliceDoc(i.from,i.to),d=e.globalAttrs[Q];if(!d){let c=V(a),S=c?e.tags[q(O.doc,c)]:null;d=(S==null?void 0:S.attrs)&&S.attrs[Q]}if(d){let c=O.sliceDoc(t,r).toLowerCase(),S='"',p='"';/^['"]/.test(c)?(o=c[0]=='"'?/^[^"]*$/:/^[^']*$/,S="",p=O.sliceDoc(r,r+1)==c[0]?"":c[0],c=c.slice(1),t++):o=/^[^\s<>='"]*$/;for(let u of d)l.push({label:u,apply:S+u+p,type:"constant"})}}return{from:t,to:r,options:l,validFor:o}}function ei(O,e){let{state:a,pos:t}=e,r=j(a).resolveInner(t,-1),s=r.resolve(t);for(let i=t,l;s==r&&(l=r.childBefore(i));){let o=l.lastChild;if(!o||!o.type.isError||o.fromei(t,r)}const ti=Y.parser.configure({top:"SingleExpression"}),st=[{tag:"script",attrs:O=>O.type=="text/typescript"||O.lang=="ts",parser:FO.parser},{tag:"script",attrs:O=>O.type=="text/babel"||O.type=="text/jsx",parser:MO.parser},{tag:"script",attrs:O=>O.type=="text/typescript-jsx",parser:KO.parser},{tag:"script",attrs:O=>O.type=="importmap"||O.type=="speculationrules",parser:ti},{tag:"script",attrs(O){return!O.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(O.type)},parser:Y.parser},{tag:"style",attrs(O){return(!O.lang||O.lang=="css")&&(!O.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(O.type))},parser:ce.parser}],lt=[{name:"style",parser:ce.parser.configure({top:"Styles"})}].concat(at.map(O=>({name:O,parser:Y.parser}))),nt=J.define({name:"html",parser:Ja.configure({props:[L.add({Element(O){let e=/^(\s*)(<\/)?/.exec(O.textAfter);return O.node.to<=O.pos+e[0].length?O.continue():O.lineIndent(O.node.from)+(e[2]?0:O.unit)},"OpenTag CloseTag SelfClosingTag"(O){return O.column(O.node.from)+O.unit},Document(O){if(O.pos+/\s*/.exec(O.textAfter)[0].lengthO.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),ae=nt.configure({wrap:zO(st,lt)});function ai(O={}){let e="",a;O.matchClosingTags===!1&&(e="noMatch"),O.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(O.nestedLanguages&&O.nestedLanguages.length||O.nestedAttributes&&O.nestedAttributes.length)&&(a=zO((O.nestedLanguages||[]).concat(st),(O.nestedAttributes||[]).concat(lt)));let t=a?nt.configure({wrap:a,dialect:e}):e?ae.configure({dialect:e}):ae;return new M(t,[ae.data.of({autocomplete:Oi(O)}),O.autoCloseTags!==!1?ri:[],Ot().support,mr().support])}const hO=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),ri=U.inputHandler.of((O,e,a,t,r)=>{if(O.composing||O.state.readOnly||e!=a||t!=">"&&t!="/"||!ae.isActiveAt(O.state,e,-1))return!1;let s=r(),{state:i}=s,l=i.changeByRange(o=>{var Q,d,c;let S=i.doc.sliceString(o.from-1,o.to)==t,{head:p}=o,u=j(i).resolveInner(p-1,-1),f;if((u.name=="TagName"||u.name=="StartTag")&&(u=u.parent),S&&t==">"&&u.name=="OpenTag"){if(((d=(Q=u.parent)===null||Q===void 0?void 0:Q.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(f=q(i.doc,u.parent,p))&&!hO.has(f)){let g=p+(i.doc.sliceString(p,p+1)===">"?1:0),X=``;return{range:o,changes:{from:p,to:g,insert:X}}}}else if(S&&t=="/"&&u.name=="IncompleteCloseTag"){let g=u.parent;if(u.from==p-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(f=q(i.doc,g,p))&&!hO.has(f)){let X=p+(i.doc.sliceString(p,p+1)===">"?1:0),y=`${f}>`;return{range:YO.cursor(p+y.length,-1),changes:{from:p,to:X,insert:y}}}}return{range:o}});return l.changes.empty?!1:(O.dispatch([s,i.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),ii=D({String:n.string,Number:n.number,"True False":n.bool,PropertyName:n.propertyName,Null:n.null,",":n.separator,"[ ]":n.squareBracket,"{ }":n.brace}),si=T.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[ii],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),li=J.define({name:"json",parser:si.configure({props:[L.add({Object:C({except:/^\s*\}/}),Array:C({except:/^\s*\]/})}),F.add({"Object Array":Te})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function ni(){return new M(li)}const oi=36,uO=1,ci=2,A=3,Ze=4,Qi=5,pi=6,di=7,hi=8,ui=9,Si=10,$i=11,fi=12,gi=13,mi=14,Pi=15,Zi=16,bi=17,SO=18,Xi=19,ot=20,ct=21,$O=22,xi=23,Yi=24;function Ye(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function yi(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function W(O,e,a){for(let t=!1;;){if(O.next<0)return;if(O.next==e&&!t){O.advance();return}t=a&&!t&&O.next==92,O.advance()}}function ki(O){for(;;){if(O.next<0||O.peek(1)<0)return;if(O.next==36&&O.peek(1)==36){O.advance(2);return}O.advance()}}function wi(O,e){let a="[{<(".indexOf(String.fromCharCode(e)),t=a<0?e:"]}>)".charCodeAt(a);for(;;){if(O.next<0)return;if(O.next==t&&O.peek(1)==39){O.advance(2);return}O.advance()}}function Qt(O,e){for(;!(O.next!=95&&!Ye(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function vi(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),W(O,e,!1)}else Qt(O)}function fO(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function gO(O,e){for(;;){if(O.next==46){if(e)break;e=!0}else if(O.next<48||O.next>57)break;O.advance()}if(O.next==69||O.next==101)for(O.advance(),(O.next==43||O.next==45)&&O.advance();O.next>=48&&O.next<=57;)O.advance()}function mO(O){for(;!(O.next<0||O.next==10);)O.advance()}function _(O,e){for(let a=0;a!=&|~^/",specialVar:"?",identifierQuotes:'"',words:pt(_i,Ti)};function Wi(O,e,a,t){let r={};for(let s in ye)r[s]=(O.hasOwnProperty(s)?O:ye)[s];return e&&(r.words=pt(e,a||"",t)),r}function dt(O){return new x(e=>{var a;let{next:t}=e;if(e.advance(),_(t,be)){for(;_(e.next,be);)e.advance();e.acceptToken(oi)}else if(t==36&&e.next==36&&O.doubleDollarQuotedStrings)ki(e),e.acceptToken(A);else if(t==39||t==34&&O.doubleQuotedStrings)W(e,t,O.backslashEscapes),e.acceptToken(A);else if(t==35&&O.hashComments||t==47&&e.next==47&&O.slashComments)mO(e),e.acceptToken(uO);else if(t==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))mO(e),e.acceptToken(uO);else if(t==47&&e.next==42){e.advance();for(let r=1;;){let s=e.next;if(e.next<0)break;if(e.advance(),s==42&&e.next==47){if(r--,e.advance(),!r)break}else s==47&&e.next==42&&(r++,e.advance())}e.acceptToken(ci)}else if((t==101||t==69)&&e.next==39)e.advance(),W(e,39,!0);else if((t==110||t==78)&&e.next==39&&O.charSetCasts)e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(A);else if(t==95&&O.charSetCasts)for(let r=0;;r++){if(e.next==39&&r>1){e.advance(),W(e,39,O.backslashEscapes),e.acceptToken(A);break}if(!Ye(e.next))break;e.advance()}else if(O.plsqlQuotingMechanism&&(t==113||t==81)&&e.next==39&&e.peek(1)>0&&!_(e.peek(1),be)){let r=e.peek(1);e.advance(2),wi(e,r),e.acceptToken(A)}else if(t==40)e.acceptToken(di);else if(t==41)e.acceptToken(hi);else if(t==123)e.acceptToken(ui);else if(t==125)e.acceptToken(Si);else if(t==91)e.acceptToken($i);else if(t==93)e.acceptToken(fi);else if(t==59)e.acceptToken(gi);else if(O.unquotedBitLiterals&&t==48&&e.next==98)e.advance(),fO(e),e.acceptToken($O);else if((t==98||t==66)&&(e.next==39||e.next==34)){const r=e.next;e.advance(),O.treatBitsAsBytes?(W(e,r,O.backslashEscapes),e.acceptToken(xi)):(fO(e,r),e.acceptToken($O))}else if(t==48&&(e.next==120||e.next==88)||(t==120||t==88)&&e.next==39){let r=e.next==39;for(e.advance();yi(e.next);)e.advance();r&&e.next==39&&e.advance(),e.acceptToken(Ze)}else if(t==46&&e.next>=48&&e.next<=57)gO(e,!0),e.acceptToken(Ze);else if(t==46)e.acceptToken(mi);else if(t>=48&&t<=57)gO(e,!1),e.acceptToken(Ze);else if(_(t,O.operatorChars)){for(;_(e.next,O.operatorChars);)e.advance();e.acceptToken(Pi)}else if(_(t,O.specialVar))e.next==t&&e.advance(),vi(e),e.acceptToken(bi);else if(_(t,O.identifierQuotes))W(e,t,!1),e.acceptToken(Xi);else if(t==58||t==44)e.acceptToken(Zi);else if(Ye(t)){let r=Qt(e,String.fromCharCode(t));e.acceptToken(e.next==46?SO:(a=O.words[r.toLowerCase()])!==null&&a!==void 0?a:SO)}})}const ht=dt(ye),Ui=T.deserialize({version:14,states:"%vQ]QQOOO#wQRO'#DSO$OQQO'#CwO%eQQO'#CxO%lQQO'#CyO%sQQO'#CzOOQQ'#DS'#DSOOQQ'#C}'#C}O'UQRO'#C{OOQQ'#Cv'#CvOOQQ'#C|'#C|Q]QQOOQOQQOOO'`QQO'#DOO(xQRO,59cO)PQQO,59cO)UQQO'#DSOOQQ,59d,59dO)cQQO,59dOOQQ,59e,59eO)jQQO,59eOOQQ,59f,59fO)qQQO,59fOOQQ-E6{-E6{OOQQ,59b,59bOOQQ-E6z-E6zOOQQ,59j,59jOOQQ-E6|-E6|O+VQRO1G.}O+^QQO,59cOOQQ1G/O1G/OOOQQ1G/P1G/POOQQ1G/Q1G/QP+kQQO'#C}O+rQQO1G.}O)PQQO,59cO,PQQO'#Cw",stateData:",[~OtOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O^]ORvXSvXTvXUvXVvXXvXZvX]vX_vX`vXavXbvXcvXdvXevXfvXgvXhvX~OsvX~P!jOa_Ob_Oc_O~ORUOSUOTUOUUOVROXSOZTO^tO_UO`UOa`Ob`Oc`OdUOeUOfUOgUOhUO~OWaO~P$ZOYcO~P$ZO[eO~P$ZORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUOgUOhUO~O]hOsoX~P%zOajObjOcjO~O^]ORkaSkaTkaUkaVkaXkaZka]ka_ka`kaakabkackadkaekafkagkahka~Oska~P'kO^]O~OWvXYvX[vX~P!jOWnO~P$ZOYoO~P$ZO[pO~P$ZO^]ORkiSkiTkiUkiVkiXkiZki]ki_ki`kiakibkickidkiekifkigkihki~Oski~P)xOWkaYka[ka~P'kO]hO~P$ZOWkiYki[ki~P)xOasObsOcsO~O",goto:"#hwPPPPPPPPPPPPPPPPPPPPPPPPPPx||||!Y!^!d!xPPP#[TYOZeUORSTWZbdfqT[OZQZORiZSWOZQbRQdSQfTZgWbdfqQ^PWk^lmrQl_Qm`RrseVORSTWZbdfq",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) { } [ ] ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Bits Bytes Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:38,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,ht],topRules:{Script:[0,25]},tokenPrec:0});function ke(O){let e=O.cursor().moveTo(O.from,-1);for(;/Comment/.test(e.name);)e.moveTo(e.from,-1);return e.node}function N(O,e){let a=O.sliceString(e.from,e.to),t=/^([`'"])(.*)\1$/.exec(a);return t?t[2]:a}function pe(O){return O&&(O.name=="Identifier"||O.name=="QuotedIdentifier")}function Ci(O,e){if(e.name=="CompositeIdentifier"){let a=[];for(let t=e.firstChild;t;t=t.nextSibling)pe(t)&&a.push(N(O,t));return a}return[N(O,e)]}function PO(O,e){for(let a=[];;){if(!e||e.name!=".")return a;let t=ke(e);if(!pe(t))return a;a.unshift(N(O,t)),e=ke(t)}}function Ri(O,e){let a=j(O).resolveInner(e,-1),t=Vi(O.doc,a);return a.name=="Identifier"||a.name=="QuotedIdentifier"||a.name=="Keyword"?{from:a.from,quoted:a.name=="QuotedIdentifier"?O.doc.sliceString(a.from,a.from+1):null,parents:PO(O.doc,ke(a)),aliases:t}:a.name=="."?{from:e,quoted:null,parents:PO(O.doc,a),aliases:t}:{from:e,quoted:null,parents:[],empty:!0,aliases:t}}const qi=new Set("where group having order union intersect except all distinct limit offset fetch for".split(" "));function Vi(O,e){let a;for(let r=e;!a;r=r.parent){if(!r)return null;r.name=="Statement"&&(a=r)}let t=null;for(let r=a.firstChild,s=!1,i=null;r;r=r.nextSibling){let l=r.name=="Keyword"?O.sliceString(r.from,r.to).toLowerCase():null,o=null;if(!s)s=l=="from";else if(l=="as"&&i&&pe(r.nextSibling))o=N(O,r.nextSibling);else{if(l&&qi.has(l))break;i&&pe(r)&&(o=N(O,r))}o&&(t||(t=Object.create(null)),t[o]=Ci(O,i)),i=/Identifier$/.test(r.name)?r:null}return t}function ji(O,e){return O?e.map(a=>Object.assign(Object.assign({},a),{label:O+a.label+O,apply:void 0})):e}const zi=/^\w*$/,Gi=/^[`'"]?\w*[`'"]?$/;class Ce{constructor(){this.list=[],this.children=void 0}child(e,a){let t=this.children||(this.children=Object.create(null)),r=t[e];return r||(e&&this.list.push(ut(e,"type",a)),t[e]=new Ce)}addCompletions(e){for(let a of e){let t=this.list.findIndex(r=>r.label==a.label);t>-1?this.list[t]=a:this.list.push(a)}}}function ut(O,e,a){return/[^\w\xb5-\uffff]/.test(O)?{label:O,type:e,apply:a+O+a}:{label:O,type:e}}function Ei(O,e,a,t,r,s){var i;let l=new Ce,o=((i=s==null?void 0:s.spec.identifierQuotes)===null||i===void 0?void 0:i[0])||'"',Q=l.child(r||"",o);for(let d in O){let c=d.replace(/\\?\./g,p=>p=="."?"\0":p).split("\0"),S=c.length==1?Q:l;for(let p of c)S=S.child(p.replace(/\\\./g,"."),o);for(let p of O[d])p&&S.list.push(typeof p=="string"?ut(p,"property",o):p)}return e&&Q.addCompletions(e),a&&l.addCompletions(a),l.addCompletions(Q.list),t&&l.addCompletions(Q.child(t,o).list),d=>{let{parents:c,from:S,quoted:p,empty:u,aliases:f}=Ri(d.state,d.pos);if(u&&!d.explicit)return null;f&&c.length==1&&(c=f[c[0]]||c);let g=l;for(let w of c){for(;!g.children||!g.children[w];)if(g==l)g=Q;else if(g==Q&&t)g=g.child(t,o);else return null;g=g.child(w,o)}let X=p&&d.state.sliceDoc(d.pos,d.pos+1)==p,y=g.list;return g==l&&f&&(y=y.concat(Object.keys(f).map(w=>({label:w,type:"constant"})))),{from:S,to:X?d.pos+1:void 0,options:ji(p,y),validFor:p?Gi:zi}}}function Ai(O,e){let a=Object.keys(O).map(t=>({label:e?t.toUpperCase():t,type:O[t]==ct?"type":O[t]==ot?"keyword":"variable",boost:-1}));return XO(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],xO(a))}let Ii=Ui.configure({props:[L.add({Statement:C()}),F.add({Statement(O){return{from:O.firstChild.to,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}}),D({Keyword:n.keyword,Type:n.typeName,Builtin:n.standard(n.name),Bits:n.number,Bytes:n.string,Bool:n.bool,Null:n.null,Number:n.number,String:n.string,Identifier:n.name,QuotedIdentifier:n.special(n.string),SpecialVar:n.special(n.name),LineComment:n.lineComment,BlockComment:n.blockComment,Operator:n.operator,"Semi Punctuation":n.punctuation,"( )":n.paren,"{ }":n.brace,"[ ]":n.squareBracket})]});class B{constructor(e,a,t){this.dialect=e,this.language=a,this.spec=t}get extension(){return this.language.extension}static define(e){let a=Wi(e,e.keywords,e.types,e.builtin),t=J.define({name:"sql",parser:Ii.configure({tokenizers:[{from:ht,to:dt(a)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new B(a,t,e)}}function Ni(O,e=!1){return Ai(O.dialect.words,e)}function Bi(O,e=!1){return O.language.data.of({autocomplete:Ni(O,e)})}function Di(O){return O.schema?Ei(O.schema,O.tables,O.schemas,O.defaultTable,O.defaultSchema,O.dialect||Re):()=>null}function Ji(O){return O.schema?(O.dialect||Re).language.data.of({autocomplete:Di(O)}):[]}function ZO(O={}){let e=O.dialect||Re;return new M(e.language,[Ji(O),Bi(e,!!O.upperCaseKeywords)])}const Re=B.define({});function Li(O){let e;return{c(){e=Pt("div"),Zt(e,"class","code-editor"),K(e,"min-height",O[0]?O[0]+"px":null),K(e,"max-height",O[1]?O[1]+"px":"auto")},m(a,t){bt(a,e,t),O[11](e)},p(a,[t]){t&1&&K(e,"min-height",a[0]?a[0]+"px":null),t&2&&K(e,"max-height",a[1]?a[1]+"px":"auto")},i:ze,o:ze,d(a){a&&Xt(e),O[11](null)}}}function Fi(O,e,a){let t;xt(O,Yt,$=>a(12,t=$));const r=yt();let{id:s=""}=e,{value:i=""}=e,{minHeight:l=null}=e,{maxHeight:o=null}=e,{disabled:Q=!1}=e,{placeholder:d=""}=e,{language:c="javascript"}=e,{singleLine:S=!1}=e,p,u,f=new H,g=new H,X=new H,y=new H;function w(){p==null||p.focus()}function St(){u==null||u.dispatchEvent(new CustomEvent("change",{detail:{value:i},bubbles:!0})),r("change",i)}function qe(){if(!s)return;const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.removeEventListener("click",w)}function Ve(){if(!s)return;qe();const $=document.querySelectorAll('[for="'+s+'"]');for(let m of $)m.addEventListener("click",w)}function je(){switch(c){case"html":return ai();case"json":return ni();case"sql-create-index":return ZO({dialect:B.define({keywords:"create unique index if not exists on collate asc desc where like isnull notnull date time datetime unixepoch strftime lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),upperCaseKeywords:!0});case"sql-select":let $={};for(let m of t)$[m.name]=wt.getAllCollectionIdentifiers(m);return ZO({dialect:B.define({keywords:"select distinct from where having group by order limit offset join left right inner with like not in match asc desc regexp isnull notnull glob count avg sum min max current random cast as int real text date time datetime unixepoch strftime coalesce lower upper substr case when then iif if else json_extract json_each json_tree json_array_length json_valid ",operatorChars:"*+-%<>!=&|/~",identifierQuotes:'`"',specialVar:"@:?$"}),schema:$,upperCaseKeywords:!0});default:return Ot()}}kt(()=>{const $={key:"Enter",run:m=>{S&&r("submit",i)}};return Ve(),a(10,p=new U({parent:u,state:z.create({doc:i,extensions:[zt(),Gt(),Et(),At(),It(),z.allowMultipleSelections.of(!0),Nt(Bt,{fallback:!0}),Dt(),Jt(),Lt(),Ft(),Mt.of([$,...Kt,...Ht,ea.find(m=>m.key==="Mod-d"),...Oa,...ta]),U.lineWrapping,aa({icons:!1}),f.of(je()),y.of(Ge(d)),g.of(U.editable.of(!0)),X.of(z.readOnly.of(!1)),z.transactionFilter.of(m=>S&&m.newDoc.lines>1?[]:m),U.updateListener.of(m=>{!m.docChanged||Q||(a(3,i=m.state.doc.toString()),St())})]})})),()=>{qe(),p==null||p.destroy()}});function $t($){vt[$?"unshift":"push"](()=>{u=$,a(2,u)})}return O.$$set=$=>{"id"in $&&a(4,s=$.id),"value"in $&&a(3,i=$.value),"minHeight"in $&&a(0,l=$.minHeight),"maxHeight"in $&&a(1,o=$.maxHeight),"disabled"in $&&a(5,Q=$.disabled),"placeholder"in $&&a(6,d=$.placeholder),"language"in $&&a(7,c=$.language),"singleLine"in $&&a(8,S=$.singleLine)},O.$$.update=()=>{O.$$.dirty&16&&s&&Ve(),O.$$.dirty&1152&&p&&c&&p.dispatch({effects:[f.reconfigure(je())]}),O.$$.dirty&1056&&p&&typeof Q<"u"&&p.dispatch({effects:[g.reconfigure(U.editable.of(!Q)),X.reconfigure(z.readOnly.of(Q))]}),O.$$.dirty&1032&&p&&i!=p.state.doc.toString()&&p.dispatch({changes:{from:0,to:p.state.doc.length,insert:i}}),O.$$.dirty&1088&&p&&typeof d<"u"&&p.dispatch({effects:[y.reconfigure(Ge(d))]})},[l,o,u,i,s,Q,d,c,S,w,p,$t]}class Hi extends ft{constructor(e){super(),gt(this,e,Fi,Li,mt,{id:4,value:3,minHeight:0,maxHeight:1,disabled:5,placeholder:6,language:7,singleLine:8,focus:9})}get focus(){return this.$$.ctx[9]}}export{Hi as default}; diff --git a/ui/dist/assets/ConfirmEmailChangeDocs-0dc32323.js b/ui/dist/assets/ConfirmEmailChangeDocs-88a7323c.js similarity index 97% rename from ui/dist/assets/ConfirmEmailChangeDocs-0dc32323.js rename to ui/dist/assets/ConfirmEmailChangeDocs-88a7323c.js index 55403b9b..3117d545 100644 --- a/ui/dist/assets/ConfirmEmailChangeDocs-0dc32323.js +++ b/ui/dist/assets/ConfirmEmailChangeDocs-88a7323c.js @@ -1,4 +1,4 @@ -import{S as $e,i as Pe,s as Se,O as Y,e as r,w as v,b as k,c as ge,f as b,g as d,h as o,m as ve,x as j,P as ue,Q as we,k as Oe,R as Re,n as Te,t as x,a as ee,o as m,d as Ce,C as ye,p as Ee,r as H,u as Be,N as qe}from"./index-7d33ef4c.js";import{S as Ae}from"./SdkTabs-f0532e58.js";function be(n,l,s){const a=n.slice();return a[5]=l[s],a}function _e(n,l,s){const a=n.slice();return a[5]=l[s],a}function he(n,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),o(s,_),o(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ke(n,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){s=r("div"),ge(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),ve(a,s,null),o(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(x(a.$$.fragment,i),u=!0)},o(i){ee(a.$$.fragment,i),u=!1},d(i){i&&m(s),Ce(a)}}}function Ue(n){var de,me;let l,s,a=n[0].name+"",_,u,i,p,f,C,$,D=n[0].name+"",F,te,I,P,L,R,Q,S,N,le,K,T,se,z,M=n[0].name+"",G,ae,J,y,V,E,X,B,Z,w,q,g=[],ne=new Map,oe,A,h=[],ie=new Map,O;P=new Ae({props:{js:` +import{S as $e,i as Pe,s as Se,O as Y,e as r,w as v,b as k,c as ge,f as b,g as d,h as o,m as ve,x as j,P as ue,Q as we,k as Oe,R as Re,n as Te,t as x,a as ee,o as m,d as Ce,C as ye,p as Ee,r as H,u as Be,N as qe}from"./index-6c8f1731.js";import{S as Ae}from"./SdkTabs-821a5c7e.js";function be(n,l,s){const a=n.slice();return a[5]=l[s],a}function _e(n,l,s){const a=n.slice();return a[5]=l[s],a}function he(n,l){let s,a=l[5].code+"",_,u,i,p;function f(){return l[4](l[5])}return{key:n,first:null,c(){s=r("button"),_=v(a),u=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(C,$){d(C,s,$),o(s,_),o(s,u),i||(p=Be(s,"click",f),i=!0)},p(C,$){l=C,$&4&&a!==(a=l[5].code+"")&&j(_,a),$&6&&H(s,"active",l[1]===l[5].code)},d(C){C&&m(s),i=!1,p()}}}function ke(n,l){let s,a,_,u;return a=new qe({props:{content:l[5].body}}),{key:n,first:null,c(){s=r("div"),ge(a.$$.fragment),_=k(),b(s,"class","tab-item"),H(s,"active",l[1]===l[5].code),this.first=s},m(i,p){d(i,s,p),ve(a,s,null),o(s,_),u=!0},p(i,p){l=i;const f={};p&4&&(f.content=l[5].body),a.$set(f),(!u||p&6)&&H(s,"active",l[1]===l[5].code)},i(i){u||(x(a.$$.fragment,i),u=!0)},o(i){ee(a.$$.fragment,i),u=!1},d(i){i&&m(s),Ce(a)}}}function Ue(n){var de,me;let l,s,a=n[0].name+"",_,u,i,p,f,C,$,D=n[0].name+"",F,te,I,P,L,R,Q,S,N,le,K,T,se,z,M=n[0].name+"",G,ae,J,y,V,E,X,B,Z,w,q,g=[],ne=new Map,oe,A,h=[],ie=new Map,O;P=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/ConfirmPasswordResetDocs-ea85ce68.js b/ui/dist/assets/ConfirmPasswordResetDocs-0d3db4a6.js similarity index 98% rename from ui/dist/assets/ConfirmPasswordResetDocs-ea85ce68.js rename to ui/dist/assets/ConfirmPasswordResetDocs-0d3db4a6.js index 20da16e3..716e8b35 100644 --- a/ui/dist/assets/ConfirmPasswordResetDocs-ea85ce68.js +++ b/ui/dist/assets/ConfirmPasswordResetDocs-0d3db4a6.js @@ -1,4 +1,4 @@ -import{S as Re,i as Oe,s as Ce,O as K,e as r,w,b as h,c as ge,f as b,g as d,h as n,m as Pe,x as U,P as _e,Q as Ne,k as We,R as $e,n as Ee,t as ee,a as te,o as p,d as Se,C as ye,p as Ae,r as j,u as Te,N as De}from"./index-7d33ef4c.js";import{S as qe}from"./SdkTabs-f0532e58.js";function ke(o,s,l){const a=o.slice();return a[5]=s[l],a}function he(o,s,l){const a=o.slice();return a[5]=s[l],a}function ve(o,s){let l,a=s[5].code+"",_,u,i,f;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=w(a),u=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(g,P){d(g,l,P),n(l,_),n(l,u),i||(f=Te(l,"click",m),i=!0)},p(g,P){s=g,P&4&&a!==(a=s[5].code+"")&&U(_,a),P&6&&j(l,"active",s[1]===s[5].code)},d(g){g&&p(l),i=!1,f()}}}function we(o,s){let l,a,_,u;return a=new De({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ge(a.$$.fragment),_=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(i,f){d(i,l,f),Pe(a,l,null),n(l,_),u=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[5].body),a.$set(m),(!u||f&6)&&j(l,"active",s[1]===s[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&p(l),Se(a)}}}function Be(o){var fe,me;let s,l,a=o[0].name+"",_,u,i,f,m,g,P,q=o[0].name+"",H,se,le,L,Q,S,z,N,G,R,B,ae,M,W,ne,J,F=o[0].name+"",V,oe,X,$,Y,E,Z,y,x,O,A,v=[],ie=new Map,ce,T,k=[],re=new Map,C;S=new qe({props:{js:` +import{S as Re,i as Oe,s as Ce,O as K,e as r,w,b as h,c as ge,f as b,g as d,h as n,m as Pe,x as U,P as _e,Q as Ne,k as We,R as $e,n as Ee,t as ee,a as te,o as p,d as Se,C as ye,p as Ae,r as j,u as Te,N as De}from"./index-6c8f1731.js";import{S as qe}from"./SdkTabs-821a5c7e.js";function ke(o,s,l){const a=o.slice();return a[5]=s[l],a}function he(o,s,l){const a=o.slice();return a[5]=s[l],a}function ve(o,s){let l,a=s[5].code+"",_,u,i,f;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=w(a),u=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(g,P){d(g,l,P),n(l,_),n(l,u),i||(f=Te(l,"click",m),i=!0)},p(g,P){s=g,P&4&&a!==(a=s[5].code+"")&&U(_,a),P&6&&j(l,"active",s[1]===s[5].code)},d(g){g&&p(l),i=!1,f()}}}function we(o,s){let l,a,_,u;return a=new De({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ge(a.$$.fragment),_=h(),b(l,"class","tab-item"),j(l,"active",s[1]===s[5].code),this.first=l},m(i,f){d(i,l,f),Pe(a,l,null),n(l,_),u=!0},p(i,f){s=i;const m={};f&4&&(m.content=s[5].body),a.$set(m),(!u||f&6)&&j(l,"active",s[1]===s[5].code)},i(i){u||(ee(a.$$.fragment,i),u=!0)},o(i){te(a.$$.fragment,i),u=!1},d(i){i&&p(l),Se(a)}}}function Be(o){var fe,me;let s,l,a=o[0].name+"",_,u,i,f,m,g,P,q=o[0].name+"",H,se,le,L,Q,S,z,N,G,R,B,ae,M,W,ne,J,F=o[0].name+"",V,oe,X,$,Y,E,Z,y,x,O,A,v=[],ie=new Map,ce,T,k=[],re=new Map,C;S=new qe({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/ConfirmVerificationDocs-a6b36296.js b/ui/dist/assets/ConfirmVerificationDocs-4e703cc5.js similarity index 97% rename from ui/dist/assets/ConfirmVerificationDocs-a6b36296.js rename to ui/dist/assets/ConfirmVerificationDocs-4e703cc5.js index d3d069f6..6a208086 100644 --- a/ui/dist/assets/ConfirmVerificationDocs-a6b36296.js +++ b/ui/dist/assets/ConfirmVerificationDocs-4e703cc5.js @@ -1,4 +1,4 @@ -import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-7d33ef4c.js";import{S as Ae}from"./SdkTabs-f0532e58.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` +import{S as Se,i as Te,s as Be,O as D,e as r,w as g,b as k,c as ye,f as h,g as f,h as n,m as Ce,x as H,P as ke,Q as Re,k as qe,R as Oe,n as Ee,t as x,a as ee,o as d,d as Pe,C as Ne,p as Ve,r as F,u as Ke,N as Me}from"./index-6c8f1731.js";import{S as Ae}from"./SdkTabs-821a5c7e.js";function ve(o,l,s){const a=o.slice();return a[5]=l[s],a}function ge(o,l,s){const a=o.slice();return a[5]=l[s],a}function we(o,l){let s,a=l[5].code+"",b,m,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),b=g(a),m=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(w,$){f(w,s,$),n(s,b),n(s,m),i||(p=Ke(s,"click",u),i=!0)},p(w,$){l=w,$&4&&a!==(a=l[5].code+"")&&H(b,a),$&6&&F(s,"active",l[1]===l[5].code)},d(w){w&&d(s),i=!1,p()}}}function $e(o,l){let s,a,b,m;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ye(a.$$.fragment),b=k(),h(s,"class","tab-item"),F(s,"active",l[1]===l[5].code),this.first=s},m(i,p){f(i,s,p),Ce(a,s,null),n(s,b),m=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),a.$set(u),(!m||p&6)&&F(s,"active",l[1]===l[5].code)},i(i){m||(x(a.$$.fragment,i),m=!0)},o(i){ee(a.$$.fragment,i),m=!1},d(i){i&&d(s),Pe(a)}}}function Ue(o){var fe,de,pe,ue;let l,s,a=o[0].name+"",b,m,i,p,u,w,$,K=o[0].name+"",I,te,L,y,Q,T,z,C,M,le,A,B,se,G,U=o[0].name+"",J,ae,W,R,X,q,Y,O,Z,P,E,v=[],oe=new Map,ne,N,_=[],ie=new Map,S;y=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/CreateApiDocs-0d934784.js b/ui/dist/assets/CreateApiDocs-585fc5d4.js similarity index 98% rename from ui/dist/assets/CreateApiDocs-0d934784.js rename to ui/dist/assets/CreateApiDocs-585fc5d4.js index 0c0b22dd..5cfe842a 100644 --- a/ui/dist/assets/CreateApiDocs-0d934784.js +++ b/ui/dist/assets/CreateApiDocs-585fc5d4.js @@ -1,4 +1,4 @@ -import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-7d33ef4c.js";import{S as At}from"./SdkTabs-f0532e58.js";import{F as Bt}from"./FieldsQueryParam-f6b769d1.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
Optional username
String The username of the auth record. +import{S as qt,i as Ot,s as Mt,C as Q,O as ne,N as Tt,e as i,w as _,b as u,c as _e,f as v,g as r,h as n,m as he,x,P as Be,Q as ht,k as Ht,R as Lt,n as Pt,t as ue,a as fe,o as d,d as ke,p as Ft,r as ye,u as Rt,y as ae}from"./index-6c8f1731.js";import{S as At}from"./SdkTabs-821a5c7e.js";import{F as Bt}from"./FieldsQueryParam-2d478986.js";function kt(o,e,t){const a=o.slice();return a[8]=e[t],a}function yt(o,e,t){const a=o.slice();return a[8]=e[t],a}function vt(o,e,t){const a=o.slice();return a[13]=e[t],a}function gt(o){let e;return{c(){e=i("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,a){r(t,e,a)},d(t){t&&d(e)}}}function wt(o){let e,t,a,f,m,c,p,y,S,T,w,H,D,E,P,I,j,B,$,N,q,g,b;function O(h,C){var ee,K;return(K=(ee=h[0])==null?void 0:ee.options)!=null&&K.requireEmail?Dt:jt}let z=O(o),F=z(o);return{c(){e=i("tr"),e.innerHTML='Auth fields',t=u(),a=i("tr"),a.innerHTML=`
Optional username
String The username of the auth record.
If not set, it will be auto generated.`,f=u(),m=i("tr"),c=i("td"),p=i("div"),F.c(),y=u(),S=i("span"),S.textContent="email",T=u(),w=i("td"),w.innerHTML='String',H=u(),D=i("td"),D.textContent="Auth record email address.",E=u(),P=i("tr"),P.innerHTML='
Optional emailVisibility
Boolean Whether to show/hide the auth record email when fetching the record data.',I=u(),j=i("tr"),j.innerHTML='
Required password
String Auth record password.',B=u(),$=i("tr"),$.innerHTML='
Required passwordConfirm
String Auth record password confirmation.',N=u(),q=i("tr"),q.innerHTML=`
Optional verified
Boolean Indicates whether the auth record is verified or not.
diff --git a/ui/dist/assets/DeleteApiDocs-fd29a801.js b/ui/dist/assets/DeleteApiDocs-d2d1d4be.js similarity index 97% rename from ui/dist/assets/DeleteApiDocs-fd29a801.js rename to ui/dist/assets/DeleteApiDocs-d2d1d4be.js index 7334dc1c..7c5084b4 100644 --- a/ui/dist/assets/DeleteApiDocs-fd29a801.js +++ b/ui/dist/assets/DeleteApiDocs-d2d1d4be.js @@ -1,4 +1,4 @@ -import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-7d33ef4c.js";import{S as He}from"./SdkTabs-f0532e58.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` +import{S as Re,i as Pe,s as Ee,O as j,e as c,w as y,b as k,c as De,f as m,g as p,h as i,m as Ce,x as ee,P as he,Q as Oe,k as Te,R as Be,n as Ie,t as te,a as le,o as u,d as we,C as Ae,p as Me,r as N,u as Se,N as qe}from"./index-6c8f1731.js";import{S as He}from"./SdkTabs-821a5c7e.js";function ke(a,l,s){const o=a.slice();return o[6]=l[s],o}function ge(a,l,s){const o=a.slice();return o[6]=l[s],o}function ve(a){let l;return{c(){l=c("p"),l.innerHTML="Requires admin Authorization:TOKEN header",m(l,"class","txt-hint txt-sm txt-right")},m(s,o){p(s,l,o)},d(s){s&&u(l)}}}function ye(a,l){let s,o,h;function d(){return l[5](l[6])}return{key:a,first:null,c(){s=c("button"),s.textContent=`${l[6].code} `,m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),o||(h=Se(s,"click",d),o=!0)},p(n,r){l=n,r&20&&N(s,"active",l[2]===l[6].code)},d(n){n&&u(s),o=!1,h()}}}function $e(a,l){let s,o,h,d;return o=new qe({props:{content:l[6].body}}),{key:a,first:null,c(){s=c("div"),De(o.$$.fragment),h=k(),m(s,"class","tab-item"),N(s,"active",l[2]===l[6].code),this.first=s},m(n,r){p(n,s,r),Ce(o,s,null),i(s,h),d=!0},p(n,r){l=n,(!d||r&20)&&N(s,"active",l[2]===l[6].code)},i(n){d||(te(o.$$.fragment,n),d=!0)},o(n){le(o.$$.fragment,n),d=!1},d(n){n&&u(s),we(o)}}}function Le(a){var ue,me;let l,s,o=a[0].name+"",h,d,n,r,$,D,z,S=a[0].name+"",F,se,K,C,Q,E,G,g,q,ae,H,P,oe,J,L=a[0].name+"",V,ne,W,ie,X,O,Y,T,Z,B,x,w,I,v=[],ce=new Map,de,A,b=[],re=new Map,R;C=new He({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/FieldsQueryParam-f6b769d1.js b/ui/dist/assets/FieldsQueryParam-2d478986.js similarity index 95% rename from ui/dist/assets/FieldsQueryParam-f6b769d1.js rename to ui/dist/assets/FieldsQueryParam-2d478986.js index babdc6b1..74ddbbf3 100644 --- a/ui/dist/assets/FieldsQueryParam-f6b769d1.js +++ b/ui/dist/assets/FieldsQueryParam-2d478986.js @@ -1,4 +1,4 @@ -import{S as L,i as S,s as k,N as E,e as s,b as o,w as $,c as F,f as H,g as M,h as e,m as T,y as q,t as N,a as B,o as I,d as J}from"./index-7d33ef4c.js";function O(v){let t,i,x,p,g,n,a,h,c,_,r,b,f,y,u,C,m,d;return r=new E({props:{content:` +import{S as L,i as S,s as k,N as E,e as s,b as o,w as $,c as F,f as H,g as M,h as e,m as T,y as q,t as N,a as B,o as I,d as J}from"./index-6c8f1731.js";function O(v){let t,i,x,p,g,n,a,h,c,_,r,b,f,y,u,C,m,d;return r=new E({props:{content:` ?fields=*,expand.relField.name `}}),{c(){t=s("tr"),i=s("td"),i.textContent="fields",x=o(),p=s("td"),p.innerHTML='String',g=o(),n=s("td"),a=s("p"),h=$(`Comma separated string of the fields to return in the JSON response `),c=s("em"),c.textContent="(by default returns all fields)",_=$(`. Ex.: diff --git a/ui/dist/assets/FilterAutocompleteInput-288f3849.js b/ui/dist/assets/FilterAutocompleteInput-c936572d.js similarity index 98% rename from ui/dist/assets/FilterAutocompleteInput-288f3849.js rename to ui/dist/assets/FilterAutocompleteInput-c936572d.js index 2bf17dcf..eb877d20 100644 --- a/ui/dist/assets/FilterAutocompleteInput-288f3849.js +++ b/ui/dist/assets/FilterAutocompleteInput-c936572d.js @@ -1 +1 @@ -import{S as se,i as ae,s as le,e as ue,f as ce,g as de,y as M,o as fe,J as he,K as ge,L as pe,I as ye,C as f,M as ke}from"./index-7d33ef4c.js";import{E as K,a as C,h as xe,b as me,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Le,j as Ie,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as L,S as Me,t as De}from"./index-30dee195.js";function He(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var h=r[y]=[],s=e[y],i=0;i2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,h=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:h=""}=r,{value:s=""}=r,{disabled:i=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:m=!1}=r,{extraAutocompleteKeys:I=[]}=r,{disableRequestKeys:w=!1}=r,{disableIndirectCollectionsKeys:E=!1}=r,d,b,A=i,D=new L,H=new L,F=new L,T=new L,q=[],U=[],W=[],N=[],R="",B="";function O(){d==null||d.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{q=$(p),N=ee(),U=w?[]:te(),W=E?[]:ne()},300)}function $(t){let o=t.slice();return a&&f.pushOrReplaceByKey(o,a,"id"),o}function J(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function P(){if(!h)return;const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.removeEventListener("click",O)}function V(){if(!h)return;P();const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.addEventListener("click",O)}function S(t,o="",c=0){var x,z,Q;let g=q.find(k=>k.name==t||k.id==t);if(!g||c>=4)return[];let u=f.getAllCollectionIdentifiers(g,o);for(const k of(g==null?void 0:g.schema)||[]){const v=o+k.name;if(k.type==="relation"&&((x=k.options)!=null&&x.collectionId)){const X=S(k.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}k.type==="select"&&((z=k.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&u.push(v+":length")}return u}function ee(){return S(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const o=q.filter(g=>g.type==="auth");for(const g of o){const u=S(g.id,"@request.auth.");for(const x of u)f.pushUnique(t,x)}const c=["created","updated"];if(a!=null&&a.id){const g=S(a.name,"@request.data.");for(const u of g){t.push(u);const x=u.split(".");x.length===3&&x[2].indexOf(":")===-1&&!c.includes(x[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const o of q){const c="@collection."+o.name+".",g=S(o.name,c);for(const u of g)t.push(u)}return t}function re(t=!0,o=!0){let c=[].concat(I);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),o&&(c=c.concat(W||[])),c.sort(function(g,u){return u.length-g.length}),c}function ie(t){let o=t.matchBefore(/[\'\"\@\w\.]*/);if(o&&o.from==o.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];E||c.push({label:"@collection.*",apply:"@collection."});const g=re(!w,!w&&o.text.startsWith("@c"));for(const u of g)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:o.from,options:c}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:f.escapeRegExp("@now"),token:"keyword"},{regex:f.escapeRegExp("@second"),token:"keyword"},{regex:f.escapeRegExp("@minute"),token:"keyword"},{regex:f.escapeRegExp("@hour"),token:"keyword"},{regex:f.escapeRegExp("@year"),token:"keyword"},{regex:f.escapeRegExp("@day"),token:"keyword"},{regex:f.escapeRegExp("@month"),token:"keyword"},{regex:f.escapeRegExp("@weekday"),token:"keyword"},{regex:f.escapeRegExp("@todayStart"),token:"keyword"},{regex:f.escapeRegExp("@todayEnd"),token:"keyword"},{regex:f.escapeRegExp("@monthStart"),token:"keyword"},{regex:f.escapeRegExp("@monthEnd"),token:"keyword"},{regex:f.escapeRegExp("@yearStart"),token:"keyword"},{regex:f.escapeRegExp("@yearEnd"),token:"keyword"},{regex:f.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:o=>{m&&y("submit",s)}};return V(),n(11,d=new K({parent:b,state:C.create({doc:s,extensions:[xe(),me(),be(),we(),Ee(),C.allowMultipleSelections.of(!0),Se(De,{fallback:!0}),Ke(),Ce(),qe(),Re(),Le.of([t,...Ie,...Ae,Be.find(o=>o.key==="Mod-d"),...Oe,..._e]),K.lineWrapping,ve({override:[ie],icons:!1}),T.of(Y(l)),H.of(K.editable.of(!i)),F.of(C.readOnly.of(i)),D.of(G()),C.transactionFilter.of(o=>m&&o.newDoc.lines>1?[]:o),K.updateListener.of(o=>{!o.docChanged||i||(n(1,s=o.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy()}});function oe(t){ke[t?"unshift":"push"](()=>{b=t,n(0,b)})}return e.$$set=t=>{"id"in t&&n(2,h=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,i=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,m=t.singleLine),"extraAutocompleteKeys"in t&&n(7,I=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,w=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,E=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,R=Pe(a)),e.$$.dirty[0]&25352&&!i&&(B!=R||w!==-1||E!==-1)&&(n(14,B=R),j()),e.$$.dirty[0]&4&&h&&V(),e.$$.dirty[0]&2080&&d&&a!=null&&a.schema&&d.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&d&&A!=i&&(d.dispatch({effects:[H.reconfigure(K.editable.of(!i)),F.reconfigure(C.readOnly.of(i))]}),n(12,A=i),J()),e.$$.dirty[0]&2050&&d&&s!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&d&&typeof l<"u"&&d.dispatch({effects:[T.reconfigure(Y(l))]})},[b,s,h,i,l,a,m,I,w,E,O,d,A,R,B,oe]}class Qe extends se{constructor(r){super(),ae(this,r,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; +import{S as se,i as ae,s as le,e as ue,f as ce,g as de,y as M,o as fe,J as he,K as ge,L as pe,I as ye,C as f,M as ke}from"./index-6c8f1731.js";import{E as K,a as C,h as xe,b as me,c as be,d as we,e as Ee,s as Se,f as Ke,g as Ce,r as qe,i as Re,k as Le,j as Ie,l as Ae,m as Be,n as Oe,o as _e,p as ve,q as Y,C as L,S as Me,t as De}from"./index-102ce751.js";function He(e){Z(e,"start");var r={},n=e.languageData||{},p=!1;for(var y in e)if(y!=n&&e.hasOwnProperty(y))for(var h=r[y]=[],s=e[y],i=0;i2&&s.token&&typeof s.token!="string"){n.pending=[];for(var a=2;a-1)return null;var y=n.indent.length-1,h=e[n.state];e:for(;;){for(var s=0;sn(21,p=t));const y=pe();let{id:h=""}=r,{value:s=""}=r,{disabled:i=!1}=r,{placeholder:l=""}=r,{baseCollection:a=null}=r,{singleLine:m=!1}=r,{extraAutocompleteKeys:I=[]}=r,{disableRequestKeys:w=!1}=r,{disableIndirectCollectionsKeys:E=!1}=r,d,b,A=i,D=new L,H=new L,F=new L,T=new L,q=[],U=[],W=[],N=[],R="",B="";function O(){d==null||d.focus()}let _=null;function j(){clearTimeout(_),_=setTimeout(()=>{q=$(p),N=ee(),U=w?[]:te(),W=E?[]:ne()},300)}function $(t){let o=t.slice();return a&&f.pushOrReplaceByKey(o,a,"id"),o}function J(){b==null||b.dispatchEvent(new CustomEvent("change",{detail:{value:s},bubbles:!0}))}function P(){if(!h)return;const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.removeEventListener("click",O)}function V(){if(!h)return;P();const t=document.querySelectorAll('[for="'+h+'"]');for(let o of t)o.addEventListener("click",O)}function S(t,o="",c=0){var x,z,Q;let g=q.find(k=>k.name==t||k.id==t);if(!g||c>=4)return[];let u=f.getAllCollectionIdentifiers(g,o);for(const k of(g==null?void 0:g.schema)||[]){const v=o+k.name;if(k.type==="relation"&&((x=k.options)!=null&&x.collectionId)){const X=S(k.options.collectionId,v+".",c+1);X.length&&(u=u.concat(X))}k.type==="select"&&((z=k.options)==null?void 0:z.maxSelect)!=1&&u.push(v+":each"),((Q=k.options)==null?void 0:Q.maxSelect)!=1&&["select","file","relation"].includes(k.type)&&u.push(v+":length")}return u}function ee(){return S(a==null?void 0:a.name)}function te(){const t=[];t.push("@request.method"),t.push("@request.query."),t.push("@request.data."),t.push("@request.headers."),t.push("@request.auth.id"),t.push("@request.auth.collectionId"),t.push("@request.auth.collectionName"),t.push("@request.auth.verified"),t.push("@request.auth.username"),t.push("@request.auth.email"),t.push("@request.auth.emailVisibility"),t.push("@request.auth.created"),t.push("@request.auth.updated");const o=q.filter(g=>g.type==="auth");for(const g of o){const u=S(g.id,"@request.auth.");for(const x of u)f.pushUnique(t,x)}const c=["created","updated"];if(a!=null&&a.id){const g=S(a.name,"@request.data.");for(const u of g){t.push(u);const x=u.split(".");x.length===3&&x[2].indexOf(":")===-1&&!c.includes(x[2])&&t.push(u+":isset")}}return t}function ne(){const t=[];for(const o of q){const c="@collection."+o.name+".",g=S(o.name,c);for(const u of g)t.push(u)}return t}function re(t=!0,o=!0){let c=[].concat(I);return c=c.concat(N||[]),t&&(c=c.concat(U||[])),o&&(c=c.concat(W||[])),c.sort(function(g,u){return u.length-g.length}),c}function ie(t){let o=t.matchBefore(/[\'\"\@\w\.]*/);if(o&&o.from==o.to&&!t.explicit)return null;let c=[{label:"false"},{label:"true"},{label:"@now"},{label:"@second"},{label:"@minute"},{label:"@hour"},{label:"@year"},{label:"@day"},{label:"@month"},{label:"@weekday"},{label:"@todayStart"},{label:"@todayEnd"},{label:"@monthStart"},{label:"@monthEnd"},{label:"@yearStart"},{label:"@yearEnd"}];E||c.push({label:"@collection.*",apply:"@collection."});const g=re(!w,!w&&o.text.startsWith("@c"));for(const u of g)c.push({label:u.endsWith(".")?u+"*":u,apply:u});return{from:o.from,options:c}}function G(){return Me.define(He({start:[{regex:/true|false|null/,token:"atom"},{regex:/"(?:[^\\]|\\.)*?(?:"|$)/,token:"string"},{regex:/'(?:[^\\]|\\.)*?(?:'|$)/,token:"string"},{regex:/0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,token:"number"},{regex:/\&\&|\|\||\=|\!\=|\~|\!\~|\>|\<|\>\=|\<\=/,token:"operator"},{regex:/[\{\[\(]/,indent:!0},{regex:/[\}\]\)]/,dedent:!0},{regex:/\w+[\w\.]*\w+/,token:"keyword"},{regex:f.escapeRegExp("@now"),token:"keyword"},{regex:f.escapeRegExp("@second"),token:"keyword"},{regex:f.escapeRegExp("@minute"),token:"keyword"},{regex:f.escapeRegExp("@hour"),token:"keyword"},{regex:f.escapeRegExp("@year"),token:"keyword"},{regex:f.escapeRegExp("@day"),token:"keyword"},{regex:f.escapeRegExp("@month"),token:"keyword"},{regex:f.escapeRegExp("@weekday"),token:"keyword"},{regex:f.escapeRegExp("@todayStart"),token:"keyword"},{regex:f.escapeRegExp("@todayEnd"),token:"keyword"},{regex:f.escapeRegExp("@monthStart"),token:"keyword"},{regex:f.escapeRegExp("@monthEnd"),token:"keyword"},{regex:f.escapeRegExp("@yearStart"),token:"keyword"},{regex:f.escapeRegExp("@yearEnd"),token:"keyword"},{regex:f.escapeRegExp("@request.method"),token:"keyword"}]}))}ye(()=>{const t={key:"Enter",run:o=>{m&&y("submit",s)}};return V(),n(11,d=new K({parent:b,state:C.create({doc:s,extensions:[xe(),me(),be(),we(),Ee(),C.allowMultipleSelections.of(!0),Se(De,{fallback:!0}),Ke(),Ce(),qe(),Re(),Le.of([t,...Ie,...Ae,Be.find(o=>o.key==="Mod-d"),...Oe,..._e]),K.lineWrapping,ve({override:[ie],icons:!1}),T.of(Y(l)),H.of(K.editable.of(!i)),F.of(C.readOnly.of(i)),D.of(G()),C.transactionFilter.of(o=>m&&o.newDoc.lines>1?[]:o),K.updateListener.of(o=>{!o.docChanged||i||(n(1,s=o.state.doc.toString()),J())})]})})),()=>{clearTimeout(_),P(),d==null||d.destroy()}});function oe(t){ke[t?"unshift":"push"](()=>{b=t,n(0,b)})}return e.$$set=t=>{"id"in t&&n(2,h=t.id),"value"in t&&n(1,s=t.value),"disabled"in t&&n(3,i=t.disabled),"placeholder"in t&&n(4,l=t.placeholder),"baseCollection"in t&&n(5,a=t.baseCollection),"singleLine"in t&&n(6,m=t.singleLine),"extraAutocompleteKeys"in t&&n(7,I=t.extraAutocompleteKeys),"disableRequestKeys"in t&&n(8,w=t.disableRequestKeys),"disableIndirectCollectionsKeys"in t&&n(9,E=t.disableIndirectCollectionsKeys)},e.$$.update=()=>{e.$$.dirty[0]&32&&n(13,R=Pe(a)),e.$$.dirty[0]&25352&&!i&&(B!=R||w!==-1||E!==-1)&&(n(14,B=R),j()),e.$$.dirty[0]&4&&h&&V(),e.$$.dirty[0]&2080&&d&&a!=null&&a.schema&&d.dispatch({effects:[D.reconfigure(G())]}),e.$$.dirty[0]&6152&&d&&A!=i&&(d.dispatch({effects:[H.reconfigure(K.editable.of(!i)),F.reconfigure(C.readOnly.of(i))]}),n(12,A=i),J()),e.$$.dirty[0]&2050&&d&&s!=d.state.doc.toString()&&d.dispatch({changes:{from:0,to:d.state.doc.length,insert:s}}),e.$$.dirty[0]&2064&&d&&typeof l<"u"&&d.dispatch({effects:[T.reconfigure(Y(l))]})},[b,s,h,i,l,a,m,I,w,E,O,d,A,R,B,oe]}class Qe extends se{constructor(r){super(),ae(this,r,Ve,Je,le,{id:2,value:1,disabled:3,placeholder:4,baseCollection:5,singleLine:6,extraAutocompleteKeys:7,disableRequestKeys:8,disableIndirectCollectionsKeys:9,focus:10},null,[-1,-1])}get focus(){return this.$$.ctx[10]}}export{Qe as default}; diff --git a/ui/dist/assets/ListApiDocs-3cd045c1.js b/ui/dist/assets/ListApiDocs-8893d294.js similarity index 99% rename from ui/dist/assets/ListApiDocs-3cd045c1.js rename to ui/dist/assets/ListApiDocs-8893d294.js index 2886f113..aae9e817 100644 --- a/ui/dist/assets/ListApiDocs-3cd045c1.js +++ b/ui/dist/assets/ListApiDocs-8893d294.js @@ -1,4 +1,4 @@ -import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-7d33ef4c.js";import{S as dl}from"./SdkTabs-f0532e58.js";import{F as pl}from"./FieldsQueryParam-f6b769d1.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format +import{S as Ze,i as tl,s as el,e,b as s,E as sl,f as a,g as u,u as ll,y as Qe,o as m,w as _,h as t,N as Fe,O as se,c as Qt,m as Ut,x as ke,P as Ue,Q as nl,k as ol,R as al,n as il,t as $t,a as Ct,d as jt,T as rl,C as ve,p as cl,r as Le}from"./index-6c8f1731.js";import{S as dl}from"./SdkTabs-821a5c7e.js";import{F as pl}from"./FieldsQueryParam-2d478986.js";function fl(d){let n,o,i;return{c(){n=e("span"),n.textContent="Show details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-down-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function ul(d){let n,o,i;return{c(){n=e("span"),n.textContent="Hide details",o=s(),i=e("i"),a(n,"class","txt"),a(i,"class","ri-arrow-up-s-line")},m(f,h){u(f,n,h),u(f,o,h),u(f,i,h)},d(f){f&&(m(n),m(o),m(i))}}}function je(d){let n,o,i,f,h,r,b,$,C,g,p,tt,kt,zt,E,Kt,H,rt,R,et,ne,Q,U,oe,ct,yt,lt,vt,ae,dt,pt,st,N,Jt,Ft,y,nt,Lt,Vt,At,j,ot,Tt,Wt,Pt,F,ft,Rt,ie,ut,re,M,Ot,at,St,O,mt,ce,z,Et,Xt,Nt,de,q,Yt,K,ht,pe,I,fe,B,ue,P,qt,J,bt,me,gt,he,x,Dt,it,Ht,be,Mt,Zt,V,_t,ge,It,_e,wt,we,W,G,xe,xt,te,X,ee,L,Y,S,Bt,$e,Z,v,Gt;return{c(){n=e("p"),n.innerHTML=`The syntax basically follows the format OPERAND OPERATOR OPERAND, where:`,o=s(),i=e("ul"),f=e("li"),f.innerHTML=`OPERAND - could be any of the above field literal, string (single or double quoted), number, null, true, false`,h=s(),r=e("li"),b=e("code"),b.textContent="OPERATOR",$=_(` - is one of: `),C=e("br"),g=s(),p=e("ul"),tt=e("li"),kt=e("code"),kt.textContent="=",zt=s(),E=e("span"),E.textContent="Equal",Kt=s(),H=e("li"),rt=e("code"),rt.textContent="!=",R=s(),et=e("span"),et.textContent="NOT equal",ne=s(),Q=e("li"),U=e("code"),U.textContent=">",oe=s(),ct=e("span"),ct.textContent="Greater than",yt=s(),lt=e("li"),vt=e("code"),vt.textContent=">=",ae=s(),dt=e("span"),dt.textContent="Greater than or equal",pt=s(),st=e("li"),N=e("code"),N.textContent="<",Jt=s(),Ft=e("span"),Ft.textContent="Less than",y=s(),nt=e("li"),Lt=e("code"),Lt.textContent="<=",Vt=s(),At=e("span"),At.textContent="Less than or equal",j=s(),ot=e("li"),Tt=e("code"),Tt.textContent="~",Wt=s(),Pt=e("span"),Pt.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for diff --git a/ui/dist/assets/ListExternalAuthsDocs-2258a5ea.js b/ui/dist/assets/ListExternalAuthsDocs-baf81d9b.js similarity index 97% rename from ui/dist/assets/ListExternalAuthsDocs-2258a5ea.js rename to ui/dist/assets/ListExternalAuthsDocs-baf81d9b.js index 6e21ba96..a4967065 100644 --- a/ui/dist/assets/ListExternalAuthsDocs-2258a5ea.js +++ b/ui/dist/assets/ListExternalAuthsDocs-baf81d9b.js @@ -1,4 +1,4 @@ -import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-7d33ef4c.js";import{S as Ye}from"./SdkTabs-f0532e58.js";import{F as Ze}from"./FieldsQueryParam-f6b769d1.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` +import{S as ze,i as Qe,s as Ue,O as F,e as i,w as v,b as m,c as pe,f as b,g as c,h as a,m as ue,x as N,P as Oe,Q as je,k as Fe,R as Ne,n as Ge,t as G,a as K,o as d,d as me,C as Ke,p as Je,r as J,u as Ve,N as Xe}from"./index-6c8f1731.js";import{S as Ye}from"./SdkTabs-821a5c7e.js";import{F as Ze}from"./FieldsQueryParam-2d478986.js";function De(o,l,s){const n=o.slice();return n[5]=l[s],n}function He(o,l,s){const n=o.slice();return n[5]=l[s],n}function Re(o,l){let s,n=l[5].code+"",f,_,r,u;function h(){return l[4](l[5])}return{key:o,first:null,c(){s=i("button"),f=v(n),_=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(w,y){c(w,s,y),a(s,f),a(s,_),r||(u=Ve(s,"click",h),r=!0)},p(w,y){l=w,y&4&&n!==(n=l[5].code+"")&&N(f,n),y&6&&J(s,"active",l[1]===l[5].code)},d(w){w&&d(s),r=!1,u()}}}function We(o,l){let s,n,f,_;return n=new Xe({props:{content:l[5].body}}),{key:o,first:null,c(){s=i("div"),pe(n.$$.fragment),f=m(),b(s,"class","tab-item"),J(s,"active",l[1]===l[5].code),this.first=s},m(r,u){c(r,s,u),ue(n,s,null),a(s,f),_=!0},p(r,u){l=r;const h={};u&4&&(h.content=l[5].body),n.$set(h),(!_||u&6)&&J(s,"active",l[1]===l[5].code)},i(r){_||(G(n.$$.fragment,r),_=!0)},o(r){K(n.$$.fragment,r),_=!1},d(r){r&&d(s),me(n)}}}function xe(o){var Ce,Se,Ee,Ie;let l,s,n=o[0].name+"",f,_,r,u,h,w,y,R=o[0].name+"",V,be,fe,X,Y,P,Z,I,x,$,W,he,z,T,_e,ee,Q=o[0].name+"",te,ke,le,ve,ge,U,se,B,ae,q,oe,L,ne,A,ie,$e,ce,E,de,M,re,C,O,g=[],we=new Map,ye,D,k=[],Pe=new Map,S;P=new Ye({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/PageAdminConfirmPasswordReset-8e3ad9f6.js b/ui/dist/assets/PageAdminConfirmPasswordReset-84f4610d.js similarity index 98% rename from ui/dist/assets/PageAdminConfirmPasswordReset-8e3ad9f6.js rename to ui/dist/assets/PageAdminConfirmPasswordReset-84f4610d.js index 51b5cd0d..46ece01b 100644 --- a/ui/dist/assets/PageAdminConfirmPasswordReset-8e3ad9f6.js +++ b/ui/dist/assets/PageAdminConfirmPasswordReset-84f4610d.js @@ -1,2 +1,2 @@ -import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-7d33ef4c.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password +import{S as E,i as G,s as I,F as K,c as R,m as A,t as B,a as N,d as T,C as M,q as J,e as _,w as P,b as k,f,r as L,g as b,h as c,u as j,v as O,j as Q,l as U,o as w,A as V,p as W,B as X,D as Y,x as Z,z as q}from"./index-6c8f1731.js";function y(i){let e,n,s;return{c(){e=P("for "),n=_("strong"),s=P(i[3]),f(n,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,n,t),c(n,s)},p(l,t){t&8&&Z(s,l[3])},d(l){l&&(w(e),w(n))}}}function x(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0,t.autofocus=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[0]),t.focus(),p||(d=j(t,"input",i[6]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&1&&t.value!==r[0]&&q(t,r[0])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function ee(i){let e,n,s,l,t,u,p,d;return{c(){e=_("label"),n=P("New password confirm"),l=k(),t=_("input"),f(e,"for",s=i[8]),f(t,"type","password"),f(t,"id",u=i[8]),t.required=!0},m(r,a){b(r,e,a),c(e,n),b(r,l,a),b(r,t,a),q(t,i[1]),p||(d=j(t,"input",i[7]),p=!0)},p(r,a){a&256&&s!==(s=r[8])&&f(e,"for",s),a&256&&u!==(u=r[8])&&f(t,"id",u),a&2&&t.value!==r[1]&&q(t,r[1])},d(r){r&&(w(e),w(l),w(t)),p=!1,d()}}}function te(i){let e,n,s,l,t,u,p,d,r,a,g,S,C,v,h,F,z,m=i[3]&&y(i);return u=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:o})=>({8:o}),({uniqueId:o})=>o?256:0]},$$scope:{ctx:i}}}),{c(){e=_("form"),n=_("div"),s=_("h4"),l=P(`Reset your admin password `),m&&m.c(),t=k(),R(u.$$.fragment),p=k(),R(d.$$.fragment),r=k(),a=_("button"),g=_("span"),g.textContent="Set new password",S=k(),C=_("div"),v=_("a"),v.textContent="Back to login",f(s,"class","m-b-xs"),f(n,"class","content txt-center m-b-sm"),f(g,"class","txt"),f(a,"type","submit"),f(a,"class","btn btn-lg btn-block"),a.disabled=i[2],L(a,"btn-loading",i[2]),f(e,"class","m-b-base"),f(v,"href","/login"),f(v,"class","link-hint"),f(C,"class","content txt-center")},m(o,$){b(o,e,$),c(e,n),c(n,s),c(s,l),m&&m.m(s,null),c(e,t),A(u,e,null),c(e,p),A(d,e,null),c(e,r),c(e,a),c(a,g),b(o,S,$),b(o,C,$),c(C,v),h=!0,F||(z=[j(e,"submit",O(i[4])),Q(U.call(null,v))],F=!0)},p(o,$){o[3]?m?m.p(o,$):(m=y(o),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const D={};$&769&&(D.$$scope={dirty:$,ctx:o}),u.$set(D);const H={};$&770&&(H.$$scope={dirty:$,ctx:o}),d.$set(H),(!h||$&4)&&(a.disabled=o[2]),(!h||$&4)&&L(a,"btn-loading",o[2])},i(o){h||(B(u.$$.fragment,o),B(d.$$.fragment,o),h=!0)},o(o){N(u.$$.fragment,o),N(d.$$.fragment,o),h=!1},d(o){o&&(w(e),w(S),w(C)),m&&m.d(),T(u),T(d),F=!1,V(z)}}}function se(i){let e,n;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:i}}}),{c(){R(e.$$.fragment)},m(s,l){A(e,s,l),n=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){n||(B(e.$$.fragment,s),n=!0)},o(s){N(e.$$.fragment,s),n=!1},d(s){T(e,s)}}}function le(i,e,n){let s,{params:l}=e,t="",u="",p=!1;async function d(){if(!p){n(2,p=!0);try{await W.admins.confirmPasswordReset(l==null?void 0:l.token,t,u),X("Successfully set a new admin password."),Y("/")}catch(g){W.error(g)}n(2,p=!1)}}function r(){t=this.value,n(0,t)}function a(){u=this.value,n(1,u)}return i.$$set=g=>{"params"in g&&n(5,l=g.params)},i.$$.update=()=>{i.$$.dirty&32&&n(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,u,p,s,d,l,r,a]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default}; diff --git a/ui/dist/assets/PageAdminRequestPasswordReset-9bb5b8fc.js b/ui/dist/assets/PageAdminRequestPasswordReset-b72b7a4a.js similarity index 98% rename from ui/dist/assets/PageAdminRequestPasswordReset-9bb5b8fc.js rename to ui/dist/assets/PageAdminRequestPasswordReset-b72b7a4a.js index 2e6acc8b..6137097e 100644 --- a/ui/dist/assets/PageAdminRequestPasswordReset-9bb5b8fc.js +++ b/ui/dist/assets/PageAdminRequestPasswordReset-b72b7a4a.js @@ -1 +1 @@ -import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-7d33ef4c.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),R(l.$$.fragment),t=v(),o=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=u[1],F(o,"btn-loading",u[1]),p(e,"class","m-b-base")},m(i,$){g(i,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,c),d(o,m),d(o,r),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(i,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:i}),l.$set(q),(!a||$&2)&&(o.disabled=i[1]),(!a||$&2)&&F(o,"btn-loading",i[1])},i(i){a||(w(l.$$.fragment,i),a=!0)},o(i){y(l.$$.fragment,i),a=!1},d(i){i&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,o,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),o=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,o,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",o=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),L(t,u[0]),t.focus(),c||(m=H(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&o!==(o=r[5])&&p(t,"id",o),a&1&&t.value!==r[0]&&L(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,o,c,m;const r=[O,K],a=[];function b(f,i){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,i){a[e].m(f,i),g(f,n,i),g(f,l,i),d(l,t),o=!0,c||(m=A(B.call(null,t)),c=!0)},p(f,i){let $=e;e=b(f),e===$?a[e].p(f,i):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,i):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){o||(w(s),o=!0)},o(f){y(s),o=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){R(e.$$.fragment)},m(n,l){S(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,o,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; +import{S as M,i as T,s as j,F as z,c as R,m as S,t as w,a as y,d as E,b as v,e as _,f as p,g,h as d,j as A,l as B,k as N,n as D,o as k,p as C,q as G,r as F,u as H,v as I,w as h,x as J,y as P,z as L}from"./index-6c8f1731.js";function K(u){let e,s,n,l,t,o,c,m,r,a,b,f;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:u}}}),{c(){e=_("form"),s=_("div"),s.innerHTML='

Forgotten admin password

Enter the email associated with your account and we’ll send you a recovery link:

',n=v(),R(l.$$.fragment),t=v(),o=_("button"),c=_("i"),m=v(),r=_("span"),r.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(c,"class","ri-mail-send-line"),p(r,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=u[1],F(o,"btn-loading",u[1]),p(e,"class","m-b-base")},m(i,$){g(i,e,$),d(e,s),d(e,n),S(l,e,null),d(e,t),d(e,o),d(o,c),d(o,m),d(o,r),a=!0,b||(f=H(e,"submit",I(u[3])),b=!0)},p(i,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:i}),l.$set(q),(!a||$&2)&&(o.disabled=i[1]),(!a||$&2)&&F(o,"btn-loading",i[1])},i(i){a||(w(l.$$.fragment,i),a=!0)},o(i){y(l.$$.fragment,i),a=!1},d(i){i&&k(e),E(l),b=!1,f()}}}function O(u){let e,s,n,l,t,o,c,m,r;return{c(){e=_("div"),s=_("div"),s.innerHTML='',n=v(),l=_("div"),t=_("p"),o=h("Check "),c=_("strong"),m=h(u[0]),r=h(" for the recovery link."),p(s,"class","icon"),p(c,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){g(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,c),d(c,m),d(t,r)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&k(e)}}}function Q(u){let e,s,n,l,t,o,c,m;return{c(){e=_("label"),s=h("Email"),l=v(),t=_("input"),p(e,"for",n=u[5]),p(t,"type","email"),p(t,"id",o=u[5]),t.required=!0,t.autofocus=!0},m(r,a){g(r,e,a),d(e,s),g(r,l,a),g(r,t,a),L(t,u[0]),t.focus(),c||(m=H(t,"input",u[4]),c=!0)},p(r,a){a&32&&n!==(n=r[5])&&p(e,"for",n),a&32&&o!==(o=r[5])&&p(t,"id",o),a&1&&t.value!==r[0]&&L(t,r[0])},d(r){r&&(k(e),k(l),k(t)),c=!1,m()}}}function U(u){let e,s,n,l,t,o,c,m;const r=[O,K],a=[];function b(f,i){return f[2]?0:1}return e=b(u),s=a[e]=r[e](u),{c(){s.c(),n=v(),l=_("div"),t=_("a"),t.textContent="Back to login",p(t,"href","/login"),p(t,"class","link-hint"),p(l,"class","content txt-center")},m(f,i){a[e].m(f,i),g(f,n,i),g(f,l,i),d(l,t),o=!0,c||(m=A(B.call(null,t)),c=!0)},p(f,i){let $=e;e=b(f),e===$?a[e].p(f,i):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(f,i):(s=a[e]=r[e](f),s.c()),w(s,1),s.m(n.parentNode,n))},i(f){o||(w(s),o=!0)},o(f){y(s),o=!1},d(f){f&&(k(n),k(l)),a[e].d(f),c=!1,m()}}}function V(u){let e,s;return e=new z({props:{$$slots:{default:[U]},$$scope:{ctx:u}}}),{c(){R(e.$$.fragment)},m(n,l){S(e,n,l),s=!0},p(n,[l]){const t={};l&71&&(t.$$scope={dirty:l,ctx:n}),e.$set(t)},i(n){s||(w(e.$$.fragment,n),s=!0)},o(n){y(e.$$.fragment,n),s=!1},d(n){E(e,n)}}}function W(u,e,s){let n="",l=!1,t=!1;async function o(){if(!l){s(1,l=!0);try{await C.admins.requestPasswordReset(n),s(2,t=!0)}catch(m){C.error(m)}s(1,l=!1)}}function c(){n=this.value,s(0,n)}return[n,l,t,o,c]}class Y extends M{constructor(e){super(),T(this,e,W,V,j,{})}}export{Y as default}; diff --git a/ui/dist/assets/PageOAuth2Redirect-42a9e5c9.js b/ui/dist/assets/PageOAuth2Redirect-999aaede.js similarity index 87% rename from ui/dist/assets/PageOAuth2Redirect-42a9e5c9.js rename to ui/dist/assets/PageOAuth2Redirect-999aaede.js index 02202626..30a08e82 100644 --- a/ui/dist/assets/PageOAuth2Redirect-42a9e5c9.js +++ b/ui/dist/assets/PageOAuth2Redirect-999aaede.js @@ -1 +1 @@ -import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,I as h}from"./index-7d33ef4c.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can go back to the app if this window is not automatically closed.
',l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function m(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,m,f,c,{})}}export{x as default}; +import{S as o,i,s as c,e as r,f as l,g as u,y as s,o as d,I as h}from"./index-6c8f1731.js";function f(n){let t;return{c(){t=r("div"),t.innerHTML='

Auth completed.

You can go back to the app if this window is not automatically closed.
',l(t,"class","content txt-hint txt-center p-base")},m(e,a){u(e,t,a)},p:s,i:s,o:s,d(e){e&&d(t)}}}function m(n){return h(()=>{window.close()}),[]}class x extends o{constructor(t){super(),i(this,t,m,f,c,{})}}export{x as default}; diff --git a/ui/dist/assets/PageRecordConfirmEmailChange-9d9126f6.js b/ui/dist/assets/PageRecordConfirmEmailChange-02c3e953.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmEmailChange-9d9126f6.js rename to ui/dist/assets/PageRecordConfirmEmailChange-02c3e953.js index 03466d16..81964b27 100644 --- a/ui/dist/assets/PageRecordConfirmEmailChange-9d9126f6.js +++ b/ui/dist/assets/PageRecordConfirmEmailChange-02c3e953.js @@ -1,2 +1,2 @@ -import{S as G,i as I,s as J,F as M,c as S,m as L,t as h,a as v,d as z,C as N,E as R,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as y,b as C,f as p,r as T,h as g,u as P,v as K,y as E,x as O,z as F}from"./index-7d33ef4c.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address +import{S as G,i as I,s as J,F as M,c as S,m as L,t as h,a as v,d as z,C as N,E as R,g as _,k as W,n as Y,o as b,G as j,H as A,p as B,q as D,e as m,w as y,b as C,f as p,r as T,h as g,u as P,v as K,y as E,x as O,z as F}from"./index-6c8f1731.js";function Q(i){let e,t,n,l,s,o,f,a,r,u,k,$,d=i[3]&&H(i);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[V,({uniqueId:c})=>({8:c}),({uniqueId:c})=>c?256:0]},$$scope:{ctx:i}}}),{c(){e=m("form"),t=m("div"),n=m("h5"),l=y(`Type your password to confirm changing your email address `),d&&d.c(),s=C(),S(o.$$.fragment),f=C(),a=m("button"),r=m("span"),r.textContent="Confirm new email",p(t,"class","content txt-center m-b-base"),p(r,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block"),a.disabled=i[1],T(a,"btn-loading",i[1])},m(c,w){_(c,e,w),g(e,t),g(t,n),g(n,l),d&&d.m(n,null),g(e,s),L(o,e,null),g(e,f),g(e,a),g(a,r),u=!0,k||($=P(e,"submit",K(i[4])),k=!0)},p(c,w){c[3]?d?d.p(c,w):(d=H(c),d.c(),d.m(n,null)):d&&(d.d(1),d=null);const q={};w&769&&(q.$$scope={dirty:w,ctx:c}),o.$set(q),(!u||w&2)&&(a.disabled=c[1]),(!u||w&2)&&T(a,"btn-loading",c[1])},i(c){u||(h(o.$$.fragment,c),u=!0)},o(c){v(o.$$.fragment,c),u=!1},d(c){c&&b(e),d&&d.d(),z(o),k=!1,$()}}}function U(i){let e,t,n,l,s;return{c(){e=m("div"),e.innerHTML='

Successfully changed the user email address.

You can now sign in with your new email address.

',t=C(),n=m("button"),n.textContent="Close",p(e,"class","alert alert-success"),p(n,"type","button"),p(n,"class","btn btn-transparent btn-block")},m(o,f){_(o,e,f),_(o,t,f),_(o,n,f),l||(s=P(n,"click",i[6]),l=!0)},p:E,i:E,o:E,d(o){o&&(b(e),b(t),b(n)),l=!1,s()}}}function H(i){let e,t,n;return{c(){e=y("to "),t=m("strong"),n=y(i[3]),p(t,"class","txt-nowrap")},m(l,s){_(l,e,s),_(l,t,s),g(t,n)},p(l,s){s&8&&O(n,l[3])},d(l){l&&(b(e),b(t))}}}function V(i){let e,t,n,l,s,o,f,a;return{c(){e=m("label"),t=y("Password"),l=C(),s=m("input"),p(e,"for",n=i[8]),p(s,"type","password"),p(s,"id",o=i[8]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),g(e,t),_(r,l,u),_(r,s,u),F(s,i[0]),s.focus(),f||(a=P(s,"input",i[7]),f=!0)},p(r,u){u&256&&n!==(n=r[8])&&p(e,"for",n),u&256&&o!==(o=r[8])&&p(s,"id",o),u&1&&s.value!==r[0]&&F(s,r[0])},d(r){r&&(b(e),b(l),b(s)),f=!1,a()}}}function X(i){let e,t,n,l;const s=[U,Q],o=[];function f(a,r){return a[2]?0:1}return e=f(i),t=o[e]=s[e](i),{c(){t.c(),n=R()},m(a,r){o[e].m(a,r),_(a,n,r),l=!0},p(a,r){let u=e;e=f(a),e===u?o[e].p(a,r):(W(),v(o[u],1,1,()=>{o[u]=null}),Y(),t=o[e],t?t.p(a,r):(t=o[e]=s[e](a),t.c()),h(t,1),t.m(n.parentNode,n))},i(a){l||(h(t),l=!0)},o(a){v(t),l=!1},d(a){a&&b(n),o[e].d(a)}}}function Z(i){let e,t;return e=new M({props:{nobranding:!0,$$slots:{default:[X]},$$scope:{ctx:i}}}),{c(){S(e.$$.fragment)},m(n,l){L(e,n,l),t=!0},p(n,[l]){const s={};l&527&&(s.$$scope={dirty:l,ctx:n}),e.$set(s)},i(n){t||(h(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){z(e,n)}}}function x(i,e,t){let n,{params:l}=e,s="",o=!1,f=!1;async function a(){if(o)return;t(1,o=!0);const k=new j("../");try{const $=A(l==null?void 0:l.token);await k.collection($.collectionId).confirmEmailChange(l==null?void 0:l.token,s),t(2,f=!0)}catch($){B.error($)}t(1,o=!1)}const r=()=>window.close();function u(){s=this.value,t(0,s)}return i.$$set=k=>{"params"in k&&t(5,l=k.params)},i.$$.update=()=>{i.$$.dirty&32&&t(3,n=N.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[s,o,f,n,a,l,r,u]}class te extends G{constructor(e){super(),I(this,e,x,Z,J,{params:5})}}export{te as default}; diff --git a/ui/dist/assets/PageRecordConfirmPasswordReset-bfd8a556.js b/ui/dist/assets/PageRecordConfirmPasswordReset-0229c5a8.js similarity index 98% rename from ui/dist/assets/PageRecordConfirmPasswordReset-bfd8a556.js rename to ui/dist/assets/PageRecordConfirmPasswordReset-0229c5a8.js index 29ccc00f..d1cab3b4 100644 --- a/ui/dist/assets/PageRecordConfirmPasswordReset-bfd8a556.js +++ b/ui/dist/assets/PageRecordConfirmPasswordReset-0229c5a8.js @@ -1,2 +1,2 @@ -import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as q,b as C,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-7d33ef4c.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password +import{S as J,i as M,s as W,F as Y,c as H,m as N,t as P,a as y,d as T,C as j,E as A,g as _,k as B,n as D,o as m,G as K,H as O,p as Q,q as E,e as b,w as q,b as C,f as p,r as G,h as w,u as S,v as U,y as F,x as V,z as R}from"./index-6c8f1731.js";function X(a){let e,l,s,n,t,o,c,r,i,u,v,g,k,h,d=a[4]&&I(a);return o=new E({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),r=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:a}}}),{c(){e=b("form"),l=b("div"),s=b("h5"),n=q(`Reset your user password `),d&&d.c(),t=C(),H(o.$$.fragment),c=C(),H(r.$$.fragment),i=C(),u=b("button"),v=b("span"),v.textContent="Set new password",p(l,"class","content txt-center m-b-base"),p(v,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-lg btn-block"),u.disabled=a[2],G(u,"btn-loading",a[2])},m(f,$){_(f,e,$),w(e,l),w(l,s),w(s,n),d&&d.m(s,null),w(e,t),N(o,e,null),w(e,c),N(r,e,null),w(e,i),w(e,u),w(u,v),g=!0,k||(h=S(e,"submit",U(a[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=I(f),d.c(),d.m(s,null)):d&&(d.d(1),d=null);const L={};$&3073&&(L.$$scope={dirty:$,ctx:f}),o.$set(L);const z={};$&3074&&(z.$$scope={dirty:$,ctx:f}),r.$set(z),(!g||$&4)&&(u.disabled=f[2]),(!g||$&4)&&G(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(r.$$.fragment,f),g=!0)},o(f){y(o.$$.fragment,f),y(r.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),T(o),T(r),k=!1,h()}}}function Z(a){let e,l,s,n,t;return{c(){e=b("div"),e.innerHTML='

Successfully changed the user password.

You can now sign in with your new password.

',l=C(),s=b("button"),s.textContent="Close",p(e,"class","alert alert-success"),p(s,"type","button"),p(s,"class","btn btn-transparent btn-block")},m(o,c){_(o,e,c),_(o,l,c),_(o,s,c),n||(t=S(s,"click",a[7]),n=!0)},p:F,i:F,o:F,d(o){o&&(m(e),m(l),m(s)),n=!1,t()}}}function I(a){let e,l,s;return{c(){e=q("for "),l=b("strong"),s=q(a[4])},m(n,t){_(n,e,t),_(n,l,t),w(l,s)},p(n,t){t&16&&V(s,n[4])},d(n){n&&(m(e),m(l))}}}function x(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0,t.autofocus=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[0]),t.focus(),c||(r=S(t,"input",a[8]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function ee(a){let e,l,s,n,t,o,c,r;return{c(){e=b("label"),l=q("New password confirm"),n=C(),t=b("input"),p(e,"for",s=a[10]),p(t,"type","password"),p(t,"id",o=a[10]),t.required=!0},m(i,u){_(i,e,u),w(e,l),_(i,n,u),_(i,t,u),R(t,a[1]),c||(r=S(t,"input",a[9]),c=!0)},p(i,u){u&1024&&s!==(s=i[10])&&p(e,"for",s),u&1024&&o!==(o=i[10])&&p(t,"id",o),u&2&&t.value!==i[1]&&R(t,i[1])},d(i){i&&(m(e),m(n),m(t)),c=!1,r()}}}function te(a){let e,l,s,n;const t=[Z,X],o=[];function c(r,i){return r[3]?0:1}return e=c(a),l=o[e]=t[e](a),{c(){l.c(),s=A()},m(r,i){o[e].m(r,i),_(r,s,i),n=!0},p(r,i){let u=e;e=c(r),e===u?o[e].p(r,i):(B(),y(o[u],1,1,()=>{o[u]=null}),D(),l=o[e],l?l.p(r,i):(l=o[e]=t[e](r),l.c()),P(l,1),l.m(s.parentNode,s))},i(r){n||(P(l),n=!0)},o(r){y(l),n=!1},d(r){r&&m(s),o[e].d(r)}}}function se(a){let e,l;return e=new Y({props:{nobranding:!0,$$slots:{default:[te]},$$scope:{ctx:a}}}),{c(){H(e.$$.fragment)},m(s,n){N(e,s,n),l=!0},p(s,[n]){const t={};n&2079&&(t.$$scope={dirty:n,ctx:s}),e.$set(t)},i(s){l||(P(e.$$.fragment,s),l=!0)},o(s){y(e.$$.fragment,s),l=!1},d(s){T(e,s)}}}function le(a,e,l){let s,{params:n}=e,t="",o="",c=!1,r=!1;async function i(){if(c)return;l(2,c=!0);const k=new K("../");try{const h=O(n==null?void 0:n.token);await k.collection(h.collectionId).confirmPasswordReset(n==null?void 0:n.token,t,o),l(3,r=!0)}catch(h){Q.error(h)}l(2,c=!1)}const u=()=>window.close();function v(){t=this.value,l(0,t)}function g(){o=this.value,l(1,o)}return a.$$set=k=>{"params"in k&&l(6,n=k.params)},a.$$.update=()=>{a.$$.dirty&64&&l(4,s=j.getJWTPayload(n==null?void 0:n.token).email||"")},[t,o,c,r,s,i,n,u,v,g]}class oe extends J{constructor(e){super(),M(this,e,le,se,W,{params:6})}}export{oe as default}; diff --git a/ui/dist/assets/PageRecordConfirmVerification-44fc3c9e.js b/ui/dist/assets/PageRecordConfirmVerification-6165faf3.js similarity index 97% rename from ui/dist/assets/PageRecordConfirmVerification-44fc3c9e.js rename to ui/dist/assets/PageRecordConfirmVerification-6165faf3.js index d7329ee3..6b378725 100644 --- a/ui/dist/assets/PageRecordConfirmVerification-44fc3c9e.js +++ b/ui/dist/assets/PageRecordConfirmVerification-6165faf3.js @@ -1 +1 @@ -import{S as v,i as y,s as g,F as w,c as C,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as a,o as r,e as f,b as _,f as d,u as b,y as p}from"./index-7d33ef4c.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){C(t.$$.fragment)},m(e,n){x(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; +import{S as v,i as y,s as g,F as w,c as C,m as x,t as $,a as H,d as L,G as P,H as T,E as M,g as a,o as r,e as f,b as _,f as d,u as b,y as p}from"./index-6c8f1731.js";function S(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Invalid or expired verification token.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-danger"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[4]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function h(c){let t,s,e,n,l;return{c(){t=f("div"),t.innerHTML='

Successfully verified email address.

',s=_(),e=f("button"),e.textContent="Close",d(t,"class","alert alert-success"),d(e,"type","button"),d(e,"class","btn btn-transparent btn-block")},m(i,o){a(i,t,o),a(i,s,o),a(i,e,o),n||(l=b(e,"click",c[3]),n=!0)},p,d(i){i&&(r(t),r(s),r(e)),n=!1,l()}}}function F(c){let t;return{c(){t=f("div"),t.innerHTML='
Please wait...
',d(t,"class","txt-center")},m(s,e){a(s,t,e)},p,d(s){s&&r(t)}}}function I(c){let t;function s(l,i){return l[1]?F:l[0]?h:S}let e=s(c),n=e(c);return{c(){n.c(),t=M()},m(l,i){n.m(l,i),a(l,t,i)},p(l,i){e===(e=s(l))&&n?n.p(l,i):(n.d(1),n=e(l),n&&(n.c(),n.m(t.parentNode,t)))},d(l){l&&r(t),n.d(l)}}}function V(c){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[I]},$$scope:{ctx:c}}}),{c(){C(t.$$.fragment)},m(e,n){x(t,e,n),s=!0},p(e,[n]){const l={};n&67&&(l.$$scope={dirty:n,ctx:e}),t.$set(l)},i(e){s||($(t.$$.fragment,e),s=!0)},o(e){H(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function q(c,t,s){let{params:e}=t,n=!1,l=!1;i();async function i(){s(1,l=!0);const u=new P("../");try{const m=T(e==null?void 0:e.token);await u.collection(m.collectionId).confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch{s(0,n=!1)}s(1,l=!1)}const o=()=>window.close(),k=()=>window.close();return c.$$set=u=>{"params"in u&&s(2,e=u.params)},[n,l,e,o,k]}class G extends v{constructor(t){super(),y(this,t,q,V,g,{params:2})}}export{G as default}; diff --git a/ui/dist/assets/RealtimeApiDocs-531c981c.js b/ui/dist/assets/RealtimeApiDocs-614048dc.js similarity index 98% rename from ui/dist/assets/RealtimeApiDocs-531c981c.js rename to ui/dist/assets/RealtimeApiDocs-614048dc.js index 731aedd0..15944803 100644 --- a/ui/dist/assets/RealtimeApiDocs-531c981c.js +++ b/ui/dist/assets/RealtimeApiDocs-614048dc.js @@ -1,4 +1,4 @@ -import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-7d33ef4c.js";import{S as de}from"./SdkTabs-f0532e58.js";function fe(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,D,f,_,$,k,l,S,g,C,v,w,h,E,r,R;return l=new de({props:{js:` +import{S as re,i as ae,s as be,N as pe,C as P,e as p,w as y,b as a,c as se,f as u,g as s,h as I,m as ne,x as ue,t as ie,a as ce,o as n,d as le,p as me}from"./index-6c8f1731.js";import{S as de}from"./SdkTabs-821a5c7e.js";function fe(t){var B,U,W,A,H,L,T,q,M,N,j,J;let i,m,c=t[0].name+"",b,d,D,f,_,$,k,l,S,g,C,v,w,h,E,r,R;return l=new de({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${t[1]}'); diff --git a/ui/dist/assets/RequestEmailChangeDocs-67bd3d32.js b/ui/dist/assets/RequestEmailChangeDocs-b1c5a122.js similarity index 98% rename from ui/dist/assets/RequestEmailChangeDocs-67bd3d32.js rename to ui/dist/assets/RequestEmailChangeDocs-b1c5a122.js index 8fc55e1d..257a0332 100644 --- a/ui/dist/assets/RequestEmailChangeDocs-67bd3d32.js +++ b/ui/dist/assets/RequestEmailChangeDocs-b1c5a122.js @@ -1,4 +1,4 @@ -import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-7d33ef4c.js";import{S as je}from"./SdkTabs-f0532e58.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` +import{S as Ee,i as Be,s as Se,O as L,e as r,w as v,b as k,c as Ce,f as b,g as d,h as n,m as ye,x as N,P as ve,Q as Re,k as Me,R as Ae,n as We,t as ee,a as te,o as m,d as Te,C as ze,p as He,r as F,u as Oe,N as Ue}from"./index-6c8f1731.js";import{S as je}from"./SdkTabs-821a5c7e.js";function we(o,l,a){const s=o.slice();return s[5]=l[a],s}function $e(o,l,a){const s=o.slice();return s[5]=l[a],s}function qe(o,l){let a,s=l[5].code+"",h,f,i,p;function u(){return l[4](l[5])}return{key:o,first:null,c(){a=r("button"),h=v(s),f=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m($,q){d($,a,q),n(a,h),n(a,f),i||(p=Oe(a,"click",u),i=!0)},p($,q){l=$,q&4&&s!==(s=l[5].code+"")&&N(h,s),q&6&&F(a,"active",l[1]===l[5].code)},d($){$&&m(a),i=!1,p()}}}function Pe(o,l){let a,s,h,f;return s=new Ue({props:{content:l[5].body}}),{key:o,first:null,c(){a=r("div"),Ce(s.$$.fragment),h=k(),b(a,"class","tab-item"),F(a,"active",l[1]===l[5].code),this.first=a},m(i,p){d(i,a,p),ye(s,a,null),n(a,h),f=!0},p(i,p){l=i;const u={};p&4&&(u.content=l[5].body),s.$set(u),(!f||p&6)&&F(a,"active",l[1]===l[5].code)},i(i){f||(ee(s.$$.fragment,i),f=!0)},o(i){te(s.$$.fragment,i),f=!1},d(i){i&&m(a),Te(s)}}}function De(o){var pe,ue,be,fe;let l,a,s=o[0].name+"",h,f,i,p,u,$,q,z=o[0].name+"",I,le,K,P,Q,T,G,w,H,ae,O,E,se,J,U=o[0].name+"",V,oe,ne,j,X,B,Y,S,Z,R,x,C,M,g=[],ie=new Map,ce,A,_=[],re=new Map,y;P=new je({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestPasswordResetDocs-c6b478f9.js b/ui/dist/assets/RequestPasswordResetDocs-c3812420.js similarity index 97% rename from ui/dist/assets/RequestPasswordResetDocs-c6b478f9.js rename to ui/dist/assets/RequestPasswordResetDocs-c3812420.js index a0bb1e6f..05b93f16 100644 --- a/ui/dist/assets/RequestPasswordResetDocs-c6b478f9.js +++ b/ui/dist/assets/RequestPasswordResetDocs-c3812420.js @@ -1,4 +1,4 @@ -import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-7d33ef4c.js";import{S as Ue}from"./SdkTabs-f0532e58.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` +import{S as Pe,i as $e,s as qe,O as I,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as L,P as fe,Q as ye,k as Re,R as Be,n as Ce,t as x,a as ee,o as p,d as we,C as Se,p as Te,r as N,u as Me,N as Ae}from"./index-6c8f1731.js";import{S as Ue}from"./SdkTabs-821a5c7e.js";function be(o,s,l){const a=o.slice();return a[5]=s[l],a}function _e(o,s,l){const a=o.slice();return a[5]=s[l],a}function ke(o,s){let l,a=s[5].code+"",_,f,i,u;function m(){return s[4](s[5])}return{key:o,first:null,c(){l=r("button"),_=g(a),f=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(w,P){d(w,l,P),n(l,_),n(l,f),i||(u=Me(l,"click",m),i=!0)},p(w,P){s=w,P&4&&a!==(a=s[5].code+"")&&L(_,a),P&6&&N(l,"active",s[1]===s[5].code)},d(w){w&&p(l),i=!1,u()}}}function he(o,s){let l,a,_,f;return a=new Ae({props:{content:s[5].body}}),{key:o,first:null,c(){l=r("div"),ve(a.$$.fragment),_=h(),b(l,"class","tab-item"),N(l,"active",s[1]===s[5].code),this.first=l},m(i,u){d(i,l,u),ge(a,l,null),n(l,_),f=!0},p(i,u){s=i;const m={};u&4&&(m.content=s[5].body),a.$set(m),(!f||u&6)&&N(l,"active",s[1]===s[5].code)},i(i){f||(x(a.$$.fragment,i),f=!0)},o(i){ee(a.$$.fragment,i),f=!1},d(i){i&&p(l),we(a)}}}function je(o){var de,pe;let s,l,a=o[0].name+"",_,f,i,u,m,w,P,D=o[0].name+"",Q,te,z,$,G,B,J,q,H,se,O,C,le,K,E=o[0].name+"",V,ae,W,S,X,T,Y,M,Z,y,A,v=[],oe=new Map,ne,U,k=[],ie=new Map,R;$=new Ue({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/RequestVerificationDocs-7606398a.js b/ui/dist/assets/RequestVerificationDocs-ac34ed9e.js similarity index 97% rename from ui/dist/assets/RequestVerificationDocs-7606398a.js rename to ui/dist/assets/RequestVerificationDocs-ac34ed9e.js index 7f0f1ad9..cd998912 100644 --- a/ui/dist/assets/RequestVerificationDocs-7606398a.js +++ b/ui/dist/assets/RequestVerificationDocs-ac34ed9e.js @@ -1,4 +1,4 @@ -import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-7d33ef4c.js";import{S as Ae}from"./SdkTabs-f0532e58.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` +import{S as qe,i as we,s as Pe,O as F,e as r,w as g,b as h,c as ve,f as b,g as d,h as n,m as ge,x as I,P as pe,Q as ye,k as Be,R as Ce,n as Se,t as x,a as ee,o as f,d as $e,C as Te,p as Re,r as L,u as Ve,N as Me}from"./index-6c8f1731.js";import{S as Ae}from"./SdkTabs-821a5c7e.js";function be(o,l,s){const a=o.slice();return a[5]=l[s],a}function _e(o,l,s){const a=o.slice();return a[5]=l[s],a}function ke(o,l){let s,a=l[5].code+"",_,p,i,u;function m(){return l[4](l[5])}return{key:o,first:null,c(){s=r("button"),_=g(a),p=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m($,q){d($,s,q),n(s,_),n(s,p),i||(u=Ve(s,"click",m),i=!0)},p($,q){l=$,q&4&&a!==(a=l[5].code+"")&&I(_,a),q&6&&L(s,"active",l[1]===l[5].code)},d($){$&&f(s),i=!1,u()}}}function he(o,l){let s,a,_,p;return a=new Me({props:{content:l[5].body}}),{key:o,first:null,c(){s=r("div"),ve(a.$$.fragment),_=h(),b(s,"class","tab-item"),L(s,"active",l[1]===l[5].code),this.first=s},m(i,u){d(i,s,u),ge(a,s,null),n(s,_),p=!0},p(i,u){l=i;const m={};u&4&&(m.content=l[5].body),a.$set(m),(!p||u&6)&&L(s,"active",l[1]===l[5].code)},i(i){p||(x(a.$$.fragment,i),p=!0)},o(i){ee(a.$$.fragment,i),p=!1},d(i){i&&f(s),$e(a)}}}function Ue(o){var de,fe;let l,s,a=o[0].name+"",_,p,i,u,m,$,q,j=o[0].name+"",N,te,Q,w,z,C,G,P,D,le,H,S,se,J,O=o[0].name+"",K,ae,W,T,X,R,Y,V,Z,y,M,v=[],oe=new Map,ne,A,k=[],ie=new Map,B;w=new Ae({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${o[3]}'); diff --git a/ui/dist/assets/SdkTabs-f0532e58.js b/ui/dist/assets/SdkTabs-821a5c7e.js similarity index 98% rename from ui/dist/assets/SdkTabs-f0532e58.js rename to ui/dist/assets/SdkTabs-821a5c7e.js index 11dad90a..91d270ef 100644 --- a/ui/dist/assets/SdkTabs-f0532e58.js +++ b/ui/dist/assets/SdkTabs-821a5c7e.js @@ -1 +1 @@ -import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as w,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,w as E,r as y,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-7d33ef4c.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(_,f){w(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&y(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(b,t){w(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&y(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; +import{S as B,i as F,s as J,O as j,e as v,b as S,f as h,g as w,h as m,P as D,Q as O,k as Q,R as Y,n as z,t as N,a as P,o as C,w as E,r as y,u as A,x as q,N as G,c as H,m as L,d as U}from"./index-6c8f1731.js";function K(o,e,l){const s=o.slice();return s[6]=e[l],s}function R(o,e,l){const s=o.slice();return s[6]=e[l],s}function T(o,e){let l,s,g=e[6].title+"",r,i,n,k;function c(){return e[5](e[6])}return{key:o,first:null,c(){l=v("button"),s=v("div"),r=E(g),i=S(),h(s,"class","txt"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(_,f){w(_,l,f),m(l,s),m(s,r),m(l,i),n||(k=A(l,"click",c),n=!0)},p(_,f){e=_,f&4&&g!==(g=e[6].title+"")&&q(r,g),f&6&&y(l,"active",e[1]===e[6].language)},d(_){_&&C(l),n=!1,k()}}}function I(o,e){let l,s,g,r,i,n,k=e[6].title+"",c,_,f,p,d;return s=new G({props:{language:e[6].language,content:e[6].content}}),{key:o,first:null,c(){l=v("div"),H(s.$$.fragment),g=S(),r=v("div"),i=v("em"),n=v("a"),c=E(k),_=E(" SDK"),p=S(),h(n,"href",f=e[6].url),h(n,"target","_blank"),h(n,"rel","noopener noreferrer"),h(i,"class","txt-sm txt-hint"),h(r,"class","txt-right"),h(l,"class","tab-item svelte-1maocj6"),y(l,"active",e[1]===e[6].language),this.first=l},m(b,t){w(b,l,t),L(s,l,null),m(l,g),m(l,r),m(r,i),m(i,n),m(n,c),m(n,_),m(l,p),d=!0},p(b,t){e=b;const a={};t&4&&(a.language=e[6].language),t&4&&(a.content=e[6].content),s.$set(a),(!d||t&4)&&k!==(k=e[6].title+"")&&q(c,k),(!d||t&4&&f!==(f=e[6].url))&&h(n,"href",f),(!d||t&6)&&y(l,"active",e[1]===e[6].language)},i(b){d||(N(s.$$.fragment,b),d=!0)},o(b){P(s.$$.fragment,b),d=!1},d(b){b&&C(l),U(s)}}}function V(o){let e,l,s=[],g=new Map,r,i,n=[],k=new Map,c,_,f=j(o[2]);const p=t=>t[6].language;for(let t=0;tt[6].language;for(let t=0;tl(1,n=c.language);return o.$$set=c=>{"class"in c&&l(0,g=c.class),"js"in c&&l(3,r=c.js),"dart"in c&&l(4,i=c.dart)},o.$$.update=()=>{o.$$.dirty&2&&n&&localStorage.setItem(M,n),o.$$.dirty&24&&l(2,s=[{title:"JavaScript",language:"javascript",content:r,url:"https://github.com/pocketbase/js-sdk"},{title:"Dart",language:"dart",content:i,url:"https://github.com/pocketbase/dart-sdk"}])},[g,n,s,r,i,k]}class Z extends B{constructor(e){super(),F(this,e,W,V,J,{class:0,js:3,dart:4})}}export{Z as S}; diff --git a/ui/dist/assets/UnlinkExternalAuthDocs-d7bb55bc.js b/ui/dist/assets/UnlinkExternalAuthDocs-1e98af12.js similarity index 98% rename from ui/dist/assets/UnlinkExternalAuthDocs-d7bb55bc.js rename to ui/dist/assets/UnlinkExternalAuthDocs-1e98af12.js index 3fd474c7..3b9b032b 100644 --- a/ui/dist/assets/UnlinkExternalAuthDocs-d7bb55bc.js +++ b/ui/dist/assets/UnlinkExternalAuthDocs-1e98af12.js @@ -1,4 +1,4 @@ -import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-7d33ef4c.js";import{S as Ke}from"./SdkTabs-f0532e58.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` +import{S as Oe,i as De,s as Me,O as j,e as i,w as g,b as f,c as Be,f as b,g as d,h as a,m as Ue,x as I,P as Ae,Q as We,k as ze,R as He,n as Le,t as oe,a as ae,o as u,d as qe,C as Re,p as je,r as N,u as Ie,N as Ne}from"./index-6c8f1731.js";import{S as Ke}from"./SdkTabs-821a5c7e.js";function Ce(n,l,o){const s=n.slice();return s[5]=l[o],s}function Te(n,l,o){const s=n.slice();return s[5]=l[o],s}function Ee(n,l){let o,s=l[5].code+"",_,h,c,p;function m(){return l[4](l[5])}return{key:n,first:null,c(){o=i("button"),_=g(s),h=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m($,P){d($,o,P),a(o,_),a(o,h),c||(p=Ie(o,"click",m),c=!0)},p($,P){l=$,P&4&&s!==(s=l[5].code+"")&&I(_,s),P&6&&N(o,"active",l[1]===l[5].code)},d($){$&&u(o),c=!1,p()}}}function Se(n,l){let o,s,_,h;return s=new Ne({props:{content:l[5].body}}),{key:n,first:null,c(){o=i("div"),Be(s.$$.fragment),_=f(),b(o,"class","tab-item"),N(o,"active",l[1]===l[5].code),this.first=o},m(c,p){d(c,o,p),Ue(s,o,null),a(o,_),h=!0},p(c,p){l=c;const m={};p&4&&(m.content=l[5].body),s.$set(m),(!h||p&6)&&N(o,"active",l[1]===l[5].code)},i(c){h||(oe(s.$$.fragment,c),h=!0)},o(c){ae(s.$$.fragment,c),h=!1},d(c){c&&u(o),qe(s)}}}function Qe(n){var _e,ke,ge,ve;let l,o,s=n[0].name+"",_,h,c,p,m,$,P,M=n[0].name+"",K,se,ne,Q,F,A,G,E,J,w,W,ie,z,y,ce,V,H=n[0].name+"",X,re,Y,de,Z,ue,L,x,S,ee,B,te,U,le,C,q,v=[],pe=new Map,me,O,k=[],be=new Map,T;A=new Ke({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${n[3]}'); diff --git a/ui/dist/assets/UpdateApiDocs-ae87c615.js b/ui/dist/assets/UpdateApiDocs-fc34c4b8.js similarity index 98% rename from ui/dist/assets/UpdateApiDocs-ae87c615.js rename to ui/dist/assets/UpdateApiDocs-fc34c4b8.js index 159fa333..a68176e8 100644 --- a/ui/dist/assets/UpdateApiDocs-ae87c615.js +++ b/ui/dist/assets/UpdateApiDocs-fc34c4b8.js @@ -1,4 +1,4 @@ -import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-7d33ef4c.js";import{S as Ft}from"./SdkTabs-f0532e58.js";import{F as Nt}from"./FieldsQueryParam-f6b769d1.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record +import{S as $t,i as Mt,s as qt,C as I,O as Z,N as Ot,e as r,w as b,b as f,c as he,f as v,g as i,h as s,m as ye,x as J,P as Ee,Q as _t,k as Ht,R as Rt,n as Dt,t as ce,a as pe,o as d,d as ke,p as Lt,r as ve,u as Pt,y as ee}from"./index-6c8f1731.js";import{S as Ft}from"./SdkTabs-821a5c7e.js";import{F as Nt}from"./FieldsQueryParam-2d478986.js";function ht(c,e,t){const n=c.slice();return n[8]=e[t],n}function yt(c,e,t){const n=c.slice();return n[8]=e[t],n}function kt(c,e,t){const n=c.slice();return n[13]=e[t],n}function vt(c){let e;return{c(){e=r("p"),e.innerHTML=`Note that in case of a password change all previously issued tokens for the current record will be automatically invalidated and if you want your user to remain signed in you need to reauthenticate manually after the update call.`},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function gt(c){let e;return{c(){e=r("p"),e.innerHTML="Requires admin Authorization:TOKEN header",v(e,"class","txt-hint txt-sm txt-right")},m(t,n){i(t,e,n)},d(t){t&&d(e)}}}function wt(c){let e,t,n,u,m,o,p,h,w,S,g,$,P,E,M,U,F;return{c(){e=r("tr"),e.innerHTML='Auth fields',t=f(),n=r("tr"),n.innerHTML='
Optional username
String The username of the auth record.',u=f(),m=r("tr"),m.innerHTML=`
Optional email
String The auth record email address.
diff --git a/ui/dist/assets/ViewApiDocs-7f75b66b.js b/ui/dist/assets/ViewApiDocs-23e66fca.js similarity index 97% rename from ui/dist/assets/ViewApiDocs-7f75b66b.js rename to ui/dist/assets/ViewApiDocs-23e66fca.js index a6c14852..951d1e4e 100644 --- a/ui/dist/assets/ViewApiDocs-7f75b66b.js +++ b/ui/dist/assets/ViewApiDocs-23e66fca.js @@ -1,4 +1,4 @@ -import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-7d33ef4c.js";import{S as pt}from"./SdkTabs-f0532e58.js";import{F as ut}from"./FieldsQueryParam-f6b769d1.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` +import{S as lt,i as nt,s as st,N as tt,O as K,e as o,w as _,b as m,c as W,f as b,g as r,h as l,m as X,x as ve,P as Je,Q as ot,k as at,R as it,n as rt,t as Q,a as U,o as d,d as Y,C as Ke,p as dt,r as Z,u as ct}from"./index-6c8f1731.js";import{S as pt}from"./SdkTabs-821a5c7e.js";import{F as ut}from"./FieldsQueryParam-2d478986.js";function We(a,n,s){const i=a.slice();return i[6]=n[s],i}function Xe(a,n,s){const i=a.slice();return i[6]=n[s],i}function Ye(a){let n;return{c(){n=o("p"),n.innerHTML="Requires admin Authorization:TOKEN header",b(n,"class","txt-hint txt-sm txt-right")},m(s,i){r(s,n,i)},d(s){s&&d(n)}}}function Ze(a,n){let s,i,v;function p(){return n[5](n[6])}return{key:a,first:null,c(){s=o("button"),s.textContent=`${n[6].code} `,b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),i||(v=ct(s,"click",p),i=!0)},p(c,f){n=c,f&20&&Z(s,"active",n[2]===n[6].code)},d(c){c&&d(s),i=!1,v()}}}function et(a,n){let s,i,v,p;return i=new tt({props:{content:n[6].body}}),{key:a,first:null,c(){s=o("div"),W(i.$$.fragment),v=m(),b(s,"class","tab-item"),Z(s,"active",n[2]===n[6].code),this.first=s},m(c,f){r(c,s,f),X(i,s,null),l(s,v),p=!0},p(c,f){n=c,(!p||f&20)&&Z(s,"active",n[2]===n[6].code)},i(c){p||(Q(i.$$.fragment,c),p=!0)},o(c){U(i.$$.fragment,c),p=!1},d(c){c&&d(s),Y(i)}}}function ft(a){var je,Ve;let n,s,i=a[0].name+"",v,p,c,f,w,C,ee,j=a[0].name+"",te,$e,le,F,ne,x,se,$,V,ye,z,T,we,oe,G=a[0].name+"",ae,Ce,ie,Fe,re,B,de,A,ce,I,pe,R,ue,Re,M,O,fe,Oe,me,Pe,h,De,E,Te,Ee,Se,be,xe,_e,Be,Ae,Ie,he,Me,qe,S,ke,q,ge,P,H,y=[],He=new Map,Le,L,k=[],Ne=new Map,D;F=new pt({props:{js:` import PocketBase from 'pocketbase'; const pb = new PocketBase('${a[3]}'); diff --git a/ui/dist/assets/index-0a754981.css b/ui/dist/assets/index-0a754981.css new file mode 100644 index 00000000..c4c2a3bd --- /dev/null +++ b/ui/dist/assets/index-0a754981.css @@ -0,0 +1 @@ +@charset "UTF-8";@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #a0a6ac;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #e4e9ec;--baseAlt2Color: #d7dde4;--baseAlt3Color: #c6cdd7;--baseAlt4Color: #a5b0c0;--infoColor: #5499e8;--infoAltColor: #cee2f8;--successColor: #32ad84;--successAltColor: #c4eedc;--dangerColor: #e34562;--dangerAltColor: #f7cad2;--warningColor: #ff944d;--warningAltColor: #ffd4b8;--overlayColor: rgba(53, 71, 104, .28);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .06);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 22px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 230px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--entranceAnimationSpeed: .25s;--baseRadius: 4px;--lgRadius: 12px;--btnRadius: 4px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:""}.ri-24-hours-line:before{content:""}.ri-4k-fill:before{content:""}.ri-4k-line:before{content:""}.ri-a-b:before{content:""}.ri-account-box-fill:before{content:""}.ri-account-box-line:before{content:""}.ri-account-circle-fill:before{content:""}.ri-account-circle-line:before{content:""}.ri-account-pin-box-fill:before{content:""}.ri-account-pin-box-line:before{content:""}.ri-account-pin-circle-fill:before{content:""}.ri-account-pin-circle-line:before{content:""}.ri-add-box-fill:before{content:""}.ri-add-box-line:before{content:""}.ri-add-circle-fill:before{content:""}.ri-add-circle-line:before{content:""}.ri-add-fill:before{content:""}.ri-add-line:before{content:""}.ri-admin-fill:before{content:""}.ri-admin-line:before{content:""}.ri-advertisement-fill:before{content:""}.ri-advertisement-line:before{content:""}.ri-airplay-fill:before{content:""}.ri-airplay-line:before{content:""}.ri-alarm-fill:before{content:""}.ri-alarm-line:before{content:""}.ri-alarm-warning-fill:before{content:""}.ri-alarm-warning-line:before{content:""}.ri-album-fill:before{content:""}.ri-album-line:before{content:""}.ri-alert-fill:before{content:""}.ri-alert-line:before{content:""}.ri-aliens-fill:before{content:""}.ri-aliens-line:before{content:""}.ri-align-bottom:before{content:""}.ri-align-center:before{content:""}.ri-align-justify:before{content:""}.ri-align-left:before{content:""}.ri-align-right:before{content:""}.ri-align-top:before{content:""}.ri-align-vertically:before{content:""}.ri-alipay-fill:before{content:""}.ri-alipay-line:before{content:""}.ri-amazon-fill:before{content:""}.ri-amazon-line:before{content:""}.ri-anchor-fill:before{content:""}.ri-anchor-line:before{content:""}.ri-ancient-gate-fill:before{content:""}.ri-ancient-gate-line:before{content:""}.ri-ancient-pavilion-fill:before{content:""}.ri-ancient-pavilion-line:before{content:""}.ri-android-fill:before{content:""}.ri-android-line:before{content:""}.ri-angularjs-fill:before{content:""}.ri-angularjs-line:before{content:""}.ri-anticlockwise-2-fill:before{content:""}.ri-anticlockwise-2-line:before{content:""}.ri-anticlockwise-fill:before{content:""}.ri-anticlockwise-line:before{content:""}.ri-app-store-fill:before{content:""}.ri-app-store-line:before{content:""}.ri-apple-fill:before{content:""}.ri-apple-line:before{content:""}.ri-apps-2-fill:before{content:""}.ri-apps-2-line:before{content:""}.ri-apps-fill:before{content:""}.ri-apps-line:before{content:""}.ri-archive-drawer-fill:before{content:""}.ri-archive-drawer-line:before{content:""}.ri-archive-fill:before{content:""}.ri-archive-line:before{content:""}.ri-arrow-down-circle-fill:before{content:""}.ri-arrow-down-circle-line:before{content:""}.ri-arrow-down-fill:before{content:""}.ri-arrow-down-line:before{content:""}.ri-arrow-down-s-fill:before{content:""}.ri-arrow-down-s-line:before{content:""}.ri-arrow-drop-down-fill:before{content:""}.ri-arrow-drop-down-line:before{content:""}.ri-arrow-drop-left-fill:before{content:""}.ri-arrow-drop-left-line:before{content:""}.ri-arrow-drop-right-fill:before{content:""}.ri-arrow-drop-right-line:before{content:""}.ri-arrow-drop-up-fill:before{content:""}.ri-arrow-drop-up-line:before{content:""}.ri-arrow-go-back-fill:before{content:""}.ri-arrow-go-back-line:before{content:""}.ri-arrow-go-forward-fill:before{content:""}.ri-arrow-go-forward-line:before{content:""}.ri-arrow-left-circle-fill:before{content:""}.ri-arrow-left-circle-line:before{content:""}.ri-arrow-left-down-fill:before{content:""}.ri-arrow-left-down-line:before{content:""}.ri-arrow-left-fill:before{content:""}.ri-arrow-left-line:before{content:""}.ri-arrow-left-right-fill:before{content:""}.ri-arrow-left-right-line:before{content:""}.ri-arrow-left-s-fill:before{content:""}.ri-arrow-left-s-line:before{content:""}.ri-arrow-left-up-fill:before{content:""}.ri-arrow-left-up-line:before{content:""}.ri-arrow-right-circle-fill:before{content:""}.ri-arrow-right-circle-line:before{content:""}.ri-arrow-right-down-fill:before{content:""}.ri-arrow-right-down-line:before{content:""}.ri-arrow-right-fill:before{content:""}.ri-arrow-right-line:before{content:""}.ri-arrow-right-s-fill:before{content:""}.ri-arrow-right-s-line:before{content:""}.ri-arrow-right-up-fill:before{content:""}.ri-arrow-right-up-line:before{content:""}.ri-arrow-up-circle-fill:before{content:""}.ri-arrow-up-circle-line:before{content:""}.ri-arrow-up-down-fill:before{content:""}.ri-arrow-up-down-line:before{content:""}.ri-arrow-up-fill:before{content:""}.ri-arrow-up-line:before{content:""}.ri-arrow-up-s-fill:before{content:""}.ri-arrow-up-s-line:before{content:""}.ri-artboard-2-fill:before{content:""}.ri-artboard-2-line:before{content:""}.ri-artboard-fill:before{content:""}.ri-artboard-line:before{content:""}.ri-article-fill:before{content:""}.ri-article-line:before{content:""}.ri-aspect-ratio-fill:before{content:""}.ri-aspect-ratio-line:before{content:""}.ri-asterisk:before{content:""}.ri-at-fill:before{content:""}.ri-at-line:before{content:""}.ri-attachment-2:before{content:""}.ri-attachment-fill:before{content:""}.ri-attachment-line:before{content:""}.ri-auction-fill:before{content:""}.ri-auction-line:before{content:""}.ri-award-fill:before{content:""}.ri-award-line:before{content:""}.ri-baidu-fill:before{content:""}.ri-baidu-line:before{content:""}.ri-ball-pen-fill:before{content:""}.ri-ball-pen-line:before{content:""}.ri-bank-card-2-fill:before{content:""}.ri-bank-card-2-line:before{content:""}.ri-bank-card-fill:before{content:""}.ri-bank-card-line:before{content:""}.ri-bank-fill:before{content:""}.ri-bank-line:before{content:""}.ri-bar-chart-2-fill:before{content:""}.ri-bar-chart-2-line:before{content:""}.ri-bar-chart-box-fill:before{content:""}.ri-bar-chart-box-line:before{content:""}.ri-bar-chart-fill:before{content:""}.ri-bar-chart-grouped-fill:before{content:""}.ri-bar-chart-grouped-line:before{content:""}.ri-bar-chart-horizontal-fill:before{content:""}.ri-bar-chart-horizontal-line:before{content:""}.ri-bar-chart-line:before{content:""}.ri-barcode-box-fill:before{content:""}.ri-barcode-box-line:before{content:""}.ri-barcode-fill:before{content:""}.ri-barcode-line:before{content:""}.ri-barricade-fill:before{content:""}.ri-barricade-line:before{content:""}.ri-base-station-fill:before{content:""}.ri-base-station-line:before{content:""}.ri-basketball-fill:before{content:""}.ri-basketball-line:before{content:""}.ri-battery-2-charge-fill:before{content:""}.ri-battery-2-charge-line:before{content:""}.ri-battery-2-fill:before{content:""}.ri-battery-2-line:before{content:""}.ri-battery-charge-fill:before{content:""}.ri-battery-charge-line:before{content:""}.ri-battery-fill:before{content:""}.ri-battery-line:before{content:""}.ri-battery-low-fill:before{content:""}.ri-battery-low-line:before{content:""}.ri-battery-saver-fill:before{content:""}.ri-battery-saver-line:before{content:""}.ri-battery-share-fill:before{content:""}.ri-battery-share-line:before{content:""}.ri-bear-smile-fill:before{content:""}.ri-bear-smile-line:before{content:""}.ri-behance-fill:before{content:""}.ri-behance-line:before{content:""}.ri-bell-fill:before{content:""}.ri-bell-line:before{content:""}.ri-bike-fill:before{content:""}.ri-bike-line:before{content:""}.ri-bilibili-fill:before{content:""}.ri-bilibili-line:before{content:""}.ri-bill-fill:before{content:""}.ri-bill-line:before{content:""}.ri-billiards-fill:before{content:""}.ri-billiards-line:before{content:""}.ri-bit-coin-fill:before{content:""}.ri-bit-coin-line:before{content:""}.ri-blaze-fill:before{content:""}.ri-blaze-line:before{content:""}.ri-bluetooth-connect-fill:before{content:""}.ri-bluetooth-connect-line:before{content:""}.ri-bluetooth-fill:before{content:""}.ri-bluetooth-line:before{content:""}.ri-blur-off-fill:before{content:""}.ri-blur-off-line:before{content:""}.ri-body-scan-fill:before{content:""}.ri-body-scan-line:before{content:""}.ri-bold:before{content:""}.ri-book-2-fill:before{content:""}.ri-book-2-line:before{content:""}.ri-book-3-fill:before{content:""}.ri-book-3-line:before{content:""}.ri-book-fill:before{content:""}.ri-book-line:before{content:""}.ri-book-mark-fill:before{content:""}.ri-book-mark-line:before{content:""}.ri-book-open-fill:before{content:""}.ri-book-open-line:before{content:""}.ri-book-read-fill:before{content:""}.ri-book-read-line:before{content:""}.ri-booklet-fill:before{content:""}.ri-booklet-line:before{content:""}.ri-bookmark-2-fill:before{content:""}.ri-bookmark-2-line:before{content:""}.ri-bookmark-3-fill:before{content:""}.ri-bookmark-3-line:before{content:""}.ri-bookmark-fill:before{content:""}.ri-bookmark-line:before{content:""}.ri-boxing-fill:before{content:""}.ri-boxing-line:before{content:""}.ri-braces-fill:before{content:""}.ri-braces-line:before{content:""}.ri-brackets-fill:before{content:""}.ri-brackets-line:before{content:""}.ri-briefcase-2-fill:before{content:""}.ri-briefcase-2-line:before{content:""}.ri-briefcase-3-fill:before{content:""}.ri-briefcase-3-line:before{content:""}.ri-briefcase-4-fill:before{content:""}.ri-briefcase-4-line:before{content:""}.ri-briefcase-5-fill:before{content:""}.ri-briefcase-5-line:before{content:""}.ri-briefcase-fill:before{content:""}.ri-briefcase-line:before{content:""}.ri-bring-forward:before{content:""}.ri-bring-to-front:before{content:""}.ri-broadcast-fill:before{content:""}.ri-broadcast-line:before{content:""}.ri-brush-2-fill:before{content:""}.ri-brush-2-line:before{content:""}.ri-brush-3-fill:before{content:""}.ri-brush-3-line:before{content:""}.ri-brush-4-fill:before{content:""}.ri-brush-4-line:before{content:""}.ri-brush-fill:before{content:""}.ri-brush-line:before{content:""}.ri-bubble-chart-fill:before{content:""}.ri-bubble-chart-line:before{content:""}.ri-bug-2-fill:before{content:""}.ri-bug-2-line:before{content:""}.ri-bug-fill:before{content:""}.ri-bug-line:before{content:""}.ri-building-2-fill:before{content:""}.ri-building-2-line:before{content:""}.ri-building-3-fill:before{content:""}.ri-building-3-line:before{content:""}.ri-building-4-fill:before{content:""}.ri-building-4-line:before{content:""}.ri-building-fill:before{content:""}.ri-building-line:before{content:""}.ri-bus-2-fill:before{content:""}.ri-bus-2-line:before{content:""}.ri-bus-fill:before{content:""}.ri-bus-line:before{content:""}.ri-bus-wifi-fill:before{content:""}.ri-bus-wifi-line:before{content:""}.ri-cactus-fill:before{content:""}.ri-cactus-line:before{content:""}.ri-cake-2-fill:before{content:""}.ri-cake-2-line:before{content:""}.ri-cake-3-fill:before{content:""}.ri-cake-3-line:before{content:""}.ri-cake-fill:before{content:""}.ri-cake-line:before{content:""}.ri-calculator-fill:before{content:""}.ri-calculator-line:before{content:""}.ri-calendar-2-fill:before{content:""}.ri-calendar-2-line:before{content:""}.ri-calendar-check-fill:before{content:""}.ri-calendar-check-line:before{content:""}.ri-calendar-event-fill:before{content:""}.ri-calendar-event-line:before{content:""}.ri-calendar-fill:before{content:""}.ri-calendar-line:before{content:""}.ri-calendar-todo-fill:before{content:""}.ri-calendar-todo-line:before{content:""}.ri-camera-2-fill:before{content:""}.ri-camera-2-line:before{content:""}.ri-camera-3-fill:before{content:""}.ri-camera-3-line:before{content:""}.ri-camera-fill:before{content:""}.ri-camera-lens-fill:before{content:""}.ri-camera-lens-line:before{content:""}.ri-camera-line:before{content:""}.ri-camera-off-fill:before{content:""}.ri-camera-off-line:before{content:""}.ri-camera-switch-fill:before{content:""}.ri-camera-switch-line:before{content:""}.ri-capsule-fill:before{content:""}.ri-capsule-line:before{content:""}.ri-car-fill:before{content:""}.ri-car-line:before{content:""}.ri-car-washing-fill:before{content:""}.ri-car-washing-line:before{content:""}.ri-caravan-fill:before{content:""}.ri-caravan-line:before{content:""}.ri-cast-fill:before{content:""}.ri-cast-line:before{content:""}.ri-cellphone-fill:before{content:""}.ri-cellphone-line:before{content:""}.ri-celsius-fill:before{content:""}.ri-celsius-line:before{content:""}.ri-centos-fill:before{content:""}.ri-centos-line:before{content:""}.ri-character-recognition-fill:before{content:""}.ri-character-recognition-line:before{content:""}.ri-charging-pile-2-fill:before{content:""}.ri-charging-pile-2-line:before{content:""}.ri-charging-pile-fill:before{content:""}.ri-charging-pile-line:before{content:""}.ri-chat-1-fill:before{content:""}.ri-chat-1-line:before{content:""}.ri-chat-2-fill:before{content:""}.ri-chat-2-line:before{content:""}.ri-chat-3-fill:before{content:""}.ri-chat-3-line:before{content:""}.ri-chat-4-fill:before{content:""}.ri-chat-4-line:before{content:""}.ri-chat-check-fill:before{content:""}.ri-chat-check-line:before{content:""}.ri-chat-delete-fill:before{content:""}.ri-chat-delete-line:before{content:""}.ri-chat-download-fill:before{content:""}.ri-chat-download-line:before{content:""}.ri-chat-follow-up-fill:before{content:""}.ri-chat-follow-up-line:before{content:""}.ri-chat-forward-fill:before{content:""}.ri-chat-forward-line:before{content:""}.ri-chat-heart-fill:before{content:""}.ri-chat-heart-line:before{content:""}.ri-chat-history-fill:before{content:""}.ri-chat-history-line:before{content:""}.ri-chat-new-fill:before{content:""}.ri-chat-new-line:before{content:""}.ri-chat-off-fill:before{content:""}.ri-chat-off-line:before{content:""}.ri-chat-poll-fill:before{content:""}.ri-chat-poll-line:before{content:""}.ri-chat-private-fill:before{content:""}.ri-chat-private-line:before{content:""}.ri-chat-quote-fill:before{content:""}.ri-chat-quote-line:before{content:""}.ri-chat-settings-fill:before{content:""}.ri-chat-settings-line:before{content:""}.ri-chat-smile-2-fill:before{content:""}.ri-chat-smile-2-line:before{content:""}.ri-chat-smile-3-fill:before{content:""}.ri-chat-smile-3-line:before{content:""}.ri-chat-smile-fill:before{content:""}.ri-chat-smile-line:before{content:""}.ri-chat-upload-fill:before{content:""}.ri-chat-upload-line:before{content:""}.ri-chat-voice-fill:before{content:""}.ri-chat-voice-line:before{content:""}.ri-check-double-fill:before{content:""}.ri-check-double-line:before{content:""}.ri-check-fill:before{content:""}.ri-check-line:before{content:""}.ri-checkbox-blank-circle-fill:before{content:""}.ri-checkbox-blank-circle-line:before{content:""}.ri-checkbox-blank-fill:before{content:""}.ri-checkbox-blank-line:before{content:""}.ri-checkbox-circle-fill:before{content:""}.ri-checkbox-circle-line:before{content:""}.ri-checkbox-fill:before{content:""}.ri-checkbox-indeterminate-fill:before{content:""}.ri-checkbox-indeterminate-line:before{content:""}.ri-checkbox-line:before{content:""}.ri-checkbox-multiple-blank-fill:before{content:""}.ri-checkbox-multiple-blank-line:before{content:""}.ri-checkbox-multiple-fill:before{content:""}.ri-checkbox-multiple-line:before{content:""}.ri-china-railway-fill:before{content:""}.ri-china-railway-line:before{content:""}.ri-chrome-fill:before{content:""}.ri-chrome-line:before{content:""}.ri-clapperboard-fill:before{content:""}.ri-clapperboard-line:before{content:""}.ri-clipboard-fill:before{content:""}.ri-clipboard-line:before{content:""}.ri-clockwise-2-fill:before{content:""}.ri-clockwise-2-line:before{content:""}.ri-clockwise-fill:before{content:""}.ri-clockwise-line:before{content:""}.ri-close-circle-fill:before{content:""}.ri-close-circle-line:before{content:""}.ri-close-fill:before{content:""}.ri-close-line:before{content:""}.ri-closed-captioning-fill:before{content:""}.ri-closed-captioning-line:before{content:""}.ri-cloud-fill:before{content:""}.ri-cloud-line:before{content:""}.ri-cloud-off-fill:before{content:""}.ri-cloud-off-line:before{content:""}.ri-cloud-windy-fill:before{content:""}.ri-cloud-windy-line:before{content:""}.ri-cloudy-2-fill:before{content:""}.ri-cloudy-2-line:before{content:""}.ri-cloudy-fill:before{content:""}.ri-cloudy-line:before{content:""}.ri-code-box-fill:before{content:""}.ri-code-box-line:before{content:""}.ri-code-fill:before{content:""}.ri-code-line:before{content:""}.ri-code-s-fill:before{content:""}.ri-code-s-line:before{content:""}.ri-code-s-slash-fill:before{content:""}.ri-code-s-slash-line:before{content:""}.ri-code-view:before{content:""}.ri-codepen-fill:before{content:""}.ri-codepen-line:before{content:""}.ri-coin-fill:before{content:""}.ri-coin-line:before{content:""}.ri-coins-fill:before{content:""}.ri-coins-line:before{content:""}.ri-collage-fill:before{content:""}.ri-collage-line:before{content:""}.ri-command-fill:before{content:""}.ri-command-line:before{content:""}.ri-community-fill:before{content:""}.ri-community-line:before{content:""}.ri-compass-2-fill:before{content:""}.ri-compass-2-line:before{content:""}.ri-compass-3-fill:before{content:""}.ri-compass-3-line:before{content:""}.ri-compass-4-fill:before{content:""}.ri-compass-4-line:before{content:""}.ri-compass-discover-fill:before{content:""}.ri-compass-discover-line:before{content:""}.ri-compass-fill:before{content:""}.ri-compass-line:before{content:""}.ri-compasses-2-fill:before{content:""}.ri-compasses-2-line:before{content:""}.ri-compasses-fill:before{content:""}.ri-compasses-line:before{content:""}.ri-computer-fill:before{content:""}.ri-computer-line:before{content:""}.ri-contacts-book-2-fill:before{content:""}.ri-contacts-book-2-line:before{content:""}.ri-contacts-book-fill:before{content:""}.ri-contacts-book-line:before{content:""}.ri-contacts-book-upload-fill:before{content:""}.ri-contacts-book-upload-line:before{content:""}.ri-contacts-fill:before{content:""}.ri-contacts-line:before{content:""}.ri-contrast-2-fill:before{content:""}.ri-contrast-2-line:before{content:""}.ri-contrast-drop-2-fill:before{content:""}.ri-contrast-drop-2-line:before{content:""}.ri-contrast-drop-fill:before{content:""}.ri-contrast-drop-line:before{content:""}.ri-contrast-fill:before{content:""}.ri-contrast-line:before{content:""}.ri-copper-coin-fill:before{content:""}.ri-copper-coin-line:before{content:""}.ri-copper-diamond-fill:before{content:""}.ri-copper-diamond-line:before{content:""}.ri-copyleft-fill:before{content:""}.ri-copyleft-line:before{content:""}.ri-copyright-fill:before{content:""}.ri-copyright-line:before{content:""}.ri-coreos-fill:before{content:""}.ri-coreos-line:before{content:""}.ri-coupon-2-fill:before{content:""}.ri-coupon-2-line:before{content:""}.ri-coupon-3-fill:before{content:""}.ri-coupon-3-line:before{content:""}.ri-coupon-4-fill:before{content:""}.ri-coupon-4-line:before{content:""}.ri-coupon-5-fill:before{content:""}.ri-coupon-5-line:before{content:""}.ri-coupon-fill:before{content:""}.ri-coupon-line:before{content:""}.ri-cpu-fill:before{content:""}.ri-cpu-line:before{content:""}.ri-creative-commons-by-fill:before{content:""}.ri-creative-commons-by-line:before{content:""}.ri-creative-commons-fill:before{content:""}.ri-creative-commons-line:before{content:""}.ri-creative-commons-nc-fill:before{content:""}.ri-creative-commons-nc-line:before{content:""}.ri-creative-commons-nd-fill:before{content:""}.ri-creative-commons-nd-line:before{content:""}.ri-creative-commons-sa-fill:before{content:""}.ri-creative-commons-sa-line:before{content:""}.ri-creative-commons-zero-fill:before{content:""}.ri-creative-commons-zero-line:before{content:""}.ri-criminal-fill:before{content:""}.ri-criminal-line:before{content:""}.ri-crop-2-fill:before{content:""}.ri-crop-2-line:before{content:""}.ri-crop-fill:before{content:""}.ri-crop-line:before{content:""}.ri-css3-fill:before{content:""}.ri-css3-line:before{content:""}.ri-cup-fill:before{content:""}.ri-cup-line:before{content:""}.ri-currency-fill:before{content:""}.ri-currency-line:before{content:""}.ri-cursor-fill:before{content:""}.ri-cursor-line:before{content:""}.ri-customer-service-2-fill:before{content:""}.ri-customer-service-2-line:before{content:""}.ri-customer-service-fill:before{content:""}.ri-customer-service-line:before{content:""}.ri-dashboard-2-fill:before{content:""}.ri-dashboard-2-line:before{content:""}.ri-dashboard-3-fill:before{content:""}.ri-dashboard-3-line:before{content:""}.ri-dashboard-fill:before{content:""}.ri-dashboard-line:before{content:""}.ri-database-2-fill:before{content:""}.ri-database-2-line:before{content:""}.ri-database-fill:before{content:""}.ri-database-line:before{content:""}.ri-delete-back-2-fill:before{content:""}.ri-delete-back-2-line:before{content:""}.ri-delete-back-fill:before{content:""}.ri-delete-back-line:before{content:""}.ri-delete-bin-2-fill:before{content:""}.ri-delete-bin-2-line:before{content:""}.ri-delete-bin-3-fill:before{content:""}.ri-delete-bin-3-line:before{content:""}.ri-delete-bin-4-fill:before{content:""}.ri-delete-bin-4-line:before{content:""}.ri-delete-bin-5-fill:before{content:""}.ri-delete-bin-5-line:before{content:""}.ri-delete-bin-6-fill:before{content:""}.ri-delete-bin-6-line:before{content:""}.ri-delete-bin-7-fill:before{content:""}.ri-delete-bin-7-line:before{content:""}.ri-delete-bin-fill:before{content:""}.ri-delete-bin-line:before{content:""}.ri-delete-column:before{content:""}.ri-delete-row:before{content:""}.ri-device-fill:before{content:""}.ri-device-line:before{content:""}.ri-device-recover-fill:before{content:""}.ri-device-recover-line:before{content:""}.ri-dingding-fill:before{content:""}.ri-dingding-line:before{content:""}.ri-direction-fill:before{content:""}.ri-direction-line:before{content:""}.ri-disc-fill:before{content:""}.ri-disc-line:before{content:""}.ri-discord-fill:before{content:""}.ri-discord-line:before{content:""}.ri-discuss-fill:before{content:""}.ri-discuss-line:before{content:""}.ri-dislike-fill:before{content:""}.ri-dislike-line:before{content:""}.ri-disqus-fill:before{content:""}.ri-disqus-line:before{content:""}.ri-divide-fill:before{content:""}.ri-divide-line:before{content:""}.ri-donut-chart-fill:before{content:""}.ri-donut-chart-line:before{content:""}.ri-door-closed-fill:before{content:""}.ri-door-closed-line:before{content:""}.ri-door-fill:before{content:""}.ri-door-line:before{content:""}.ri-door-lock-box-fill:before{content:""}.ri-door-lock-box-line:before{content:""}.ri-door-lock-fill:before{content:""}.ri-door-lock-line:before{content:""}.ri-door-open-fill:before{content:""}.ri-door-open-line:before{content:""}.ri-dossier-fill:before{content:""}.ri-dossier-line:before{content:""}.ri-douban-fill:before{content:""}.ri-douban-line:before{content:""}.ri-double-quotes-l:before{content:""}.ri-double-quotes-r:before{content:""}.ri-download-2-fill:before{content:""}.ri-download-2-line:before{content:""}.ri-download-cloud-2-fill:before{content:""}.ri-download-cloud-2-line:before{content:""}.ri-download-cloud-fill:before{content:""}.ri-download-cloud-line:before{content:""}.ri-download-fill:before{content:""}.ri-download-line:before{content:""}.ri-draft-fill:before{content:""}.ri-draft-line:before{content:""}.ri-drag-drop-fill:before{content:""}.ri-drag-drop-line:before{content:""}.ri-drag-move-2-fill:before{content:""}.ri-drag-move-2-line:before{content:""}.ri-drag-move-fill:before{content:""}.ri-drag-move-line:before{content:""}.ri-dribbble-fill:before{content:""}.ri-dribbble-line:before{content:""}.ri-drive-fill:before{content:""}.ri-drive-line:before{content:""}.ri-drizzle-fill:before{content:""}.ri-drizzle-line:before{content:""}.ri-drop-fill:before{content:""}.ri-drop-line:before{content:""}.ri-dropbox-fill:before{content:""}.ri-dropbox-line:before{content:""}.ri-dual-sim-1-fill:before{content:""}.ri-dual-sim-1-line:before{content:""}.ri-dual-sim-2-fill:before{content:""}.ri-dual-sim-2-line:before{content:""}.ri-dv-fill:before{content:""}.ri-dv-line:before{content:""}.ri-dvd-fill:before{content:""}.ri-dvd-line:before{content:""}.ri-e-bike-2-fill:before{content:""}.ri-e-bike-2-line:before{content:""}.ri-e-bike-fill:before{content:""}.ri-e-bike-line:before{content:""}.ri-earth-fill:before{content:""}.ri-earth-line:before{content:""}.ri-earthquake-fill:before{content:""}.ri-earthquake-line:before{content:""}.ri-edge-fill:before{content:""}.ri-edge-line:before{content:""}.ri-edit-2-fill:before{content:""}.ri-edit-2-line:before{content:""}.ri-edit-box-fill:before{content:""}.ri-edit-box-line:before{content:""}.ri-edit-circle-fill:before{content:""}.ri-edit-circle-line:before{content:""}.ri-edit-fill:before{content:""}.ri-edit-line:before{content:""}.ri-eject-fill:before{content:""}.ri-eject-line:before{content:""}.ri-emotion-2-fill:before{content:""}.ri-emotion-2-line:before{content:""}.ri-emotion-fill:before{content:""}.ri-emotion-happy-fill:before{content:""}.ri-emotion-happy-line:before{content:""}.ri-emotion-laugh-fill:before{content:""}.ri-emotion-laugh-line:before{content:""}.ri-emotion-line:before{content:""}.ri-emotion-normal-fill:before{content:""}.ri-emotion-normal-line:before{content:""}.ri-emotion-sad-fill:before{content:""}.ri-emotion-sad-line:before{content:""}.ri-emotion-unhappy-fill:before{content:""}.ri-emotion-unhappy-line:before{content:""}.ri-empathize-fill:before{content:""}.ri-empathize-line:before{content:""}.ri-emphasis-cn:before{content:""}.ri-emphasis:before{content:""}.ri-english-input:before{content:""}.ri-equalizer-fill:before{content:""}.ri-equalizer-line:before{content:""}.ri-eraser-fill:before{content:""}.ri-eraser-line:before{content:""}.ri-error-warning-fill:before{content:""}.ri-error-warning-line:before{content:""}.ri-evernote-fill:before{content:""}.ri-evernote-line:before{content:""}.ri-exchange-box-fill:before{content:""}.ri-exchange-box-line:before{content:""}.ri-exchange-cny-fill:before{content:""}.ri-exchange-cny-line:before{content:""}.ri-exchange-dollar-fill:before{content:""}.ri-exchange-dollar-line:before{content:""}.ri-exchange-fill:before{content:""}.ri-exchange-funds-fill:before{content:""}.ri-exchange-funds-line:before{content:""}.ri-exchange-line:before{content:""}.ri-external-link-fill:before{content:""}.ri-external-link-line:before{content:""}.ri-eye-2-fill:before{content:""}.ri-eye-2-line:before{content:""}.ri-eye-close-fill:before{content:""}.ri-eye-close-line:before{content:""}.ri-eye-fill:before{content:""}.ri-eye-line:before{content:""}.ri-eye-off-fill:before{content:""}.ri-eye-off-line:before{content:""}.ri-facebook-box-fill:before{content:""}.ri-facebook-box-line:before{content:""}.ri-facebook-circle-fill:before{content:""}.ri-facebook-circle-line:before{content:""}.ri-facebook-fill:before{content:""}.ri-facebook-line:before{content:""}.ri-fahrenheit-fill:before{content:""}.ri-fahrenheit-line:before{content:""}.ri-feedback-fill:before{content:""}.ri-feedback-line:before{content:""}.ri-file-2-fill:before{content:""}.ri-file-2-line:before{content:""}.ri-file-3-fill:before{content:""}.ri-file-3-line:before{content:""}.ri-file-4-fill:before{content:""}.ri-file-4-line:before{content:""}.ri-file-add-fill:before{content:""}.ri-file-add-line:before{content:""}.ri-file-chart-2-fill:before{content:""}.ri-file-chart-2-line:before{content:""}.ri-file-chart-fill:before{content:""}.ri-file-chart-line:before{content:""}.ri-file-cloud-fill:before{content:""}.ri-file-cloud-line:before{content:""}.ri-file-code-fill:before{content:""}.ri-file-code-line:before{content:""}.ri-file-copy-2-fill:before{content:""}.ri-file-copy-2-line:before{content:""}.ri-file-copy-fill:before{content:""}.ri-file-copy-line:before{content:""}.ri-file-damage-fill:before{content:""}.ri-file-damage-line:before{content:""}.ri-file-download-fill:before{content:""}.ri-file-download-line:before{content:""}.ri-file-edit-fill:before{content:""}.ri-file-edit-line:before{content:""}.ri-file-excel-2-fill:before{content:""}.ri-file-excel-2-line:before{content:""}.ri-file-excel-fill:before{content:""}.ri-file-excel-line:before{content:""}.ri-file-fill:before{content:""}.ri-file-forbid-fill:before{content:""}.ri-file-forbid-line:before{content:""}.ri-file-gif-fill:before{content:""}.ri-file-gif-line:before{content:""}.ri-file-history-fill:before{content:""}.ri-file-history-line:before{content:""}.ri-file-hwp-fill:before{content:""}.ri-file-hwp-line:before{content:""}.ri-file-info-fill:before{content:""}.ri-file-info-line:before{content:""}.ri-file-line:before{content:""}.ri-file-list-2-fill:before{content:""}.ri-file-list-2-line:before{content:""}.ri-file-list-3-fill:before{content:""}.ri-file-list-3-line:before{content:""}.ri-file-list-fill:before{content:""}.ri-file-list-line:before{content:""}.ri-file-lock-fill:before{content:""}.ri-file-lock-line:before{content:""}.ri-file-mark-fill:before{content:""}.ri-file-mark-line:before{content:""}.ri-file-music-fill:before{content:""}.ri-file-music-line:before{content:""}.ri-file-paper-2-fill:before{content:""}.ri-file-paper-2-line:before{content:""}.ri-file-paper-fill:before{content:""}.ri-file-paper-line:before{content:""}.ri-file-pdf-fill:before{content:""}.ri-file-pdf-line:before{content:""}.ri-file-ppt-2-fill:before{content:""}.ri-file-ppt-2-line:before{content:""}.ri-file-ppt-fill:before{content:""}.ri-file-ppt-line:before{content:""}.ri-file-reduce-fill:before{content:""}.ri-file-reduce-line:before{content:""}.ri-file-search-fill:before{content:""}.ri-file-search-line:before{content:""}.ri-file-settings-fill:before{content:""}.ri-file-settings-line:before{content:""}.ri-file-shield-2-fill:before{content:""}.ri-file-shield-2-line:before{content:""}.ri-file-shield-fill:before{content:""}.ri-file-shield-line:before{content:""}.ri-file-shred-fill:before{content:""}.ri-file-shred-line:before{content:""}.ri-file-text-fill:before{content:""}.ri-file-text-line:before{content:""}.ri-file-transfer-fill:before{content:""}.ri-file-transfer-line:before{content:""}.ri-file-unknow-fill:before{content:""}.ri-file-unknow-line:before{content:""}.ri-file-upload-fill:before{content:""}.ri-file-upload-line:before{content:""}.ri-file-user-fill:before{content:""}.ri-file-user-line:before{content:""}.ri-file-warning-fill:before{content:""}.ri-file-warning-line:before{content:""}.ri-file-word-2-fill:before{content:""}.ri-file-word-2-line:before{content:""}.ri-file-word-fill:before{content:""}.ri-file-word-line:before{content:""}.ri-file-zip-fill:before{content:""}.ri-file-zip-line:before{content:""}.ri-film-fill:before{content:""}.ri-film-line:before{content:""}.ri-filter-2-fill:before{content:""}.ri-filter-2-line:before{content:""}.ri-filter-3-fill:before{content:""}.ri-filter-3-line:before{content:""}.ri-filter-fill:before{content:""}.ri-filter-line:before{content:""}.ri-filter-off-fill:before{content:""}.ri-filter-off-line:before{content:""}.ri-find-replace-fill:before{content:""}.ri-find-replace-line:before{content:""}.ri-finder-fill:before{content:""}.ri-finder-line:before{content:""}.ri-fingerprint-2-fill:before{content:""}.ri-fingerprint-2-line:before{content:""}.ri-fingerprint-fill:before{content:""}.ri-fingerprint-line:before{content:""}.ri-fire-fill:before{content:""}.ri-fire-line:before{content:""}.ri-firefox-fill:before{content:""}.ri-firefox-line:before{content:""}.ri-first-aid-kit-fill:before{content:""}.ri-first-aid-kit-line:before{content:""}.ri-flag-2-fill:before{content:""}.ri-flag-2-line:before{content:""}.ri-flag-fill:before{content:""}.ri-flag-line:before{content:""}.ri-flashlight-fill:before{content:""}.ri-flashlight-line:before{content:""}.ri-flask-fill:before{content:""}.ri-flask-line:before{content:""}.ri-flight-land-fill:before{content:""}.ri-flight-land-line:before{content:""}.ri-flight-takeoff-fill:before{content:""}.ri-flight-takeoff-line:before{content:""}.ri-flood-fill:before{content:""}.ri-flood-line:before{content:""}.ri-flow-chart:before{content:""}.ri-flutter-fill:before{content:""}.ri-flutter-line:before{content:""}.ri-focus-2-fill:before{content:""}.ri-focus-2-line:before{content:""}.ri-focus-3-fill:before{content:""}.ri-focus-3-line:before{content:""}.ri-focus-fill:before{content:""}.ri-focus-line:before{content:""}.ri-foggy-fill:before{content:""}.ri-foggy-line:before{content:""}.ri-folder-2-fill:before{content:""}.ri-folder-2-line:before{content:""}.ri-folder-3-fill:before{content:""}.ri-folder-3-line:before{content:""}.ri-folder-4-fill:before{content:""}.ri-folder-4-line:before{content:""}.ri-folder-5-fill:before{content:""}.ri-folder-5-line:before{content:""}.ri-folder-add-fill:before{content:""}.ri-folder-add-line:before{content:""}.ri-folder-chart-2-fill:before{content:""}.ri-folder-chart-2-line:before{content:""}.ri-folder-chart-fill:before{content:""}.ri-folder-chart-line:before{content:""}.ri-folder-download-fill:before{content:""}.ri-folder-download-line:before{content:""}.ri-folder-fill:before{content:""}.ri-folder-forbid-fill:before{content:""}.ri-folder-forbid-line:before{content:""}.ri-folder-history-fill:before{content:""}.ri-folder-history-line:before{content:""}.ri-folder-info-fill:before{content:""}.ri-folder-info-line:before{content:""}.ri-folder-keyhole-fill:before{content:""}.ri-folder-keyhole-line:before{content:""}.ri-folder-line:before{content:""}.ri-folder-lock-fill:before{content:""}.ri-folder-lock-line:before{content:""}.ri-folder-music-fill:before{content:""}.ri-folder-music-line:before{content:""}.ri-folder-open-fill:before{content:""}.ri-folder-open-line:before{content:""}.ri-folder-received-fill:before{content:""}.ri-folder-received-line:before{content:""}.ri-folder-reduce-fill:before{content:""}.ri-folder-reduce-line:before{content:""}.ri-folder-settings-fill:before{content:""}.ri-folder-settings-line:before{content:""}.ri-folder-shared-fill:before{content:""}.ri-folder-shared-line:before{content:""}.ri-folder-shield-2-fill:before{content:""}.ri-folder-shield-2-line:before{content:""}.ri-folder-shield-fill:before{content:""}.ri-folder-shield-line:before{content:""}.ri-folder-transfer-fill:before{content:""}.ri-folder-transfer-line:before{content:""}.ri-folder-unknow-fill:before{content:""}.ri-folder-unknow-line:before{content:""}.ri-folder-upload-fill:before{content:""}.ri-folder-upload-line:before{content:""}.ri-folder-user-fill:before{content:""}.ri-folder-user-line:before{content:""}.ri-folder-warning-fill:before{content:""}.ri-folder-warning-line:before{content:""}.ri-folder-zip-fill:before{content:""}.ri-folder-zip-line:before{content:""}.ri-folders-fill:before{content:""}.ri-folders-line:before{content:""}.ri-font-color:before{content:""}.ri-font-size-2:before{content:""}.ri-font-size:before{content:""}.ri-football-fill:before{content:""}.ri-football-line:before{content:""}.ri-footprint-fill:before{content:""}.ri-footprint-line:before{content:""}.ri-forbid-2-fill:before{content:""}.ri-forbid-2-line:before{content:""}.ri-forbid-fill:before{content:""}.ri-forbid-line:before{content:""}.ri-format-clear:before{content:""}.ri-fridge-fill:before{content:""}.ri-fridge-line:before{content:""}.ri-fullscreen-exit-fill:before{content:""}.ri-fullscreen-exit-line:before{content:""}.ri-fullscreen-fill:before{content:""}.ri-fullscreen-line:before{content:""}.ri-function-fill:before{content:""}.ri-function-line:before{content:""}.ri-functions:before{content:""}.ri-funds-box-fill:before{content:""}.ri-funds-box-line:before{content:""}.ri-funds-fill:before{content:""}.ri-funds-line:before{content:""}.ri-gallery-fill:before{content:""}.ri-gallery-line:before{content:""}.ri-gallery-upload-fill:before{content:""}.ri-gallery-upload-line:before{content:""}.ri-game-fill:before{content:""}.ri-game-line:before{content:""}.ri-gamepad-fill:before{content:""}.ri-gamepad-line:before{content:""}.ri-gas-station-fill:before{content:""}.ri-gas-station-line:before{content:""}.ri-gatsby-fill:before{content:""}.ri-gatsby-line:before{content:""}.ri-genderless-fill:before{content:""}.ri-genderless-line:before{content:""}.ri-ghost-2-fill:before{content:""}.ri-ghost-2-line:before{content:""}.ri-ghost-fill:before{content:""}.ri-ghost-line:before{content:""}.ri-ghost-smile-fill:before{content:""}.ri-ghost-smile-line:before{content:""}.ri-gift-2-fill:before{content:""}.ri-gift-2-line:before{content:""}.ri-gift-fill:before{content:""}.ri-gift-line:before{content:""}.ri-git-branch-fill:before{content:""}.ri-git-branch-line:before{content:""}.ri-git-commit-fill:before{content:""}.ri-git-commit-line:before{content:""}.ri-git-merge-fill:before{content:""}.ri-git-merge-line:before{content:""}.ri-git-pull-request-fill:before{content:""}.ri-git-pull-request-line:before{content:""}.ri-git-repository-commits-fill:before{content:""}.ri-git-repository-commits-line:before{content:""}.ri-git-repository-fill:before{content:""}.ri-git-repository-line:before{content:""}.ri-git-repository-private-fill:before{content:""}.ri-git-repository-private-line:before{content:""}.ri-github-fill:before{content:""}.ri-github-line:before{content:""}.ri-gitlab-fill:before{content:""}.ri-gitlab-line:before{content:""}.ri-global-fill:before{content:""}.ri-global-line:before{content:""}.ri-globe-fill:before{content:""}.ri-globe-line:before{content:""}.ri-goblet-fill:before{content:""}.ri-goblet-line:before{content:""}.ri-google-fill:before{content:""}.ri-google-line:before{content:""}.ri-google-play-fill:before{content:""}.ri-google-play-line:before{content:""}.ri-government-fill:before{content:""}.ri-government-line:before{content:""}.ri-gps-fill:before{content:""}.ri-gps-line:before{content:""}.ri-gradienter-fill:before{content:""}.ri-gradienter-line:before{content:""}.ri-grid-fill:before{content:""}.ri-grid-line:before{content:""}.ri-group-2-fill:before{content:""}.ri-group-2-line:before{content:""}.ri-group-fill:before{content:""}.ri-group-line:before{content:""}.ri-guide-fill:before{content:""}.ri-guide-line:before{content:""}.ri-h-1:before{content:""}.ri-h-2:before{content:""}.ri-h-3:before{content:""}.ri-h-4:before{content:""}.ri-h-5:before{content:""}.ri-h-6:before{content:""}.ri-hail-fill:before{content:""}.ri-hail-line:before{content:""}.ri-hammer-fill:before{content:""}.ri-hammer-line:before{content:""}.ri-hand-coin-fill:before{content:""}.ri-hand-coin-line:before{content:""}.ri-hand-heart-fill:before{content:""}.ri-hand-heart-line:before{content:""}.ri-hand-sanitizer-fill:before{content:""}.ri-hand-sanitizer-line:before{content:""}.ri-handbag-fill:before{content:""}.ri-handbag-line:before{content:""}.ri-hard-drive-2-fill:before{content:""}.ri-hard-drive-2-line:before{content:""}.ri-hard-drive-fill:before{content:""}.ri-hard-drive-line:before{content:""}.ri-hashtag:before{content:""}.ri-haze-2-fill:before{content:""}.ri-haze-2-line:before{content:""}.ri-haze-fill:before{content:""}.ri-haze-line:before{content:""}.ri-hd-fill:before{content:""}.ri-hd-line:before{content:""}.ri-heading:before{content:""}.ri-headphone-fill:before{content:""}.ri-headphone-line:before{content:""}.ri-health-book-fill:before{content:""}.ri-health-book-line:before{content:""}.ri-heart-2-fill:before{content:""}.ri-heart-2-line:before{content:""}.ri-heart-3-fill:before{content:""}.ri-heart-3-line:before{content:""}.ri-heart-add-fill:before{content:""}.ri-heart-add-line:before{content:""}.ri-heart-fill:before{content:""}.ri-heart-line:before{content:""}.ri-heart-pulse-fill:before{content:""}.ri-heart-pulse-line:before{content:""}.ri-hearts-fill:before{content:""}.ri-hearts-line:before{content:""}.ri-heavy-showers-fill:before{content:""}.ri-heavy-showers-line:before{content:""}.ri-history-fill:before{content:""}.ri-history-line:before{content:""}.ri-home-2-fill:before{content:""}.ri-home-2-line:before{content:""}.ri-home-3-fill:before{content:""}.ri-home-3-line:before{content:""}.ri-home-4-fill:before{content:""}.ri-home-4-line:before{content:""}.ri-home-5-fill:before{content:""}.ri-home-5-line:before{content:""}.ri-home-6-fill:before{content:""}.ri-home-6-line:before{content:""}.ri-home-7-fill:before{content:""}.ri-home-7-line:before{content:""}.ri-home-8-fill:before{content:""}.ri-home-8-line:before{content:""}.ri-home-fill:before{content:""}.ri-home-gear-fill:before{content:""}.ri-home-gear-line:before{content:""}.ri-home-heart-fill:before{content:""}.ri-home-heart-line:before{content:""}.ri-home-line:before{content:""}.ri-home-smile-2-fill:before{content:""}.ri-home-smile-2-line:before{content:""}.ri-home-smile-fill:before{content:""}.ri-home-smile-line:before{content:""}.ri-home-wifi-fill:before{content:""}.ri-home-wifi-line:before{content:""}.ri-honor-of-kings-fill:before{content:""}.ri-honor-of-kings-line:before{content:""}.ri-honour-fill:before{content:""}.ri-honour-line:before{content:""}.ri-hospital-fill:before{content:""}.ri-hospital-line:before{content:""}.ri-hotel-bed-fill:before{content:""}.ri-hotel-bed-line:before{content:""}.ri-hotel-fill:before{content:""}.ri-hotel-line:before{content:""}.ri-hotspot-fill:before{content:""}.ri-hotspot-line:before{content:""}.ri-hq-fill:before{content:""}.ri-hq-line:before{content:""}.ri-html5-fill:before{content:""}.ri-html5-line:before{content:""}.ri-ie-fill:before{content:""}.ri-ie-line:before{content:""}.ri-image-2-fill:before{content:""}.ri-image-2-line:before{content:""}.ri-image-add-fill:before{content:""}.ri-image-add-line:before{content:""}.ri-image-edit-fill:before{content:""}.ri-image-edit-line:before{content:""}.ri-image-fill:before{content:""}.ri-image-line:before{content:""}.ri-inbox-archive-fill:before{content:""}.ri-inbox-archive-line:before{content:""}.ri-inbox-fill:before{content:""}.ri-inbox-line:before{content:""}.ri-inbox-unarchive-fill:before{content:""}.ri-inbox-unarchive-line:before{content:""}.ri-increase-decrease-fill:before{content:""}.ri-increase-decrease-line:before{content:""}.ri-indent-decrease:before{content:""}.ri-indent-increase:before{content:""}.ri-indeterminate-circle-fill:before{content:""}.ri-indeterminate-circle-line:before{content:""}.ri-information-fill:before{content:""}.ri-information-line:before{content:""}.ri-infrared-thermometer-fill:before{content:""}.ri-infrared-thermometer-line:before{content:""}.ri-ink-bottle-fill:before{content:""}.ri-ink-bottle-line:before{content:""}.ri-input-cursor-move:before{content:""}.ri-input-method-fill:before{content:""}.ri-input-method-line:before{content:""}.ri-insert-column-left:before{content:""}.ri-insert-column-right:before{content:""}.ri-insert-row-bottom:before{content:""}.ri-insert-row-top:before{content:""}.ri-instagram-fill:before{content:""}.ri-instagram-line:before{content:""}.ri-install-fill:before{content:""}.ri-install-line:before{content:""}.ri-invision-fill:before{content:""}.ri-invision-line:before{content:""}.ri-italic:before{content:""}.ri-kakao-talk-fill:before{content:""}.ri-kakao-talk-line:before{content:""}.ri-key-2-fill:before{content:""}.ri-key-2-line:before{content:""}.ri-key-fill:before{content:""}.ri-key-line:before{content:""}.ri-keyboard-box-fill:before{content:""}.ri-keyboard-box-line:before{content:""}.ri-keyboard-fill:before{content:""}.ri-keyboard-line:before{content:""}.ri-keynote-fill:before{content:""}.ri-keynote-line:before{content:""}.ri-knife-blood-fill:before{content:""}.ri-knife-blood-line:before{content:""}.ri-knife-fill:before{content:""}.ri-knife-line:before{content:""}.ri-landscape-fill:before{content:""}.ri-landscape-line:before{content:""}.ri-layout-2-fill:before{content:""}.ri-layout-2-line:before{content:""}.ri-layout-3-fill:before{content:""}.ri-layout-3-line:before{content:""}.ri-layout-4-fill:before{content:""}.ri-layout-4-line:before{content:""}.ri-layout-5-fill:before{content:""}.ri-layout-5-line:before{content:""}.ri-layout-6-fill:before{content:""}.ri-layout-6-line:before{content:""}.ri-layout-bottom-2-fill:before{content:""}.ri-layout-bottom-2-line:before{content:""}.ri-layout-bottom-fill:before{content:""}.ri-layout-bottom-line:before{content:""}.ri-layout-column-fill:before{content:""}.ri-layout-column-line:before{content:""}.ri-layout-fill:before{content:""}.ri-layout-grid-fill:before{content:""}.ri-layout-grid-line:before{content:""}.ri-layout-left-2-fill:before{content:""}.ri-layout-left-2-line:before{content:""}.ri-layout-left-fill:before{content:""}.ri-layout-left-line:before{content:""}.ri-layout-line:before{content:""}.ri-layout-masonry-fill:before{content:""}.ri-layout-masonry-line:before{content:""}.ri-layout-right-2-fill:before{content:""}.ri-layout-right-2-line:before{content:""}.ri-layout-right-fill:before{content:""}.ri-layout-right-line:before{content:""}.ri-layout-row-fill:before{content:""}.ri-layout-row-line:before{content:""}.ri-layout-top-2-fill:before{content:""}.ri-layout-top-2-line:before{content:""}.ri-layout-top-fill:before{content:""}.ri-layout-top-line:before{content:""}.ri-leaf-fill:before{content:""}.ri-leaf-line:before{content:""}.ri-lifebuoy-fill:before{content:""}.ri-lifebuoy-line:before{content:""}.ri-lightbulb-fill:before{content:""}.ri-lightbulb-flash-fill:before{content:""}.ri-lightbulb-flash-line:before{content:""}.ri-lightbulb-line:before{content:""}.ri-line-chart-fill:before{content:""}.ri-line-chart-line:before{content:""}.ri-line-fill:before{content:""}.ri-line-height:before{content:""}.ri-line-line:before{content:""}.ri-link-m:before{content:""}.ri-link-unlink-m:before{content:""}.ri-link-unlink:before{content:""}.ri-link:before{content:""}.ri-linkedin-box-fill:before{content:""}.ri-linkedin-box-line:before{content:""}.ri-linkedin-fill:before{content:""}.ri-linkedin-line:before{content:""}.ri-links-fill:before{content:""}.ri-links-line:before{content:""}.ri-list-check-2:before{content:""}.ri-list-check:before{content:""}.ri-list-ordered:before{content:""}.ri-list-settings-fill:before{content:""}.ri-list-settings-line:before{content:""}.ri-list-unordered:before{content:""}.ri-live-fill:before{content:""}.ri-live-line:before{content:""}.ri-loader-2-fill:before{content:""}.ri-loader-2-line:before{content:""}.ri-loader-3-fill:before{content:""}.ri-loader-3-line:before{content:""}.ri-loader-4-fill:before{content:""}.ri-loader-4-line:before{content:""}.ri-loader-5-fill:before{content:""}.ri-loader-5-line:before{content:""}.ri-loader-fill:before{content:""}.ri-loader-line:before{content:""}.ri-lock-2-fill:before{content:""}.ri-lock-2-line:before{content:""}.ri-lock-fill:before{content:""}.ri-lock-line:before{content:""}.ri-lock-password-fill:before{content:""}.ri-lock-password-line:before{content:""}.ri-lock-unlock-fill:before{content:""}.ri-lock-unlock-line:before{content:""}.ri-login-box-fill:before{content:""}.ri-login-box-line:before{content:""}.ri-login-circle-fill:before{content:""}.ri-login-circle-line:before{content:""}.ri-logout-box-fill:before{content:""}.ri-logout-box-line:before{content:""}.ri-logout-box-r-fill:before{content:""}.ri-logout-box-r-line:before{content:""}.ri-logout-circle-fill:before{content:""}.ri-logout-circle-line:before{content:""}.ri-logout-circle-r-fill:before{content:""}.ri-logout-circle-r-line:before{content:""}.ri-luggage-cart-fill:before{content:""}.ri-luggage-cart-line:before{content:""}.ri-luggage-deposit-fill:before{content:""}.ri-luggage-deposit-line:before{content:""}.ri-lungs-fill:before{content:""}.ri-lungs-line:before{content:""}.ri-mac-fill:before{content:""}.ri-mac-line:before{content:""}.ri-macbook-fill:before{content:""}.ri-macbook-line:before{content:""}.ri-magic-fill:before{content:""}.ri-magic-line:before{content:""}.ri-mail-add-fill:before{content:""}.ri-mail-add-line:before{content:""}.ri-mail-check-fill:before{content:""}.ri-mail-check-line:before{content:""}.ri-mail-close-fill:before{content:""}.ri-mail-close-line:before{content:""}.ri-mail-download-fill:before{content:""}.ri-mail-download-line:before{content:""}.ri-mail-fill:before{content:""}.ri-mail-forbid-fill:before{content:""}.ri-mail-forbid-line:before{content:""}.ri-mail-line:before{content:""}.ri-mail-lock-fill:before{content:""}.ri-mail-lock-line:before{content:""}.ri-mail-open-fill:before{content:""}.ri-mail-open-line:before{content:""}.ri-mail-send-fill:before{content:""}.ri-mail-send-line:before{content:""}.ri-mail-settings-fill:before{content:""}.ri-mail-settings-line:before{content:""}.ri-mail-star-fill:before{content:""}.ri-mail-star-line:before{content:""}.ri-mail-unread-fill:before{content:""}.ri-mail-unread-line:before{content:""}.ri-mail-volume-fill:before{content:""}.ri-mail-volume-line:before{content:""}.ri-map-2-fill:before{content:""}.ri-map-2-line:before{content:""}.ri-map-fill:before{content:""}.ri-map-line:before{content:""}.ri-map-pin-2-fill:before{content:""}.ri-map-pin-2-line:before{content:""}.ri-map-pin-3-fill:before{content:""}.ri-map-pin-3-line:before{content:""}.ri-map-pin-4-fill:before{content:""}.ri-map-pin-4-line:before{content:""}.ri-map-pin-5-fill:before{content:""}.ri-map-pin-5-line:before{content:""}.ri-map-pin-add-fill:before{content:""}.ri-map-pin-add-line:before{content:""}.ri-map-pin-fill:before{content:""}.ri-map-pin-line:before{content:""}.ri-map-pin-range-fill:before{content:""}.ri-map-pin-range-line:before{content:""}.ri-map-pin-time-fill:before{content:""}.ri-map-pin-time-line:before{content:""}.ri-map-pin-user-fill:before{content:""}.ri-map-pin-user-line:before{content:""}.ri-mark-pen-fill:before{content:""}.ri-mark-pen-line:before{content:""}.ri-markdown-fill:before{content:""}.ri-markdown-line:before{content:""}.ri-markup-fill:before{content:""}.ri-markup-line:before{content:""}.ri-mastercard-fill:before{content:""}.ri-mastercard-line:before{content:""}.ri-mastodon-fill:before{content:""}.ri-mastodon-line:before{content:""}.ri-medal-2-fill:before{content:""}.ri-medal-2-line:before{content:""}.ri-medal-fill:before{content:""}.ri-medal-line:before{content:""}.ri-medicine-bottle-fill:before{content:""}.ri-medicine-bottle-line:before{content:""}.ri-medium-fill:before{content:""}.ri-medium-line:before{content:""}.ri-men-fill:before{content:""}.ri-men-line:before{content:""}.ri-mental-health-fill:before{content:""}.ri-mental-health-line:before{content:""}.ri-menu-2-fill:before{content:""}.ri-menu-2-line:before{content:""}.ri-menu-3-fill:before{content:""}.ri-menu-3-line:before{content:""}.ri-menu-4-fill:before{content:""}.ri-menu-4-line:before{content:""}.ri-menu-5-fill:before{content:""}.ri-menu-5-line:before{content:""}.ri-menu-add-fill:before{content:""}.ri-menu-add-line:before{content:""}.ri-menu-fill:before{content:""}.ri-menu-fold-fill:before{content:""}.ri-menu-fold-line:before{content:""}.ri-menu-line:before{content:""}.ri-menu-unfold-fill:before{content:""}.ri-menu-unfold-line:before{content:""}.ri-merge-cells-horizontal:before{content:""}.ri-merge-cells-vertical:before{content:""}.ri-message-2-fill:before{content:""}.ri-message-2-line:before{content:""}.ri-message-3-fill:before{content:""}.ri-message-3-line:before{content:""}.ri-message-fill:before{content:""}.ri-message-line:before{content:""}.ri-messenger-fill:before{content:""}.ri-messenger-line:before{content:""}.ri-meteor-fill:before{content:""}.ri-meteor-line:before{content:""}.ri-mic-2-fill:before{content:""}.ri-mic-2-line:before{content:""}.ri-mic-fill:before{content:""}.ri-mic-line:before{content:""}.ri-mic-off-fill:before{content:""}.ri-mic-off-line:before{content:""}.ri-mickey-fill:before{content:""}.ri-mickey-line:before{content:""}.ri-microscope-fill:before{content:""}.ri-microscope-line:before{content:""}.ri-microsoft-fill:before{content:""}.ri-microsoft-line:before{content:""}.ri-mind-map:before{content:""}.ri-mini-program-fill:before{content:""}.ri-mini-program-line:before{content:""}.ri-mist-fill:before{content:""}.ri-mist-line:before{content:""}.ri-money-cny-box-fill:before{content:""}.ri-money-cny-box-line:before{content:""}.ri-money-cny-circle-fill:before{content:""}.ri-money-cny-circle-line:before{content:""}.ri-money-dollar-box-fill:before{content:""}.ri-money-dollar-box-line:before{content:""}.ri-money-dollar-circle-fill:before{content:""}.ri-money-dollar-circle-line:before{content:""}.ri-money-euro-box-fill:before{content:""}.ri-money-euro-box-line:before{content:""}.ri-money-euro-circle-fill:before{content:""}.ri-money-euro-circle-line:before{content:""}.ri-money-pound-box-fill:before{content:""}.ri-money-pound-box-line:before{content:""}.ri-money-pound-circle-fill:before{content:""}.ri-money-pound-circle-line:before{content:""}.ri-moon-clear-fill:before{content:""}.ri-moon-clear-line:before{content:""}.ri-moon-cloudy-fill:before{content:""}.ri-moon-cloudy-line:before{content:""}.ri-moon-fill:before{content:""}.ri-moon-foggy-fill:before{content:""}.ri-moon-foggy-line:before{content:""}.ri-moon-line:before{content:""}.ri-more-2-fill:before{content:""}.ri-more-2-line:before{content:""}.ri-more-fill:before{content:""}.ri-more-line:before{content:""}.ri-motorbike-fill:before{content:""}.ri-motorbike-line:before{content:""}.ri-mouse-fill:before{content:""}.ri-mouse-line:before{content:""}.ri-movie-2-fill:before{content:""}.ri-movie-2-line:before{content:""}.ri-movie-fill:before{content:""}.ri-movie-line:before{content:""}.ri-music-2-fill:before{content:""}.ri-music-2-line:before{content:""}.ri-music-fill:before{content:""}.ri-music-line:before{content:""}.ri-mv-fill:before{content:""}.ri-mv-line:before{content:""}.ri-navigation-fill:before{content:""}.ri-navigation-line:before{content:""}.ri-netease-cloud-music-fill:before{content:""}.ri-netease-cloud-music-line:before{content:""}.ri-netflix-fill:before{content:""}.ri-netflix-line:before{content:""}.ri-newspaper-fill:before{content:""}.ri-newspaper-line:before{content:""}.ri-node-tree:before{content:""}.ri-notification-2-fill:before{content:""}.ri-notification-2-line:before{content:""}.ri-notification-3-fill:before{content:""}.ri-notification-3-line:before{content:""}.ri-notification-4-fill:before{content:""}.ri-notification-4-line:before{content:""}.ri-notification-badge-fill:before{content:""}.ri-notification-badge-line:before{content:""}.ri-notification-fill:before{content:""}.ri-notification-line:before{content:""}.ri-notification-off-fill:before{content:""}.ri-notification-off-line:before{content:""}.ri-npmjs-fill:before{content:""}.ri-npmjs-line:before{content:""}.ri-number-0:before{content:""}.ri-number-1:before{content:""}.ri-number-2:before{content:""}.ri-number-3:before{content:""}.ri-number-4:before{content:""}.ri-number-5:before{content:""}.ri-number-6:before{content:""}.ri-number-7:before{content:""}.ri-number-8:before{content:""}.ri-number-9:before{content:""}.ri-numbers-fill:before{content:""}.ri-numbers-line:before{content:""}.ri-nurse-fill:before{content:""}.ri-nurse-line:before{content:""}.ri-oil-fill:before{content:""}.ri-oil-line:before{content:""}.ri-omega:before{content:""}.ri-open-arm-fill:before{content:""}.ri-open-arm-line:before{content:""}.ri-open-source-fill:before{content:""}.ri-open-source-line:before{content:""}.ri-opera-fill:before{content:""}.ri-opera-line:before{content:""}.ri-order-play-fill:before{content:""}.ri-order-play-line:before{content:""}.ri-organization-chart:before{content:""}.ri-outlet-2-fill:before{content:""}.ri-outlet-2-line:before{content:""}.ri-outlet-fill:before{content:""}.ri-outlet-line:before{content:""}.ri-page-separator:before{content:""}.ri-pages-fill:before{content:""}.ri-pages-line:before{content:""}.ri-paint-brush-fill:before{content:""}.ri-paint-brush-line:before{content:""}.ri-paint-fill:before{content:""}.ri-paint-line:before{content:""}.ri-palette-fill:before{content:""}.ri-palette-line:before{content:""}.ri-pantone-fill:before{content:""}.ri-pantone-line:before{content:""}.ri-paragraph:before{content:""}.ri-parent-fill:before{content:""}.ri-parent-line:before{content:""}.ri-parentheses-fill:before{content:""}.ri-parentheses-line:before{content:""}.ri-parking-box-fill:before{content:""}.ri-parking-box-line:before{content:""}.ri-parking-fill:before{content:""}.ri-parking-line:before{content:""}.ri-passport-fill:before{content:""}.ri-passport-line:before{content:""}.ri-patreon-fill:before{content:""}.ri-patreon-line:before{content:""}.ri-pause-circle-fill:before{content:""}.ri-pause-circle-line:before{content:""}.ri-pause-fill:before{content:""}.ri-pause-line:before{content:""}.ri-pause-mini-fill:before{content:""}.ri-pause-mini-line:before{content:""}.ri-paypal-fill:before{content:""}.ri-paypal-line:before{content:""}.ri-pen-nib-fill:before{content:""}.ri-pen-nib-line:before{content:""}.ri-pencil-fill:before{content:""}.ri-pencil-line:before{content:""}.ri-pencil-ruler-2-fill:before{content:""}.ri-pencil-ruler-2-line:before{content:""}.ri-pencil-ruler-fill:before{content:""}.ri-pencil-ruler-line:before{content:""}.ri-percent-fill:before{content:""}.ri-percent-line:before{content:""}.ri-phone-camera-fill:before{content:""}.ri-phone-camera-line:before{content:""}.ri-phone-fill:before{content:""}.ri-phone-find-fill:before{content:""}.ri-phone-find-line:before{content:""}.ri-phone-line:before{content:""}.ri-phone-lock-fill:before{content:""}.ri-phone-lock-line:before{content:""}.ri-picture-in-picture-2-fill:before{content:""}.ri-picture-in-picture-2-line:before{content:""}.ri-picture-in-picture-exit-fill:before{content:""}.ri-picture-in-picture-exit-line:before{content:""}.ri-picture-in-picture-fill:before{content:""}.ri-picture-in-picture-line:before{content:""}.ri-pie-chart-2-fill:before{content:""}.ri-pie-chart-2-line:before{content:""}.ri-pie-chart-box-fill:before{content:""}.ri-pie-chart-box-line:before{content:""}.ri-pie-chart-fill:before{content:""}.ri-pie-chart-line:before{content:""}.ri-pin-distance-fill:before{content:""}.ri-pin-distance-line:before{content:""}.ri-ping-pong-fill:before{content:""}.ri-ping-pong-line:before{content:""}.ri-pinterest-fill:before{content:""}.ri-pinterest-line:before{content:""}.ri-pinyin-input:before{content:""}.ri-pixelfed-fill:before{content:""}.ri-pixelfed-line:before{content:""}.ri-plane-fill:before{content:""}.ri-plane-line:before{content:""}.ri-plant-fill:before{content:""}.ri-plant-line:before{content:""}.ri-play-circle-fill:before{content:""}.ri-play-circle-line:before{content:""}.ri-play-fill:before{content:""}.ri-play-line:before{content:""}.ri-play-list-2-fill:before{content:""}.ri-play-list-2-line:before{content:""}.ri-play-list-add-fill:before{content:""}.ri-play-list-add-line:before{content:""}.ri-play-list-fill:before{content:""}.ri-play-list-line:before{content:""}.ri-play-mini-fill:before{content:""}.ri-play-mini-line:before{content:""}.ri-playstation-fill:before{content:""}.ri-playstation-line:before{content:""}.ri-plug-2-fill:before{content:""}.ri-plug-2-line:before{content:""}.ri-plug-fill:before{content:""}.ri-plug-line:before{content:""}.ri-polaroid-2-fill:before{content:""}.ri-polaroid-2-line:before{content:""}.ri-polaroid-fill:before{content:""}.ri-polaroid-line:before{content:""}.ri-police-car-fill:before{content:""}.ri-police-car-line:before{content:""}.ri-price-tag-2-fill:before{content:""}.ri-price-tag-2-line:before{content:""}.ri-price-tag-3-fill:before{content:""}.ri-price-tag-3-line:before{content:""}.ri-price-tag-fill:before{content:""}.ri-price-tag-line:before{content:""}.ri-printer-cloud-fill:before{content:""}.ri-printer-cloud-line:before{content:""}.ri-printer-fill:before{content:""}.ri-printer-line:before{content:""}.ri-product-hunt-fill:before{content:""}.ri-product-hunt-line:before{content:""}.ri-profile-fill:before{content:""}.ri-profile-line:before{content:""}.ri-projector-2-fill:before{content:""}.ri-projector-2-line:before{content:""}.ri-projector-fill:before{content:""}.ri-projector-line:before{content:""}.ri-psychotherapy-fill:before{content:""}.ri-psychotherapy-line:before{content:""}.ri-pulse-fill:before{content:""}.ri-pulse-line:before{content:""}.ri-pushpin-2-fill:before{content:""}.ri-pushpin-2-line:before{content:""}.ri-pushpin-fill:before{content:""}.ri-pushpin-line:before{content:""}.ri-qq-fill:before{content:""}.ri-qq-line:before{content:""}.ri-qr-code-fill:before{content:""}.ri-qr-code-line:before{content:""}.ri-qr-scan-2-fill:before{content:""}.ri-qr-scan-2-line:before{content:""}.ri-qr-scan-fill:before{content:""}.ri-qr-scan-line:before{content:""}.ri-question-answer-fill:before{content:""}.ri-question-answer-line:before{content:""}.ri-question-fill:before{content:""}.ri-question-line:before{content:""}.ri-question-mark:before{content:""}.ri-questionnaire-fill:before{content:""}.ri-questionnaire-line:before{content:""}.ri-quill-pen-fill:before{content:""}.ri-quill-pen-line:before{content:""}.ri-radar-fill:before{content:""}.ri-radar-line:before{content:""}.ri-radio-2-fill:before{content:""}.ri-radio-2-line:before{content:""}.ri-radio-button-fill:before{content:""}.ri-radio-button-line:before{content:""}.ri-radio-fill:before{content:""}.ri-radio-line:before{content:""}.ri-rainbow-fill:before{content:""}.ri-rainbow-line:before{content:""}.ri-rainy-fill:before{content:""}.ri-rainy-line:before{content:""}.ri-reactjs-fill:before{content:""}.ri-reactjs-line:before{content:""}.ri-record-circle-fill:before{content:""}.ri-record-circle-line:before{content:""}.ri-record-mail-fill:before{content:""}.ri-record-mail-line:before{content:""}.ri-recycle-fill:before{content:""}.ri-recycle-line:before{content:""}.ri-red-packet-fill:before{content:""}.ri-red-packet-line:before{content:""}.ri-reddit-fill:before{content:""}.ri-reddit-line:before{content:""}.ri-refresh-fill:before{content:""}.ri-refresh-line:before{content:""}.ri-refund-2-fill:before{content:""}.ri-refund-2-line:before{content:""}.ri-refund-fill:before{content:""}.ri-refund-line:before{content:""}.ri-registered-fill:before{content:""}.ri-registered-line:before{content:""}.ri-remixicon-fill:before{content:""}.ri-remixicon-line:before{content:""}.ri-remote-control-2-fill:before{content:""}.ri-remote-control-2-line:before{content:""}.ri-remote-control-fill:before{content:""}.ri-remote-control-line:before{content:""}.ri-repeat-2-fill:before{content:""}.ri-repeat-2-line:before{content:""}.ri-repeat-fill:before{content:""}.ri-repeat-line:before{content:""}.ri-repeat-one-fill:before{content:""}.ri-repeat-one-line:before{content:""}.ri-reply-all-fill:before{content:""}.ri-reply-all-line:before{content:""}.ri-reply-fill:before{content:""}.ri-reply-line:before{content:""}.ri-reserved-fill:before{content:""}.ri-reserved-line:before{content:""}.ri-rest-time-fill:before{content:""}.ri-rest-time-line:before{content:""}.ri-restart-fill:before{content:""}.ri-restart-line:before{content:""}.ri-restaurant-2-fill:before{content:""}.ri-restaurant-2-line:before{content:""}.ri-restaurant-fill:before{content:""}.ri-restaurant-line:before{content:""}.ri-rewind-fill:before{content:""}.ri-rewind-line:before{content:""}.ri-rewind-mini-fill:before{content:""}.ri-rewind-mini-line:before{content:""}.ri-rhythm-fill:before{content:""}.ri-rhythm-line:before{content:""}.ri-riding-fill:before{content:""}.ri-riding-line:before{content:""}.ri-road-map-fill:before{content:""}.ri-road-map-line:before{content:""}.ri-roadster-fill:before{content:""}.ri-roadster-line:before{content:""}.ri-robot-fill:before{content:""}.ri-robot-line:before{content:""}.ri-rocket-2-fill:before{content:""}.ri-rocket-2-line:before{content:""}.ri-rocket-fill:before{content:""}.ri-rocket-line:before{content:""}.ri-rotate-lock-fill:before{content:""}.ri-rotate-lock-line:before{content:""}.ri-rounded-corner:before{content:""}.ri-route-fill:before{content:""}.ri-route-line:before{content:""}.ri-router-fill:before{content:""}.ri-router-line:before{content:""}.ri-rss-fill:before{content:""}.ri-rss-line:before{content:""}.ri-ruler-2-fill:before{content:""}.ri-ruler-2-line:before{content:""}.ri-ruler-fill:before{content:""}.ri-ruler-line:before{content:""}.ri-run-fill:before{content:""}.ri-run-line:before{content:""}.ri-safari-fill:before{content:""}.ri-safari-line:before{content:""}.ri-safe-2-fill:before{content:""}.ri-safe-2-line:before{content:""}.ri-safe-fill:before{content:""}.ri-safe-line:before{content:""}.ri-sailboat-fill:before{content:""}.ri-sailboat-line:before{content:""}.ri-save-2-fill:before{content:""}.ri-save-2-line:before{content:""}.ri-save-3-fill:before{content:""}.ri-save-3-line:before{content:""}.ri-save-fill:before{content:""}.ri-save-line:before{content:""}.ri-scales-2-fill:before{content:""}.ri-scales-2-line:before{content:""}.ri-scales-3-fill:before{content:""}.ri-scales-3-line:before{content:""}.ri-scales-fill:before{content:""}.ri-scales-line:before{content:""}.ri-scan-2-fill:before{content:""}.ri-scan-2-line:before{content:""}.ri-scan-fill:before{content:""}.ri-scan-line:before{content:""}.ri-scissors-2-fill:before{content:""}.ri-scissors-2-line:before{content:""}.ri-scissors-cut-fill:before{content:""}.ri-scissors-cut-line:before{content:""}.ri-scissors-fill:before{content:""}.ri-scissors-line:before{content:""}.ri-screenshot-2-fill:before{content:""}.ri-screenshot-2-line:before{content:""}.ri-screenshot-fill:before{content:""}.ri-screenshot-line:before{content:""}.ri-sd-card-fill:before{content:""}.ri-sd-card-line:before{content:""}.ri-sd-card-mini-fill:before{content:""}.ri-sd-card-mini-line:before{content:""}.ri-search-2-fill:before{content:""}.ri-search-2-line:before{content:""}.ri-search-eye-fill:before{content:""}.ri-search-eye-line:before{content:""}.ri-search-fill:before{content:""}.ri-search-line:before{content:""}.ri-secure-payment-fill:before{content:""}.ri-secure-payment-line:before{content:""}.ri-seedling-fill:before{content:""}.ri-seedling-line:before{content:""}.ri-send-backward:before{content:""}.ri-send-plane-2-fill:before{content:""}.ri-send-plane-2-line:before{content:""}.ri-send-plane-fill:before{content:""}.ri-send-plane-line:before{content:""}.ri-send-to-back:before{content:""}.ri-sensor-fill:before{content:""}.ri-sensor-line:before{content:""}.ri-separator:before{content:""}.ri-server-fill:before{content:""}.ri-server-line:before{content:""}.ri-service-fill:before{content:""}.ri-service-line:before{content:""}.ri-settings-2-fill:before{content:""}.ri-settings-2-line:before{content:""}.ri-settings-3-fill:before{content:""}.ri-settings-3-line:before{content:""}.ri-settings-4-fill:before{content:""}.ri-settings-4-line:before{content:""}.ri-settings-5-fill:before{content:""}.ri-settings-5-line:before{content:""}.ri-settings-6-fill:before{content:""}.ri-settings-6-line:before{content:""}.ri-settings-fill:before{content:""}.ri-settings-line:before{content:""}.ri-shape-2-fill:before{content:""}.ri-shape-2-line:before{content:""}.ri-shape-fill:before{content:""}.ri-shape-line:before{content:""}.ri-share-box-fill:before{content:""}.ri-share-box-line:before{content:""}.ri-share-circle-fill:before{content:""}.ri-share-circle-line:before{content:""}.ri-share-fill:before{content:""}.ri-share-forward-2-fill:before{content:""}.ri-share-forward-2-line:before{content:""}.ri-share-forward-box-fill:before{content:""}.ri-share-forward-box-line:before{content:""}.ri-share-forward-fill:before{content:""}.ri-share-forward-line:before{content:""}.ri-share-line:before{content:""}.ri-shield-check-fill:before{content:""}.ri-shield-check-line:before{content:""}.ri-shield-cross-fill:before{content:""}.ri-shield-cross-line:before{content:""}.ri-shield-fill:before{content:""}.ri-shield-flash-fill:before{content:""}.ri-shield-flash-line:before{content:""}.ri-shield-keyhole-fill:before{content:""}.ri-shield-keyhole-line:before{content:""}.ri-shield-line:before{content:""}.ri-shield-star-fill:before{content:""}.ri-shield-star-line:before{content:""}.ri-shield-user-fill:before{content:""}.ri-shield-user-line:before{content:""}.ri-ship-2-fill:before{content:""}.ri-ship-2-line:before{content:""}.ri-ship-fill:before{content:""}.ri-ship-line:before{content:""}.ri-shirt-fill:before{content:""}.ri-shirt-line:before{content:""}.ri-shopping-bag-2-fill:before{content:""}.ri-shopping-bag-2-line:before{content:""}.ri-shopping-bag-3-fill:before{content:""}.ri-shopping-bag-3-line:before{content:""}.ri-shopping-bag-fill:before{content:""}.ri-shopping-bag-line:before{content:""}.ri-shopping-basket-2-fill:before{content:""}.ri-shopping-basket-2-line:before{content:""}.ri-shopping-basket-fill:before{content:""}.ri-shopping-basket-line:before{content:""}.ri-shopping-cart-2-fill:before{content:""}.ri-shopping-cart-2-line:before{content:""}.ri-shopping-cart-fill:before{content:""}.ri-shopping-cart-line:before{content:""}.ri-showers-fill:before{content:""}.ri-showers-line:before{content:""}.ri-shuffle-fill:before{content:""}.ri-shuffle-line:before{content:""}.ri-shut-down-fill:before{content:""}.ri-shut-down-line:before{content:""}.ri-side-bar-fill:before{content:""}.ri-side-bar-line:before{content:""}.ri-signal-tower-fill:before{content:""}.ri-signal-tower-line:before{content:""}.ri-signal-wifi-1-fill:before{content:""}.ri-signal-wifi-1-line:before{content:""}.ri-signal-wifi-2-fill:before{content:""}.ri-signal-wifi-2-line:before{content:""}.ri-signal-wifi-3-fill:before{content:""}.ri-signal-wifi-3-line:before{content:""}.ri-signal-wifi-error-fill:before{content:""}.ri-signal-wifi-error-line:before{content:""}.ri-signal-wifi-fill:before{content:""}.ri-signal-wifi-line:before{content:""}.ri-signal-wifi-off-fill:before{content:""}.ri-signal-wifi-off-line:before{content:""}.ri-sim-card-2-fill:before{content:""}.ri-sim-card-2-line:before{content:""}.ri-sim-card-fill:before{content:""}.ri-sim-card-line:before{content:""}.ri-single-quotes-l:before{content:""}.ri-single-quotes-r:before{content:""}.ri-sip-fill:before{content:""}.ri-sip-line:before{content:""}.ri-skip-back-fill:before{content:""}.ri-skip-back-line:before{content:""}.ri-skip-back-mini-fill:before{content:""}.ri-skip-back-mini-line:before{content:""}.ri-skip-forward-fill:before{content:""}.ri-skip-forward-line:before{content:""}.ri-skip-forward-mini-fill:before{content:""}.ri-skip-forward-mini-line:before{content:""}.ri-skull-2-fill:before{content:""}.ri-skull-2-line:before{content:""}.ri-skull-fill:before{content:""}.ri-skull-line:before{content:""}.ri-skype-fill:before{content:""}.ri-skype-line:before{content:""}.ri-slack-fill:before{content:""}.ri-slack-line:before{content:""}.ri-slice-fill:before{content:""}.ri-slice-line:before{content:""}.ri-slideshow-2-fill:before{content:""}.ri-slideshow-2-line:before{content:""}.ri-slideshow-3-fill:before{content:""}.ri-slideshow-3-line:before{content:""}.ri-slideshow-4-fill:before{content:""}.ri-slideshow-4-line:before{content:""}.ri-slideshow-fill:before{content:""}.ri-slideshow-line:before{content:""}.ri-smartphone-fill:before{content:""}.ri-smartphone-line:before{content:""}.ri-snapchat-fill:before{content:""}.ri-snapchat-line:before{content:""}.ri-snowy-fill:before{content:""}.ri-snowy-line:before{content:""}.ri-sort-asc:before{content:""}.ri-sort-desc:before{content:""}.ri-sound-module-fill:before{content:""}.ri-sound-module-line:before{content:""}.ri-soundcloud-fill:before{content:""}.ri-soundcloud-line:before{content:""}.ri-space-ship-fill:before{content:""}.ri-space-ship-line:before{content:""}.ri-space:before{content:""}.ri-spam-2-fill:before{content:""}.ri-spam-2-line:before{content:""}.ri-spam-3-fill:before{content:""}.ri-spam-3-line:before{content:""}.ri-spam-fill:before{content:""}.ri-spam-line:before{content:""}.ri-speaker-2-fill:before{content:""}.ri-speaker-2-line:before{content:""}.ri-speaker-3-fill:before{content:""}.ri-speaker-3-line:before{content:""}.ri-speaker-fill:before{content:""}.ri-speaker-line:before{content:""}.ri-spectrum-fill:before{content:""}.ri-spectrum-line:before{content:""}.ri-speed-fill:before{content:""}.ri-speed-line:before{content:""}.ri-speed-mini-fill:before{content:""}.ri-speed-mini-line:before{content:""}.ri-split-cells-horizontal:before{content:""}.ri-split-cells-vertical:before{content:""}.ri-spotify-fill:before{content:""}.ri-spotify-line:before{content:""}.ri-spy-fill:before{content:""}.ri-spy-line:before{content:""}.ri-stack-fill:before{content:""}.ri-stack-line:before{content:""}.ri-stack-overflow-fill:before{content:""}.ri-stack-overflow-line:before{content:""}.ri-stackshare-fill:before{content:""}.ri-stackshare-line:before{content:""}.ri-star-fill:before{content:""}.ri-star-half-fill:before{content:""}.ri-star-half-line:before{content:""}.ri-star-half-s-fill:before{content:""}.ri-star-half-s-line:before{content:""}.ri-star-line:before{content:""}.ri-star-s-fill:before{content:""}.ri-star-s-line:before{content:""}.ri-star-smile-fill:before{content:""}.ri-star-smile-line:before{content:""}.ri-steam-fill:before{content:""}.ri-steam-line:before{content:""}.ri-steering-2-fill:before{content:""}.ri-steering-2-line:before{content:""}.ri-steering-fill:before{content:""}.ri-steering-line:before{content:""}.ri-stethoscope-fill:before{content:""}.ri-stethoscope-line:before{content:""}.ri-sticky-note-2-fill:before{content:""}.ri-sticky-note-2-line:before{content:""}.ri-sticky-note-fill:before{content:""}.ri-sticky-note-line:before{content:""}.ri-stock-fill:before{content:""}.ri-stock-line:before{content:""}.ri-stop-circle-fill:before{content:""}.ri-stop-circle-line:before{content:""}.ri-stop-fill:before{content:""}.ri-stop-line:before{content:""}.ri-stop-mini-fill:before{content:""}.ri-stop-mini-line:before{content:""}.ri-store-2-fill:before{content:""}.ri-store-2-line:before{content:""}.ri-store-3-fill:before{content:""}.ri-store-3-line:before{content:""}.ri-store-fill:before{content:""}.ri-store-line:before{content:""}.ri-strikethrough-2:before{content:""}.ri-strikethrough:before{content:""}.ri-subscript-2:before{content:""}.ri-subscript:before{content:""}.ri-subtract-fill:before{content:""}.ri-subtract-line:before{content:""}.ri-subway-fill:before{content:""}.ri-subway-line:before{content:""}.ri-subway-wifi-fill:before{content:""}.ri-subway-wifi-line:before{content:""}.ri-suitcase-2-fill:before{content:""}.ri-suitcase-2-line:before{content:""}.ri-suitcase-3-fill:before{content:""}.ri-suitcase-3-line:before{content:""}.ri-suitcase-fill:before{content:""}.ri-suitcase-line:before{content:""}.ri-sun-cloudy-fill:before{content:""}.ri-sun-cloudy-line:before{content:""}.ri-sun-fill:before{content:""}.ri-sun-foggy-fill:before{content:""}.ri-sun-foggy-line:before{content:""}.ri-sun-line:before{content:""}.ri-superscript-2:before{content:""}.ri-superscript:before{content:""}.ri-surgical-mask-fill:before{content:""}.ri-surgical-mask-line:before{content:""}.ri-surround-sound-fill:before{content:""}.ri-surround-sound-line:before{content:""}.ri-survey-fill:before{content:""}.ri-survey-line:before{content:""}.ri-swap-box-fill:before{content:""}.ri-swap-box-line:before{content:""}.ri-swap-fill:before{content:""}.ri-swap-line:before{content:""}.ri-switch-fill:before{content:""}.ri-switch-line:before{content:""}.ri-sword-fill:before{content:""}.ri-sword-line:before{content:""}.ri-syringe-fill:before{content:""}.ri-syringe-line:before{content:""}.ri-t-box-fill:before{content:""}.ri-t-box-line:before{content:""}.ri-t-shirt-2-fill:before{content:""}.ri-t-shirt-2-line:before{content:""}.ri-t-shirt-air-fill:before{content:""}.ri-t-shirt-air-line:before{content:""}.ri-t-shirt-fill:before{content:""}.ri-t-shirt-line:before{content:""}.ri-table-2:before{content:""}.ri-table-alt-fill:before{content:""}.ri-table-alt-line:before{content:""}.ri-table-fill:before{content:""}.ri-table-line:before{content:""}.ri-tablet-fill:before{content:""}.ri-tablet-line:before{content:""}.ri-takeaway-fill:before{content:""}.ri-takeaway-line:before{content:""}.ri-taobao-fill:before{content:""}.ri-taobao-line:before{content:""}.ri-tape-fill:before{content:""}.ri-tape-line:before{content:""}.ri-task-fill:before{content:""}.ri-task-line:before{content:""}.ri-taxi-fill:before{content:""}.ri-taxi-line:before{content:""}.ri-taxi-wifi-fill:before{content:""}.ri-taxi-wifi-line:before{content:""}.ri-team-fill:before{content:""}.ri-team-line:before{content:""}.ri-telegram-fill:before{content:""}.ri-telegram-line:before{content:""}.ri-temp-cold-fill:before{content:""}.ri-temp-cold-line:before{content:""}.ri-temp-hot-fill:before{content:""}.ri-temp-hot-line:before{content:""}.ri-terminal-box-fill:before{content:""}.ri-terminal-box-line:before{content:""}.ri-terminal-fill:before{content:""}.ri-terminal-line:before{content:""}.ri-terminal-window-fill:before{content:""}.ri-terminal-window-line:before{content:""}.ri-test-tube-fill:before{content:""}.ri-test-tube-line:before{content:""}.ri-text-direction-l:before{content:""}.ri-text-direction-r:before{content:""}.ri-text-spacing:before{content:""}.ri-text-wrap:before{content:""}.ri-text:before{content:""}.ri-thermometer-fill:before{content:""}.ri-thermometer-line:before{content:""}.ri-thumb-down-fill:before{content:""}.ri-thumb-down-line:before{content:""}.ri-thumb-up-fill:before{content:""}.ri-thumb-up-line:before{content:""}.ri-thunderstorms-fill:before{content:""}.ri-thunderstorms-line:before{content:""}.ri-ticket-2-fill:before{content:""}.ri-ticket-2-line:before{content:""}.ri-ticket-fill:before{content:""}.ri-ticket-line:before{content:""}.ri-time-fill:before{content:""}.ri-time-line:before{content:""}.ri-timer-2-fill:before{content:""}.ri-timer-2-line:before{content:""}.ri-timer-fill:before{content:""}.ri-timer-flash-fill:before{content:""}.ri-timer-flash-line:before{content:""}.ri-timer-line:before{content:""}.ri-todo-fill:before{content:""}.ri-todo-line:before{content:""}.ri-toggle-fill:before{content:""}.ri-toggle-line:before{content:""}.ri-tools-fill:before{content:""}.ri-tools-line:before{content:""}.ri-tornado-fill:before{content:""}.ri-tornado-line:before{content:""}.ri-trademark-fill:before{content:""}.ri-trademark-line:before{content:""}.ri-traffic-light-fill:before{content:""}.ri-traffic-light-line:before{content:""}.ri-train-fill:before{content:""}.ri-train-line:before{content:""}.ri-train-wifi-fill:before{content:""}.ri-train-wifi-line:before{content:""}.ri-translate-2:before{content:""}.ri-translate:before{content:""}.ri-travesti-fill:before{content:""}.ri-travesti-line:before{content:""}.ri-treasure-map-fill:before{content:""}.ri-treasure-map-line:before{content:""}.ri-trello-fill:before{content:""}.ri-trello-line:before{content:""}.ri-trophy-fill:before{content:""}.ri-trophy-line:before{content:""}.ri-truck-fill:before{content:""}.ri-truck-line:before{content:""}.ri-tumblr-fill:before{content:""}.ri-tumblr-line:before{content:""}.ri-tv-2-fill:before{content:""}.ri-tv-2-line:before{content:""}.ri-tv-fill:before{content:""}.ri-tv-line:before{content:""}.ri-twitch-fill:before{content:""}.ri-twitch-line:before{content:""}.ri-twitter-fill:before{content:""}.ri-twitter-line:before{content:""}.ri-typhoon-fill:before{content:""}.ri-typhoon-line:before{content:""}.ri-u-disk-fill:before{content:""}.ri-u-disk-line:before{content:""}.ri-ubuntu-fill:before{content:""}.ri-ubuntu-line:before{content:""}.ri-umbrella-fill:before{content:""}.ri-umbrella-line:before{content:""}.ri-underline:before{content:""}.ri-uninstall-fill:before{content:""}.ri-uninstall-line:before{content:""}.ri-unsplash-fill:before{content:""}.ri-unsplash-line:before{content:""}.ri-upload-2-fill:before{content:""}.ri-upload-2-line:before{content:""}.ri-upload-cloud-2-fill:before{content:""}.ri-upload-cloud-2-line:before{content:""}.ri-upload-cloud-fill:before{content:""}.ri-upload-cloud-line:before{content:""}.ri-upload-fill:before{content:""}.ri-upload-line:before{content:""}.ri-usb-fill:before{content:""}.ri-usb-line:before{content:""}.ri-user-2-fill:before{content:""}.ri-user-2-line:before{content:""}.ri-user-3-fill:before{content:""}.ri-user-3-line:before{content:""}.ri-user-4-fill:before{content:""}.ri-user-4-line:before{content:""}.ri-user-5-fill:before{content:""}.ri-user-5-line:before{content:""}.ri-user-6-fill:before{content:""}.ri-user-6-line:before{content:""}.ri-user-add-fill:before{content:""}.ri-user-add-line:before{content:""}.ri-user-fill:before{content:""}.ri-user-follow-fill:before{content:""}.ri-user-follow-line:before{content:""}.ri-user-heart-fill:before{content:""}.ri-user-heart-line:before{content:""}.ri-user-line:before{content:""}.ri-user-location-fill:before{content:""}.ri-user-location-line:before{content:""}.ri-user-received-2-fill:before{content:""}.ri-user-received-2-line:before{content:""}.ri-user-received-fill:before{content:""}.ri-user-received-line:before{content:""}.ri-user-search-fill:before{content:""}.ri-user-search-line:before{content:""}.ri-user-settings-fill:before{content:""}.ri-user-settings-line:before{content:""}.ri-user-shared-2-fill:before{content:""}.ri-user-shared-2-line:before{content:""}.ri-user-shared-fill:before{content:""}.ri-user-shared-line:before{content:""}.ri-user-smile-fill:before{content:""}.ri-user-smile-line:before{content:""}.ri-user-star-fill:before{content:""}.ri-user-star-line:before{content:""}.ri-user-unfollow-fill:before{content:""}.ri-user-unfollow-line:before{content:""}.ri-user-voice-fill:before{content:""}.ri-user-voice-line:before{content:""}.ri-video-add-fill:before{content:""}.ri-video-add-line:before{content:""}.ri-video-chat-fill:before{content:""}.ri-video-chat-line:before{content:""}.ri-video-download-fill:before{content:""}.ri-video-download-line:before{content:""}.ri-video-fill:before{content:""}.ri-video-line:before{content:""}.ri-video-upload-fill:before{content:""}.ri-video-upload-line:before{content:""}.ri-vidicon-2-fill:before{content:""}.ri-vidicon-2-line:before{content:""}.ri-vidicon-fill:before{content:""}.ri-vidicon-line:before{content:""}.ri-vimeo-fill:before{content:""}.ri-vimeo-line:before{content:""}.ri-vip-crown-2-fill:before{content:""}.ri-vip-crown-2-line:before{content:""}.ri-vip-crown-fill:before{content:""}.ri-vip-crown-line:before{content:""}.ri-vip-diamond-fill:before{content:""}.ri-vip-diamond-line:before{content:""}.ri-vip-fill:before{content:""}.ri-vip-line:before{content:""}.ri-virus-fill:before{content:""}.ri-virus-line:before{content:""}.ri-visa-fill:before{content:""}.ri-visa-line:before{content:""}.ri-voice-recognition-fill:before{content:""}.ri-voice-recognition-line:before{content:""}.ri-voiceprint-fill:before{content:""}.ri-voiceprint-line:before{content:""}.ri-volume-down-fill:before{content:""}.ri-volume-down-line:before{content:""}.ri-volume-mute-fill:before{content:""}.ri-volume-mute-line:before{content:""}.ri-volume-off-vibrate-fill:before{content:""}.ri-volume-off-vibrate-line:before{content:""}.ri-volume-up-fill:before{content:""}.ri-volume-up-line:before{content:""}.ri-volume-vibrate-fill:before{content:""}.ri-volume-vibrate-line:before{content:""}.ri-vuejs-fill:before{content:""}.ri-vuejs-line:before{content:""}.ri-walk-fill:before{content:""}.ri-walk-line:before{content:""}.ri-wallet-2-fill:before{content:""}.ri-wallet-2-line:before{content:""}.ri-wallet-3-fill:before{content:""}.ri-wallet-3-line:before{content:""}.ri-wallet-fill:before{content:""}.ri-wallet-line:before{content:""}.ri-water-flash-fill:before{content:""}.ri-water-flash-line:before{content:""}.ri-webcam-fill:before{content:""}.ri-webcam-line:before{content:""}.ri-wechat-2-fill:before{content:""}.ri-wechat-2-line:before{content:""}.ri-wechat-fill:before{content:""}.ri-wechat-line:before{content:""}.ri-wechat-pay-fill:before{content:""}.ri-wechat-pay-line:before{content:""}.ri-weibo-fill:before{content:""}.ri-weibo-line:before{content:""}.ri-whatsapp-fill:before{content:""}.ri-whatsapp-line:before{content:""}.ri-wheelchair-fill:before{content:""}.ri-wheelchair-line:before{content:""}.ri-wifi-fill:before{content:""}.ri-wifi-line:before{content:""}.ri-wifi-off-fill:before{content:""}.ri-wifi-off-line:before{content:""}.ri-window-2-fill:before{content:""}.ri-window-2-line:before{content:""}.ri-window-fill:before{content:""}.ri-window-line:before{content:""}.ri-windows-fill:before{content:""}.ri-windows-line:before{content:""}.ri-windy-fill:before{content:""}.ri-windy-line:before{content:""}.ri-wireless-charging-fill:before{content:""}.ri-wireless-charging-line:before{content:""}.ri-women-fill:before{content:""}.ri-women-line:before{content:""}.ri-wubi-input:before{content:""}.ri-xbox-fill:before{content:""}.ri-xbox-line:before{content:""}.ri-xing-fill:before{content:""}.ri-xing-line:before{content:""}.ri-youtube-fill:before{content:""}.ri-youtube-line:before{content:""}.ri-zcool-fill:before{content:""}.ri-zcool-line:before{content:""}.ri-zhihu-fill:before{content:""}.ri-zhihu-line:before{content:""}.ri-zoom-in-fill:before{content:""}.ri-zoom-in-line:before{content:""}.ri-zoom-out-fill:before{content:""}.ri-zoom-out-line:before{content:""}.ri-zzz-fill:before{content:""}.ri-zzz-line:before{content:""}.ri-arrow-down-double-fill:before{content:""}.ri-arrow-down-double-line:before{content:""}.ri-arrow-left-double-fill:before{content:""}.ri-arrow-left-double-line:before{content:""}.ri-arrow-right-double-fill:before{content:""}.ri-arrow-right-double-line:before{content:""}.ri-arrow-turn-back-fill:before{content:""}.ri-arrow-turn-back-line:before{content:""}.ri-arrow-turn-forward-fill:before{content:""}.ri-arrow-turn-forward-line:before{content:""}.ri-arrow-up-double-fill:before{content:""}.ri-arrow-up-double-line:before{content:""}.ri-bard-fill:before{content:""}.ri-bard-line:before{content:""}.ri-bootstrap-fill:before{content:""}.ri-bootstrap-line:before{content:""}.ri-box-1-fill:before{content:""}.ri-box-1-line:before{content:""}.ri-box-2-fill:before{content:""}.ri-box-2-line:before{content:""}.ri-box-3-fill:before{content:""}.ri-box-3-line:before{content:""}.ri-brain-fill:before{content:""}.ri-brain-line:before{content:""}.ri-candle-fill:before{content:""}.ri-candle-line:before{content:""}.ri-cash-fill:before{content:""}.ri-cash-line:before{content:""}.ri-contract-left-fill:before{content:""}.ri-contract-left-line:before{content:""}.ri-contract-left-right-fill:before{content:""}.ri-contract-left-right-line:before{content:""}.ri-contract-right-fill:before{content:""}.ri-contract-right-line:before{content:""}.ri-contract-up-down-fill:before{content:""}.ri-contract-up-down-line:before{content:""}.ri-copilot-fill:before{content:""}.ri-copilot-line:before{content:""}.ri-corner-down-left-fill:before{content:""}.ri-corner-down-left-line:before{content:""}.ri-corner-down-right-fill:before{content:""}.ri-corner-down-right-line:before{content:""}.ri-corner-left-down-fill:before{content:""}.ri-corner-left-down-line:before{content:""}.ri-corner-left-up-fill:before{content:""}.ri-corner-left-up-line:before{content:""}.ri-corner-right-down-fill:before{content:""}.ri-corner-right-down-line:before{content:""}.ri-corner-right-up-fill:before{content:""}.ri-corner-right-up-line:before{content:""}.ri-corner-up-left-double-fill:before{content:""}.ri-corner-up-left-double-line:before{content:""}.ri-corner-up-left-fill:before{content:""}.ri-corner-up-left-line:before{content:""}.ri-corner-up-right-double-fill:before{content:""}.ri-corner-up-right-double-line:before{content:""}.ri-corner-up-right-fill:before{content:""}.ri-corner-up-right-line:before{content:""}.ri-cross-fill:before{content:""}.ri-cross-line:before{content:""}.ri-edge-new-fill:before{content:""}.ri-edge-new-line:before{content:""}.ri-equal-fill:before{content:""}.ri-equal-line:before{content:""}.ri-expand-left-fill:before{content:""}.ri-expand-left-line:before{content:""}.ri-expand-left-right-fill:before{content:""}.ri-expand-left-right-line:before{content:""}.ri-expand-right-fill:before{content:""}.ri-expand-right-line:before{content:""}.ri-expand-up-down-fill:before{content:""}.ri-expand-up-down-line:before{content:""}.ri-flickr-fill:before{content:""}.ri-flickr-line:before{content:""}.ri-forward-10-fill:before{content:""}.ri-forward-10-line:before{content:""}.ri-forward-15-fill:before{content:""}.ri-forward-15-line:before{content:""}.ri-forward-30-fill:before{content:""}.ri-forward-30-line:before{content:""}.ri-forward-5-fill:before{content:""}.ri-forward-5-line:before{content:""}.ri-graduation-cap-fill:before{content:""}.ri-graduation-cap-line:before{content:""}.ri-home-office-fill:before{content:""}.ri-home-office-line:before{content:""}.ri-hourglass-2-fill:before{content:""}.ri-hourglass-2-line:before{content:""}.ri-hourglass-fill:before{content:""}.ri-hourglass-line:before{content:""}.ri-javascript-fill:before{content:""}.ri-javascript-line:before{content:""}.ri-loop-left-fill:before{content:""}.ri-loop-left-line:before{content:""}.ri-loop-right-fill:before{content:""}.ri-loop-right-line:before{content:""}.ri-memories-fill:before{content:""}.ri-memories-line:before{content:""}.ri-meta-fill:before{content:""}.ri-meta-line:before{content:""}.ri-microsoft-loop-fill:before{content:""}.ri-microsoft-loop-line:before{content:""}.ri-nft-fill:before{content:""}.ri-nft-line:before{content:""}.ri-notion-fill:before{content:""}.ri-notion-line:before{content:""}.ri-openai-fill:before{content:""}.ri-openai-line:before{content:""}.ri-overline:before{content:""}.ri-p2p-fill:before{content:""}.ri-p2p-line:before{content:""}.ri-presentation-fill:before{content:""}.ri-presentation-line:before{content:""}.ri-replay-10-fill:before{content:""}.ri-replay-10-line:before{content:""}.ri-replay-15-fill:before{content:""}.ri-replay-15-line:before{content:""}.ri-replay-30-fill:before{content:""}.ri-replay-30-line:before{content:""}.ri-replay-5-fill:before{content:""}.ri-replay-5-line:before{content:""}.ri-school-fill:before{content:""}.ri-school-line:before{content:""}.ri-shining-2-fill:before{content:""}.ri-shining-2-line:before{content:""}.ri-shining-fill:before{content:""}.ri-shining-line:before{content:""}.ri-sketching:before{content:""}.ri-skip-down-fill:before{content:""}.ri-skip-down-line:before{content:""}.ri-skip-left-fill:before{content:""}.ri-skip-left-line:before{content:""}.ri-skip-right-fill:before{content:""}.ri-skip-right-line:before{content:""}.ri-skip-up-fill:before{content:""}.ri-skip-up-line:before{content:""}.ri-slow-down-fill:before{content:""}.ri-slow-down-line:before{content:""}.ri-sparkling-2-fill:before{content:""}.ri-sparkling-2-line:before{content:""}.ri-sparkling-fill:before{content:""}.ri-sparkling-line:before{content:""}.ri-speak-fill:before{content:""}.ri-speak-line:before{content:""}.ri-speed-up-fill:before{content:""}.ri-speed-up-line:before{content:""}.ri-tiktok-fill:before{content:""}.ri-tiktok-line:before{content:""}.ri-token-swap-fill:before{content:""}.ri-token-swap-line:before{content:""}.ri-unpin-fill:before{content:""}.ri-unpin-line:before{content:""}.ri-wechat-channels-fill:before{content:""}.ri-wechat-channels-line:before{content:""}.ri-wordpress-fill:before{content:""}.ri-wordpress-line:before{content:""}.ri-blender-fill:before{content:""}.ri-blender-line:before{content:""}.ri-emoji-sticker-fill:before{content:""}.ri-emoji-sticker-line:before{content:""}.ri-git-close-pull-request-fill:before{content:""}.ri-git-close-pull-request-line:before{content:""}.ri-instance-fill:before{content:""}.ri-instance-line:before{content:""}.ri-megaphone-fill:before{content:""}.ri-megaphone-line:before{content:""}.ri-pass-expired-fill:before{content:""}.ri-pass-expired-line:before{content:""}.ri-pass-pending-fill:before{content:""}.ri-pass-pending-line:before{content:""}.ri-pass-valid-fill:before{content:""}.ri-pass-valid-line:before{content:""}.ri-ai-generate:before{content:""}.ri-calendar-close-fill:before{content:""}.ri-calendar-close-line:before{content:""}.ri-draggable:before{content:""}.ri-font-family:before{content:""}.ri-font-mono:before{content:""}.ri-font-sans-serif:before{content:""}.ri-font-sans:before{content:""}.ri-hard-drive-3-fill:before{content:""}.ri-hard-drive-3-line:before{content:""}.ri-kick-fill:before{content:""}.ri-kick-line:before{content:""}.ri-list-check-3:before{content:""}.ri-list-indefinite:before{content:""}.ri-list-ordered-2:before{content:""}.ri-list-radio:before{content:""}.ri-openbase-fill:before{content:""}.ri-openbase-line:before{content:""}.ri-planet-fill:before{content:""}.ri-planet-line:before{content:""}.ri-prohibited-fill:before{content:""}.ri-prohibited-line:before{content:""}.ri-quote-text:before{content:""}.ri-seo-fill:before{content:""}.ri-seo-line:before{content:""}.ri-slash-commands:before{content:""}.ri-archive-2-fill:before{content:""}.ri-archive-2-line:before{content:""}.ri-inbox-2-fill:before{content:""}.ri-inbox-2-line:before{content:""}.ri-shake-hands-fill:before{content:""}.ri-shake-hands-line:before{content:""}.ri-supabase-fill:before{content:""}.ri-supabase-line:before{content:""}.ri-water-percent-fill:before{content:""}.ri-water-percent-line:before{content:""}.ri-yuque-fill:before{content:""}.ri-yuque-line:before{content:""}.ri-crosshair-2-fill:before{content:""}.ri-crosshair-2-line:before{content:""}.ri-crosshair-fill:before{content:""}.ri-crosshair-line:before{content:""}.ri-file-close-fill:before{content:""}.ri-file-close-line:before{content:""}.ri-infinity-fill:before{content:""}.ri-infinity-line:before{content:""}.ri-rfid-fill:before{content:""}.ri-rfid-line:before{content:""}.ri-slash-commands-2:before{content:""}.ri-user-forbid-fill:before{content:""}.ri-user-forbid-line:before{content:""}.ri-beer-fill:before{content:""}.ri-beer-line:before{content:""}.ri-circle-fill:before{content:""}.ri-circle-line:before{content:""}.ri-dropdown-list:before{content:""}.ri-file-image-fill:before{content:""}.ri-file-image-line:before{content:""}.ri-file-pdf-2-fill:before{content:""}.ri-file-pdf-2-line:before{content:""}.ri-file-video-fill:before{content:""}.ri-file-video-line:before{content:""}.ri-folder-image-fill:before{content:""}.ri-folder-image-line:before{content:""}.ri-folder-video-fill:before{content:""}.ri-folder-video-line:before{content:""}.ri-hexagon-fill:before{content:""}.ri-hexagon-line:before{content:""}.ri-menu-search-fill:before{content:""}.ri-menu-search-line:before{content:""}.ri-octagon-fill:before{content:""}.ri-octagon-line:before{content:""}.ri-pentagon-fill:before{content:""}.ri-pentagon-line:before{content:""}.ri-rectangle-fill:before{content:""}.ri-rectangle-line:before{content:""}.ri-robot-2-fill:before{content:""}.ri-robot-2-line:before{content:""}.ri-shapes-fill:before{content:""}.ri-shapes-line:before{content:""}.ri-square-fill:before{content:""}.ri-square-line:before{content:""}.ri-tent-fill:before{content:""}.ri-tent-line:before{content:""}.ri-threads-fill:before{content:""}.ri-threads-line:before{content:""}.ri-tree-fill:before{content:""}.ri-tree-line:before{content:""}.ri-triangle-fill:before{content:""}.ri-triangle-line:before{content:""}.ri-twitter-x-fill:before{content:""}.ri-twitter-x-line:before{content:""}.ri-verified-badge-fill:before{content:""}.ri-verified-badge-line:before{content:""}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes expand{0%{transform:rotateY(90deg)}to{opacity:1;transform:rotateY(0)}}@keyframes slideIn{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeIn{0%{opacity:0;visibility:hidden}to{opacity:1;visibility:visible}}@keyframes shine{to{background-position-x:-200%}}@keyframes loaderShow{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes entranceLeft{0%{opacity:0;transform:translate(-5px)}to{opacity:1;transform:translate(0)}}@keyframes entranceRight{0%{opacity:0;transform:translate(5px)}to{opacity:1;transform:translate(0)}}@keyframes entranceTop{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}@keyframes entranceBottom{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@media screen and (min-width: 550px){::-webkit-scrollbar{width:8px;height:8px;border-radius:var(--baseRadius)}::-webkit-scrollbar-track{background:transparent;border-radius:var(--baseRadius)}::-webkit-scrollbar-thumb{background-color:var(--baseAlt2Color);border-radius:15px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-thumb:hover,::-webkit-scrollbar-thumb:active{background-color:var(--baseAlt3Color)}html{scrollbar-color:var(--baseAlt2Color) transparent;scrollbar-width:thin;scroll-behavior:smooth}html *{scrollbar-width:inherit}}:focus-visible{outline-color:var(--primaryColor);outline-style:solid}html,body{line-height:var(--baseLineHeight);font-family:var(--baseFontFamily);font-size:var(--baseFontSize);color:var(--txtPrimaryColor);background:var(--bodyColor)}#app{overflow:auto;display:block;width:100%;height:100vh}.schema-field,.flatpickr-inline-container,.accordion .accordion-content,.accordion,.tabs,.tabs-content,.select .txt-missing,.form-field .form-field-block,.list,.skeleton-loader,.clearfix,.content,.form-field .help-block,.overlay-panel .panel-content,.sub-panel,.panel,.block,.code-block,blockquote,p{display:block;width:100%}h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6{margin:0;font-weight:400}h1{font-size:22px;line-height:28px}h2,.breadcrumbs .breadcrumb-item{font-size:20px;line-height:26px}h3{font-size:19px;line-height:24px}h4{font-size:18px;line-height:24px}h5{font-size:17px;line-height:24px}h6{font-size:16px;line-height:22px}em{font-style:italic}ins{color:var(--txtPrimaryColor);background:var(--successAltColor);text-decoration:none}del{color:var(--txtPrimaryColor);background:var(--dangerAltColor);text-decoration:none}strong{font-weight:600}small{font-size:var(--smFontSize);line-height:var(--smLineHeight)}sub,sup{position:relative;font-size:.75em;line-height:1}sup{vertical-align:top}sub{vertical-align:bottom}p{margin:5px 0}blockquote{position:relative;padding-left:var(--smSpacing);font-style:italic;color:var(--txtHintColor)}blockquote:before{content:"";position:absolute;top:0;left:0;width:2px;height:100%;background:var(--baseColor)}code{display:inline-block;font-family:var(--monospaceFontFamily);font-style:normal;font-size:1em;line-height:1.379rem;padding:0 4px;white-space:nowrap;color:inherit;background:var(--baseAlt2Color);border-radius:var(--baseRadius)}.code-block{overflow:auto;padding:var(--xsSpacing);white-space:pre-wrap;background:var(--baseAlt1Color)}ol,ul{margin:10px 0;list-style:decimal;padding-left:var(--baseSpacing)}ol li,ul li{margin-top:5px;margin-bottom:5px}ul{list-style:disc}img{max-width:100%;vertical-align:top}hr{display:block;border:0;height:1px;width:100%;background:var(--baseAlt1Color);margin:var(--baseSpacing) 0}hr.dark{background:var(--baseAlt2Color)}a{color:inherit}a:hover{text-decoration:none}a i,a .txt{display:inline-block;vertical-align:top}.txt-mono{font-family:var(--monospaceFontFamily)}.txt-nowrap{white-space:nowrap}.txt-ellipsis{display:inline-block;vertical-align:top;flex-shrink:1;min-width:0;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.txt-base{font-size:var(--baseFontSize)!important}.txt-xs{font-size:var(--xsFontSize)!important;line-height:var(--smLineHeight)}.txt-sm{font-size:var(--smFontSize)!important;line-height:var(--smLineHeight)}.txt-lg{font-size:var(--lgFontSize)!important}.txt-xl{font-size:var(--xlFontSize)!important}.txt-bold{font-weight:600!important}.txt-strikethrough{text-decoration:line-through!important}.txt-break{white-space:pre-wrap!important}.txt-center{text-align:center!important}.txt-justify{text-align:justify!important}.txt-left{text-align:left!important}.txt-right{text-align:right!important}.txt-main{color:var(--txtPrimaryColor)!important}.txt-hint{color:var(--txtHintColor)!important}.txt-disabled{color:var(--txtDisabledColor)!important}.link-hint{-webkit-user-select:none;user-select:none;cursor:pointer;color:var(--txtHintColor)!important;text-decoration:none;transition:color var(--baseAnimationSpeed)}.link-hint:hover,.link-hint:focus-visible,.link-hint:active{color:var(--txtPrimaryColor)!important}.link-fade{opacity:1;-webkit-user-select:none;user-select:none;cursor:pointer;text-decoration:none;color:var(--txtPrimaryColor);transition:opacity var(--baseAnimationSpeed)}.link-fade:focus-visible,.link-fade:hover,.link-fade:active{opacity:.8}.txt-primary{color:var(--primaryColor)!important}.bg-primary{background:var(--primaryColor)!important}.link-primary{cursor:pointer;color:var(--primaryColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-primary:focus-visible,.link-primary:hover,.link-primary:active{opacity:.8}.txt-info{color:var(--infoColor)!important}.bg-info{background:var(--infoColor)!important}.link-info{cursor:pointer;color:var(--infoColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-info:focus-visible,.link-info:hover,.link-info:active{opacity:.8}.txt-info-alt{color:var(--infoAltColor)!important}.bg-info-alt{background:var(--infoAltColor)!important}.link-info-alt{cursor:pointer;color:var(--infoAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-info-alt:focus-visible,.link-info-alt:hover,.link-info-alt:active{opacity:.8}.txt-success{color:var(--successColor)!important}.bg-success{background:var(--successColor)!important}.link-success{cursor:pointer;color:var(--successColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-success:focus-visible,.link-success:hover,.link-success:active{opacity:.8}.txt-success-alt{color:var(--successAltColor)!important}.bg-success-alt{background:var(--successAltColor)!important}.link-success-alt{cursor:pointer;color:var(--successAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-success-alt:focus-visible,.link-success-alt:hover,.link-success-alt:active{opacity:.8}.txt-danger{color:var(--dangerColor)!important}.bg-danger{background:var(--dangerColor)!important}.link-danger{cursor:pointer;color:var(--dangerColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-danger:focus-visible,.link-danger:hover,.link-danger:active{opacity:.8}.txt-danger-alt{color:var(--dangerAltColor)!important}.bg-danger-alt{background:var(--dangerAltColor)!important}.link-danger-alt{cursor:pointer;color:var(--dangerAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-danger-alt:focus-visible,.link-danger-alt:hover,.link-danger-alt:active{opacity:.8}.txt-warning{color:var(--warningColor)!important}.bg-warning{background:var(--warningColor)!important}.link-warning{cursor:pointer;color:var(--warningColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-warning:focus-visible,.link-warning:hover,.link-warning:active{opacity:.8}.txt-warning-alt{color:var(--warningAltColor)!important}.bg-warning-alt{background:var(--warningAltColor)!important}.link-warning-alt{cursor:pointer;color:var(--warningAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-warning-alt:focus-visible,.link-warning-alt:hover,.link-warning-alt:active{opacity:.8}.fade{opacity:.6}a.fade,.btn.fade,[tabindex].fade,[class*=link-].fade,.handle.fade{transition:all var(--baseAnimationSpeed)}a.fade:hover,.btn.fade:hover,[tabindex].fade:hover,[class*=link-].fade:hover,.handle.fade:hover{opacity:1}.noborder{border:0px!important}.hidden{display:none!important}.hidden-empty:empty{display:none!important}.v-align-top{vertical-align:top}.v-align-middle{vertical-align:middle}.v-align-bottom{vertical-align:bottom}.scrollbar-gutter-stable{scrollbar-gutter:stable}.no-pointer-events{pointer-events:none}.content,.form-field .help-block,.overlay-panel .panel-content,.sub-panel,.panel{min-width:0}.content>:first-child,.form-field .help-block>:first-child,.overlay-panel .panel-content>:first-child,.sub-panel>:first-child,.panel>:first-child{margin-top:0}.content>:last-child,.form-field .help-block>:last-child,.overlay-panel .panel-content>:last-child,.sub-panel>:last-child,.panel>:last-child{margin-bottom:0}.panel{background:var(--baseColor);border-radius:var(--lgRadius);padding:calc(var(--baseSpacing) - 5px) var(--baseSpacing);box-shadow:0 2px 5px 0 var(--shadowColor)}.sub-panel{background:var(--baseColor);border-radius:var(--baseRadius);padding:calc(var(--smSpacing) - 5px) var(--smSpacing);border:1px solid var(--baseAlt1Color)}.shadowize{box-shadow:0 2px 5px 0 var(--shadowColor)}.clearfix{clear:both}.clearfix:after{content:"";display:table;clear:both}.flex{position:relative;display:flex;align-items:center;width:100%;min-width:0;gap:var(--smSpacing)}.flex-fill{flex:1 1 auto!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.inline-flex{position:relative;display:inline-flex;vertical-align:top;align-items:center;flex-wrap:wrap;min-width:0;gap:10px}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-gap-base{gap:var(--baseSpacing)!important}.flex-gap-xs{gap:var(--xsSpacing)!important}.flex-gap-sm{gap:var(--smSpacing)!important}.flex-gap-lg{gap:var(--lgSpacing)!important}.flex-gap-xl{gap:var(--xlSpacing)!important}.flex-gap-0{gap:0px!important}.flex-gap-5{gap:5px!important}.flex-gap-10{gap:10px!important}.flex-gap-15{gap:15px!important}.flex-gap-20{gap:20px!important}.flex-gap-25{gap:25px!important}.flex-gap-30{gap:30px!important}.flex-gap-35{gap:35px!important}.flex-gap-40{gap:40px!important}.flex-gap-45{gap:45px!important}.flex-gap-50{gap:50px!important}.flex-gap-55{gap:55px!important}.flex-gap-60{gap:60px!important}.m-base{margin:var(--baseSpacing)!important}.p-base{padding:var(--baseSpacing)!important}.m-xs{margin:var(--xsSpacing)!important}.p-xs{padding:var(--xsSpacing)!important}.m-sm{margin:var(--smSpacing)!important}.p-sm{padding:var(--smSpacing)!important}.m-lg{margin:var(--lgSpacing)!important}.p-lg{padding:var(--lgSpacing)!important}.m-xl{margin:var(--xlSpacing)!important}.p-xl{padding:var(--xlSpacing)!important}.m-t-auto{margin-top:auto!important}.p-t-auto{padding-top:auto!important}.m-t-base{margin-top:var(--baseSpacing)!important}.p-t-base{padding-top:var(--baseSpacing)!important}.m-t-xs{margin-top:var(--xsSpacing)!important}.p-t-xs{padding-top:var(--xsSpacing)!important}.m-t-sm{margin-top:var(--smSpacing)!important}.p-t-sm{padding-top:var(--smSpacing)!important}.m-t-lg{margin-top:var(--lgSpacing)!important}.p-t-lg{padding-top:var(--lgSpacing)!important}.m-t-xl{margin-top:var(--xlSpacing)!important}.p-t-xl{padding-top:var(--xlSpacing)!important}.m-r-auto{margin-right:auto!important}.p-r-auto{padding-right:auto!important}.m-r-base{margin-right:var(--baseSpacing)!important}.p-r-base{padding-right:var(--baseSpacing)!important}.m-r-xs{margin-right:var(--xsSpacing)!important}.p-r-xs{padding-right:var(--xsSpacing)!important}.m-r-sm{margin-right:var(--smSpacing)!important}.p-r-sm{padding-right:var(--smSpacing)!important}.m-r-lg{margin-right:var(--lgSpacing)!important}.p-r-lg{padding-right:var(--lgSpacing)!important}.m-r-xl{margin-right:var(--xlSpacing)!important}.p-r-xl{padding-right:var(--xlSpacing)!important}.m-b-auto{margin-bottom:auto!important}.p-b-auto{padding-bottom:auto!important}.m-b-base{margin-bottom:var(--baseSpacing)!important}.p-b-base{padding-bottom:var(--baseSpacing)!important}.m-b-xs{margin-bottom:var(--xsSpacing)!important}.p-b-xs{padding-bottom:var(--xsSpacing)!important}.m-b-sm{margin-bottom:var(--smSpacing)!important}.p-b-sm{padding-bottom:var(--smSpacing)!important}.m-b-lg{margin-bottom:var(--lgSpacing)!important}.p-b-lg{padding-bottom:var(--lgSpacing)!important}.m-b-xl{margin-bottom:var(--xlSpacing)!important}.p-b-xl{padding-bottom:var(--xlSpacing)!important}.m-l-auto{margin-left:auto!important}.p-l-auto{padding-left:auto!important}.m-l-base{margin-left:var(--baseSpacing)!important}.p-l-base{padding-left:var(--baseSpacing)!important}.m-l-xs{margin-left:var(--xsSpacing)!important}.p-l-xs{padding-left:var(--xsSpacing)!important}.m-l-sm{margin-left:var(--smSpacing)!important}.p-l-sm{padding-left:var(--smSpacing)!important}.m-l-lg{margin-left:var(--lgSpacing)!important}.p-l-lg{padding-left:var(--lgSpacing)!important}.m-l-xl{margin-left:var(--xlSpacing)!important}.p-l-xl{padding-left:var(--xlSpacing)!important}.m-0{margin:0!important}.p-0{padding:0!important}.m-t-0{margin-top:0!important}.p-t-0{padding-top:0!important}.m-r-0{margin-right:0!important}.p-r-0{padding-right:0!important}.m-b-0{margin-bottom:0!important}.p-b-0{padding-bottom:0!important}.m-l-0{margin-left:0!important}.p-l-0{padding-left:0!important}.m-5{margin:5px!important}.p-5{padding:5px!important}.m-t-5{margin-top:5px!important}.p-t-5{padding-top:5px!important}.m-r-5{margin-right:5px!important}.p-r-5{padding-right:5px!important}.m-b-5{margin-bottom:5px!important}.p-b-5{padding-bottom:5px!important}.m-l-5{margin-left:5px!important}.p-l-5{padding-left:5px!important}.m-10{margin:10px!important}.p-10{padding:10px!important}.m-t-10{margin-top:10px!important}.p-t-10{padding-top:10px!important}.m-r-10{margin-right:10px!important}.p-r-10{padding-right:10px!important}.m-b-10{margin-bottom:10px!important}.p-b-10{padding-bottom:10px!important}.m-l-10{margin-left:10px!important}.p-l-10{padding-left:10px!important}.m-15{margin:15px!important}.p-15{padding:15px!important}.m-t-15{margin-top:15px!important}.p-t-15{padding-top:15px!important}.m-r-15{margin-right:15px!important}.p-r-15{padding-right:15px!important}.m-b-15{margin-bottom:15px!important}.p-b-15{padding-bottom:15px!important}.m-l-15{margin-left:15px!important}.p-l-15{padding-left:15px!important}.m-20{margin:20px!important}.p-20{padding:20px!important}.m-t-20{margin-top:20px!important}.p-t-20{padding-top:20px!important}.m-r-20{margin-right:20px!important}.p-r-20{padding-right:20px!important}.m-b-20{margin-bottom:20px!important}.p-b-20{padding-bottom:20px!important}.m-l-20{margin-left:20px!important}.p-l-20{padding-left:20px!important}.m-25{margin:25px!important}.p-25{padding:25px!important}.m-t-25{margin-top:25px!important}.p-t-25{padding-top:25px!important}.m-r-25{margin-right:25px!important}.p-r-25{padding-right:25px!important}.m-b-25{margin-bottom:25px!important}.p-b-25{padding-bottom:25px!important}.m-l-25{margin-left:25px!important}.p-l-25{padding-left:25px!important}.m-30{margin:30px!important}.p-30{padding:30px!important}.m-t-30{margin-top:30px!important}.p-t-30{padding-top:30px!important}.m-r-30{margin-right:30px!important}.p-r-30{padding-right:30px!important}.m-b-30{margin-bottom:30px!important}.p-b-30{padding-bottom:30px!important}.m-l-30{margin-left:30px!important}.p-l-30{padding-left:30px!important}.m-35{margin:35px!important}.p-35{padding:35px!important}.m-t-35{margin-top:35px!important}.p-t-35{padding-top:35px!important}.m-r-35{margin-right:35px!important}.p-r-35{padding-right:35px!important}.m-b-35{margin-bottom:35px!important}.p-b-35{padding-bottom:35px!important}.m-l-35{margin-left:35px!important}.p-l-35{padding-left:35px!important}.m-40{margin:40px!important}.p-40{padding:40px!important}.m-t-40{margin-top:40px!important}.p-t-40{padding-top:40px!important}.m-r-40{margin-right:40px!important}.p-r-40{padding-right:40px!important}.m-b-40{margin-bottom:40px!important}.p-b-40{padding-bottom:40px!important}.m-l-40{margin-left:40px!important}.p-l-40{padding-left:40px!important}.m-45{margin:45px!important}.p-45{padding:45px!important}.m-t-45{margin-top:45px!important}.p-t-45{padding-top:45px!important}.m-r-45{margin-right:45px!important}.p-r-45{padding-right:45px!important}.m-b-45{margin-bottom:45px!important}.p-b-45{padding-bottom:45px!important}.m-l-45{margin-left:45px!important}.p-l-45{padding-left:45px!important}.m-50{margin:50px!important}.p-50{padding:50px!important}.m-t-50{margin-top:50px!important}.p-t-50{padding-top:50px!important}.m-r-50{margin-right:50px!important}.p-r-50{padding-right:50px!important}.m-b-50{margin-bottom:50px!important}.p-b-50{padding-bottom:50px!important}.m-l-50{margin-left:50px!important}.p-l-50{padding-left:50px!important}.m-55{margin:55px!important}.p-55{padding:55px!important}.m-t-55{margin-top:55px!important}.p-t-55{padding-top:55px!important}.m-r-55{margin-right:55px!important}.p-r-55{padding-right:55px!important}.m-b-55{margin-bottom:55px!important}.p-b-55{padding-bottom:55px!important}.m-l-55{margin-left:55px!important}.p-l-55{padding-left:55px!important}.m-60{margin:60px!important}.p-60{padding:60px!important}.m-t-60{margin-top:60px!important}.p-t-60{padding-top:60px!important}.m-r-60{margin-right:60px!important}.p-r-60{padding-right:60px!important}.m-b-60{margin-bottom:60px!important}.p-b-60{padding-bottom:60px!important}.m-l-60{margin-left:60px!important}.p-l-60{padding-left:60px!important}.no-min-width{min-width:0!important}.wrapper{position:relative;width:var(--wrapperWidth);margin:0 auto;max-width:100%}.wrapper.wrapper-sm{width:var(--smWrapperWidth)}.wrapper.wrapper-lg{width:var(--lgWrapperWidth)}.label{--labelVPadding: 3px;--labelHPadding: 9px;display:inline-flex;align-items:center;justify-content:center;vertical-align:top;gap:5px;padding:var(--labelVPadding) var(--labelHPadding);min-height:24px;max-width:100%;text-align:center;line-height:var(--smLineHeight);font-size:var(--smFontSize);background:var(--baseAlt2Color);color:var(--txtPrimaryColor);white-space:nowrap;border-radius:30px}.label .btn:last-child{margin-right:calc(-.5 * var(--labelHPadding))}.label .btn:first-child{margin-left:calc(-.5 * var(--labelHPadding))}.label.label-sm{--labelHPadding: 5px;font-size:var(--xsFontSize);min-height:18px;line-height:1}.label.label-primary{color:var(--baseColor);background:var(--primaryColor)}.label.label-info{background:var(--infoAltColor)}.label.label-success{background:var(--successAltColor)}.label.label-danger{background:var(--dangerAltColor)}.label.label-warning{background:var(--warningAltColor)}.thumb{--thumbSize: 40px;display:inline-flex;vertical-align:top;position:relative;flex-shrink:0;align-items:center;justify-content:center;line-height:1;width:var(--thumbSize);height:var(--thumbSize);aspect-ratio:1;background:var(--baseAlt2Color);border-radius:var(--baseRadius);color:var(--txtPrimaryColor);outline-offset:-2px;outline:2px solid transparent;box-shadow:0 2px 5px 0 var(--shadowColor)}.thumb i{font-size:inherit}.thumb img{width:100%;height:100%;border-radius:inherit;overflow:hidden}.thumb.thumb-xs{--thumbSize: 24px;font-size:.85rem}.thumb.thumb-sm{--thumbSize: 32px;font-size:.92rem}.thumb.thumb-lg{--thumbSize: 60px;font-size:1.3rem}.thumb.thumb-xl{--thumbSize: 80px;font-size:1.5rem}.thumb.thumb-circle{border-radius:50%}.thumb.thumb-primary{outline-color:var(--primaryColor)}.thumb.thumb-info{outline-color:var(--infoColor)}.thumb.thumb-info-alt{outline-color:var(--infoAltColor)}.thumb.thumb-success{outline-color:var(--successColor)}.thumb.thumb-success-alt{outline-color:var(--successAltColor)}.thumb.thumb-danger{outline-color:var(--dangerColor)}.thumb.thumb-danger-alt{outline-color:var(--dangerAltColor)}.thumb.thumb-warning{outline-color:var(--warningColor)}.thumb.thumb-warning-alt{outline-color:var(--warningAltColor)}.handle.thumb:not(.thumb-active),a.thumb:not(.thumb-active){cursor:pointer;transition:opacity var(--baseAnimationSpeed),outline-color var(--baseAnimationSpeed),transform var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.handle.thumb:not(.thumb-active):hover,.handle.thumb:not(.thumb-active):focus-visible,.handle.thumb:not(.thumb-active):active,a.thumb:not(.thumb-active):hover,a.thumb:not(.thumb-active):focus-visible,a.thumb:not(.thumb-active):active{opacity:.8;box-shadow:0 2px 5px 0 var(--shadowColor),0 2px 4px 1px var(--shadowColor)}.handle.thumb:not(.thumb-active):active,a.thumb:not(.thumb-active):active{transition-duration:var(--activeAnimationSpeed);transform:scale(.97)}.section-title{display:flex;align-items:center;width:100%;column-gap:10px;row-gap:5px;margin:0 0 var(--xsSpacing);font-weight:600;font-size:var(--baseFontSize);line-height:var(--smLineHeight);color:var(--txtHintColor)}.logo{position:relative;vertical-align:top;display:inline-flex;align-items:center;gap:10px;font-size:23px;text-decoration:none;color:inherit;-webkit-user-select:none;user-select:none}.logo strong{font-weight:700}.logo .version{position:absolute;right:0;top:-5px;line-height:1;font-size:10px;font-weight:400;padding:2px 4px;border-radius:var(--baseRadius);background:var(--dangerAltColor);color:var(--txtPrimaryColor)}.logo.logo-sm{font-size:20px}.drag-handle{position:relative;display:inline-flex;align-items:center;justify-content:center;text-align:center;flex-shrink:0;color:var(--txtDisabledColor);-webkit-user-select:none;user-select:none;cursor:pointer;transition:color var(--baseAnimationSpeed),transform var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed),visibility var(--baseAnimationSpeed)}.drag-handle:before{content:"";line-height:1;font-family:var(--iconFontFamily);padding-right:5px;text-shadow:5px 0px currentColor}.drag-handle:hover,.drag-handle:focus-visible{color:var(--txtHintColor)}.drag-handle:active{transition-duration:var(--activeAnimationSpeed);color:var(--txtPrimaryColor)}.loader{--loaderSize: 32px;position:relative;display:inline-flex;vertical-align:top;flex-direction:column;align-items:center;justify-content:center;row-gap:10px;margin:0;color:var(--txtDisabledColor);text-align:center;font-weight:400}.loader:before{content:"";display:inline-block;vertical-align:top;clear:both;width:var(--loaderSize);height:var(--loaderSize);line-height:var(--loaderSize);font-size:var(--loaderSize);font-weight:400;font-family:var(--iconFontFamily);color:inherit;text-align:center;animation:loaderShow var(--activeAnimationSpeed),rotate .9s var(--baseAnimationSpeed) infinite linear}.loader.loader-primary{color:var(--primaryColor)}.loader.loader-info{color:var(--infoColor)}.loader.loader-info-alt{color:var(--infoAltColor)}.loader.loader-success{color:var(--successColor)}.loader.loader-success-alt{color:var(--successAltColor)}.loader.loader-danger{color:var(--dangerColor)}.loader.loader-danger-alt{color:var(--dangerAltColor)}.loader.loader-warning{color:var(--warningColor)}.loader.loader-warning-alt{color:var(--warningAltColor)}.loader.loader-xs{--loaderSize: 18px}.loader.loader-sm{--loaderSize: 24px}.loader.loader-lg{--loaderSize: 42px}.skeleton-loader{position:relative;height:12px;margin:5px 0;border-radius:var(--baseRadius);background:var(--baseAlt1Color);animation:fadeIn .4s}.skeleton-loader:before{content:"";width:100%;height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,var(--baseAlt1Color) 8%,var(--bodyColor) 18%,var(--baseAlt1Color) 33%);background-size:200% 100%;animation:shine 1s linear infinite}.placeholder-section{display:flex;width:100%;align-items:center;justify-content:center;text-align:center;flex-direction:column;gap:var(--smSpacing);color:var(--txtHintColor)}.placeholder-section .icon{font-size:50px;height:50px;line-height:1;opacity:.3}.placeholder-section .icon i{font-size:inherit;vertical-align:top}.list{position:relative;overflow:auto;overflow:overlay;border:1px solid var(--baseAlt2Color);border-radius:var(--baseRadius)}.list .list-item{word-break:break-word;position:relative;display:flex;align-items:center;width:100%;gap:var(--xsSpacing);outline:0;padding:10px var(--xsSpacing);min-height:50px;border-top:1px solid var(--baseAlt2Color);transition:background var(--baseAnimationSpeed)}.list .list-item:first-child{border-top:0}.list .list-item:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.list .list-item .content,.list .list-item .form-field .help-block,.form-field .list .list-item .help-block,.list .list-item .overlay-panel .panel-content,.overlay-panel .list .list-item .panel-content,.list .list-item .panel,.list .list-item .sub-panel{display:flex;align-items:center;gap:5px;min-width:0;max-width:100%;-webkit-user-select:text;user-select:text}.list .list-item .actions{gap:10px;flex-shrink:0;display:inline-flex;align-items:center;margin:-1px -5px -1px 0}.list .list-item .actions.nonintrusive{opacity:0;transform:translate(5px);transition:transform var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed),visibility var(--baseAnimationSpeed)}.list .list-item:hover,.list .list-item:focus-visible,.list .list-item:focus-within,.list .list-item:active{background:var(--bodyColor)}.list .list-item:hover .actions.nonintrusive,.list .list-item:focus-visible .actions.nonintrusive,.list .list-item:focus-within .actions.nonintrusive,.list .list-item:active .actions.nonintrusive{opacity:1;transform:translate(0)}.list .list-item.selected{background:var(--bodyColor)}.list .list-item.handle:not(.disabled){cursor:pointer;-webkit-user-select:none;user-select:none}.list .list-item.handle:not(.disabled):hover,.list .list-item.handle:not(.disabled):focus-visible{background:var(--baseAlt1Color)}.list .list-item.handle:not(.disabled):active{background:var(--baseAlt2Color)}.list .list-item.disabled:not(.selected){cursor:default;opacity:.6}.list .list-item-placeholder{color:var(--txtHintColor)}.list .list-item-btn{padding:5px;min-height:auto}.list .list-item-placeholder:hover,.list .list-item-placeholder:focus-visible,.list .list-item-placeholder:focus-within,.list .list-item-placeholder:active,.list .list-item-btn:hover,.list .list-item-btn:focus-visible,.list .list-item-btn:focus-within,.list .list-item-btn:active{background:none}.list.list-compact .list-item{gap:10px;min-height:40px}.entrance-top{animation:entranceTop var(--entranceAnimationSpeed)}.entrance-bottom{animation:entranceBottom var(--entranceAnimationSpeed)}.entrance-left{animation:entranceLeft var(--entranceAnimationSpeed)}.entrance-right{animation:entranceRight var(--entranceAnimationSpeed)}.entrance-fade{animation:fadeIn var(--entranceAnimationSpeed)}.provider-logo{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;border-radius:var(--baseRadius);background:var(--bodyColor);padding:0;gap:0}.provider-logo img{max-width:20px;max-height:20px;height:auto;flex-shrink:0}.provider-card{display:flex;align-items:center;width:100%;height:100%;gap:10px;padding:10px;border-radius:var(--baseRadius);border:1px solid var(--baseAlt1Color)}.sidebar-menu{--sidebarListItemMargin: 10px;z-index:0;display:flex;flex-direction:column;width:200px;flex-shrink:0;flex-grow:0;overflow-x:hidden;overflow-y:auto;background:var(--baseColor);padding:calc(var(--baseSpacing) - 5px) 0 var(--smSpacing)}.sidebar-menu>*{padding:0 var(--smSpacing)}.sidebar-menu .sidebar-content{overflow-x:hidden;overflow-y:auto;overflow-y:overlay}.sidebar-menu .sidebar-content>:first-child{margin-top:0}.sidebar-menu .sidebar-content>:last-child{margin-bottom:0}.sidebar-menu .sidebar-footer{margin-top:var(--smSpacing)}.sidebar-menu .search{display:flex;align-items:center;width:auto;column-gap:5px;margin:0 0 var(--xsSpacing);color:var(--txtHintColor);opacity:.7;transition:opacity var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.sidebar-menu .search input{border:0;background:var(--baseColor);transition:box-shadow var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.sidebar-menu .search .btn-clear{margin-right:-8px}.sidebar-menu .search:hover,.sidebar-menu .search:focus-within,.sidebar-menu .search.active{opacity:1;color:var(--txtPrimaryColor)}.sidebar-menu .search:hover input,.sidebar-menu .search:focus-within input,.sidebar-menu .search.active input{background:var(--baseAlt2Color)}.sidebar-menu .sidebar-title{display:flex;align-items:center;gap:5px;width:100%;margin:var(--baseSpacing) 0 var(--xsSpacing);font-weight:600;font-size:1rem;line-height:var(--smLineHeight);color:var(--txtHintColor)}.sidebar-menu .sidebar-title .label{font-weight:400}.sidebar-menu .sidebar-list-item{cursor:pointer;outline:0;text-decoration:none;position:relative;display:flex;width:100%;align-items:center;column-gap:10px;margin:var(--sidebarListItemMargin) 0;padding:3px 10px;font-size:var(--xlFontSize);min-height:var(--btnHeight);min-width:0;color:var(--txtHintColor);border-radius:var(--baseRadius);-webkit-user-select:none;user-select:none;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.sidebar-menu .sidebar-list-item i{font-size:18px}.sidebar-menu .sidebar-list-item .txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-menu .sidebar-list-item:focus-visible,.sidebar-menu .sidebar-list-item:hover,.sidebar-menu .sidebar-list-item:active,.sidebar-menu .sidebar-list-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.sidebar-menu .sidebar-list-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.sidebar-menu .sidebar-content-compact .sidebar-list-item{--sidebarListItemMargin: 5px}@media screen and (max-height: 600px){.sidebar-menu{--sidebarListItemMargin: 5px}}@media screen and (max-width: 1100px){.sidebar-menu{min-width:190px}.sidebar-menu>*{padding-left:10px;padding-right:10px}}.grid{--gridGap: var(--baseSpacing);position:relative;display:flex;flex-grow:1;flex-wrap:wrap;row-gap:var(--gridGap);margin:0 calc(-.5 * var(--gridGap))}.grid.grid-center{align-items:center}.grid.grid-sm{--gridGap: var(--smSpacing)}.grid .form-field{margin-bottom:0}.grid>*{margin:0 calc(.5 * var(--gridGap))}.col-xxl-1,.col-xxl-2,.col-xxl-3,.col-xxl-4,.col-xxl-5,.col-xxl-6,.col-xxl-7,.col-xxl-8,.col-xxl-9,.col-xxl-10,.col-xxl-11,.col-xxl-12,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12{position:relative;width:100%;min-height:1px}.col-auto{flex:0 0 auto;width:auto}.col-12{width:calc(100% - var(--gridGap))}.col-11{width:calc(91.6666666667% - var(--gridGap))}.col-10{width:calc(83.3333333333% - var(--gridGap))}.col-9{width:calc(75% - var(--gridGap))}.col-8{width:calc(66.6666666667% - var(--gridGap))}.col-7{width:calc(58.3333333333% - var(--gridGap))}.col-6{width:calc(50% - var(--gridGap))}.col-5{width:calc(41.6666666667% - var(--gridGap))}.col-4{width:calc(33.3333333333% - var(--gridGap))}.col-3{width:calc(25% - var(--gridGap))}.col-2{width:calc(16.6666666667% - var(--gridGap))}.col-1{width:calc(8.3333333333% - var(--gridGap))}@media (min-width: 576px){.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-12{width:calc(100% - var(--gridGap))}.col-sm-11{width:calc(91.6666666667% - var(--gridGap))}.col-sm-10{width:calc(83.3333333333% - var(--gridGap))}.col-sm-9{width:calc(75% - var(--gridGap))}.col-sm-8{width:calc(66.6666666667% - var(--gridGap))}.col-sm-7{width:calc(58.3333333333% - var(--gridGap))}.col-sm-6{width:calc(50% - var(--gridGap))}.col-sm-5{width:calc(41.6666666667% - var(--gridGap))}.col-sm-4{width:calc(33.3333333333% - var(--gridGap))}.col-sm-3{width:calc(25% - var(--gridGap))}.col-sm-2{width:calc(16.6666666667% - var(--gridGap))}.col-sm-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 768px){.col-md-auto{flex:0 0 auto;width:auto}.col-md-12{width:calc(100% - var(--gridGap))}.col-md-11{width:calc(91.6666666667% - var(--gridGap))}.col-md-10{width:calc(83.3333333333% - var(--gridGap))}.col-md-9{width:calc(75% - var(--gridGap))}.col-md-8{width:calc(66.6666666667% - var(--gridGap))}.col-md-7{width:calc(58.3333333333% - var(--gridGap))}.col-md-6{width:calc(50% - var(--gridGap))}.col-md-5{width:calc(41.6666666667% - var(--gridGap))}.col-md-4{width:calc(33.3333333333% - var(--gridGap))}.col-md-3{width:calc(25% - var(--gridGap))}.col-md-2{width:calc(16.6666666667% - var(--gridGap))}.col-md-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 992px){.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-12{width:calc(100% - var(--gridGap))}.col-lg-11{width:calc(91.6666666667% - var(--gridGap))}.col-lg-10{width:calc(83.3333333333% - var(--gridGap))}.col-lg-9{width:calc(75% - var(--gridGap))}.col-lg-8{width:calc(66.6666666667% - var(--gridGap))}.col-lg-7{width:calc(58.3333333333% - var(--gridGap))}.col-lg-6{width:calc(50% - var(--gridGap))}.col-lg-5{width:calc(41.6666666667% - var(--gridGap))}.col-lg-4{width:calc(33.3333333333% - var(--gridGap))}.col-lg-3{width:calc(25% - var(--gridGap))}.col-lg-2{width:calc(16.6666666667% - var(--gridGap))}.col-lg-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 1200px){.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-12{width:calc(100% - var(--gridGap))}.col-xl-11{width:calc(91.6666666667% - var(--gridGap))}.col-xl-10{width:calc(83.3333333333% - var(--gridGap))}.col-xl-9{width:calc(75% - var(--gridGap))}.col-xl-8{width:calc(66.6666666667% - var(--gridGap))}.col-xl-7{width:calc(58.3333333333% - var(--gridGap))}.col-xl-6{width:calc(50% - var(--gridGap))}.col-xl-5{width:calc(41.6666666667% - var(--gridGap))}.col-xl-4{width:calc(33.3333333333% - var(--gridGap))}.col-xl-3{width:calc(25% - var(--gridGap))}.col-xl-2{width:calc(16.6666666667% - var(--gridGap))}.col-xl-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 1400px){.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-12{width:calc(100% - var(--gridGap))}.col-xxl-11{width:calc(91.6666666667% - var(--gridGap))}.col-xxl-10{width:calc(83.3333333333% - var(--gridGap))}.col-xxl-9{width:calc(75% - var(--gridGap))}.col-xxl-8{width:calc(66.6666666667% - var(--gridGap))}.col-xxl-7{width:calc(58.3333333333% - var(--gridGap))}.col-xxl-6{width:calc(50% - var(--gridGap))}.col-xxl-5{width:calc(41.6666666667% - var(--gridGap))}.col-xxl-4{width:calc(33.3333333333% - var(--gridGap))}.col-xxl-3{width:calc(25% - var(--gridGap))}.col-xxl-2{width:calc(16.6666666667% - var(--gridGap))}.col-xxl-1{width:calc(8.3333333333% - var(--gridGap))}}.app-tooltip{position:fixed;z-index:999999;top:0;left:0;display:inline-block;vertical-align:top;max-width:275px;padding:3px 5px;color:#fff;text-align:center;font-family:var(--baseFontFamily);font-size:var(--smFontSize);line-height:var(--smLineHeight);border-radius:var(--baseRadius);background:var(--tooltipColor);pointer-events:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed),visibility var(--baseAnimationSpeed),transform var(--baseAnimationSpeed);transform:translateY(1px);backface-visibility:hidden;white-space:pre-line;word-break:break-word;opacity:0;visibility:hidden}.app-tooltip.code{font-family:monospace;white-space:pre-wrap;text-align:left;min-width:150px;max-width:340px}.app-tooltip.active{transform:scale(1);opacity:1;visibility:visible}.dropdown{position:absolute;z-index:99;right:0;left:auto;top:100%;cursor:default;display:inline-block;vertical-align:top;padding:5px;margin:5px 0 0;width:auto;min-width:140px;max-width:450px;max-height:330px;overflow-x:hidden;overflow-y:auto;background:var(--baseColor);border-radius:var(--baseRadius);border:1px solid var(--baseAlt2Color);box-shadow:0 2px 5px 0 var(--shadowColor)}.dropdown hr{margin:5px 0}.dropdown .dropdown-item{border:0;background:none;position:relative;outline:0;display:flex;align-items:center;column-gap:8px;width:100%;height:auto;min-height:0;text-align:left;padding:8px 10px;margin:0 0 5px;cursor:pointer;color:var(--txtPrimaryColor);font-weight:400;font-size:var(--baseFontSize);font-family:var(--baseFontFamily);line-height:var(--baseLineHeight);border-radius:var(--baseRadius);text-decoration:none;word-break:break-word;-webkit-user-select:none;user-select:none;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.dropdown .dropdown-item:last-child{margin-bottom:0}.dropdown .dropdown-item.selected{background:var(--baseAlt2Color)}.dropdown .dropdown-item:focus-visible,.dropdown .dropdown-item:hover{background:var(--baseAlt1Color)}.dropdown .dropdown-item:active{transition-duration:var(--activeAnimationSpeed);background:var(--baseAlt2Color)}.dropdown .dropdown-item.disabled{color:var(--txtDisabledColor);background:none;pointer-events:none}.dropdown .dropdown-item.separator{cursor:default;background:none;text-transform:uppercase;padding-top:0;padding-bottom:0;margin-top:15px;color:var(--txtDisabledColor);font-weight:600;font-size:var(--smFontSize)}.dropdown.dropdown-upside{top:auto;bottom:100%;margin:0 0 5px}.dropdown.dropdown-left{right:auto;left:0}.dropdown.dropdown-center{right:auto;left:50%;transform:translate(-50%)}.dropdown.dropdown-sm{margin-top:5px;min-width:100px}.dropdown.dropdown-sm .dropdown-item{column-gap:7px;font-size:var(--smFontSize);margin:0 0 2px;padding:5px 7px}.dropdown.dropdown-sm .dropdown-item:last-child{margin-bottom:0}.dropdown.dropdown-sm.dropdown-upside{margin-top:0;margin-bottom:5px}.dropdown.dropdown-block{width:100%;min-width:130px;max-width:100%}.dropdown.dropdown-nowrap{white-space:nowrap}.overlay-panel{position:relative;z-index:1;display:flex;flex-direction:column;align-self:flex-end;margin-left:auto;background:var(--baseColor);height:100%;width:580px;max-width:100%;word-wrap:break-word;box-shadow:0 2px 5px 0 var(--shadowColor)}.overlay-panel .overlay-panel-section{position:relative;width:100%;margin:0;padding:var(--baseSpacing);transition:box-shadow var(--baseAnimationSpeed)}.overlay-panel .overlay-panel-section:empty{display:none}.overlay-panel .overlay-panel-section:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.overlay-panel .overlay-panel-section:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.overlay-panel .overlay-panel-section .btn{flex-grow:0}.overlay-panel img{max-width:100%}.overlay-panel .panel-header{position:relative;z-index:2;display:flex;flex-wrap:wrap;align-items:center;column-gap:10px;row-gap:var(--baseSpacing);padding:calc(var(--baseSpacing) - 7px) var(--baseSpacing)}.overlay-panel .panel-header>*{margin-top:0;margin-bottom:0}.overlay-panel .panel-header .btn-back{margin-left:-10px}.overlay-panel .panel-header .overlay-close{z-index:3;outline:0;position:absolute;right:100%;top:20px;margin:0;display:inline-flex;align-items:center;justify-content:center;width:35px;height:35px;cursor:pointer;text-align:center;font-size:1.6rem;line-height:1;border-radius:50% 0 0 50%;color:#fff;background:var(--primaryColor);opacity:.5;transition:opacity var(--baseAnimationSpeed);-webkit-user-select:none;user-select:none}.overlay-panel .panel-header .overlay-close i{font-size:inherit}.overlay-panel .panel-header .overlay-close:hover,.overlay-panel .panel-header .overlay-close:focus-visible,.overlay-panel .panel-header .overlay-close:active{opacity:.7}.overlay-panel .panel-header .overlay-close:active{transition-duration:var(--activeAnimationSpeed);opacity:1}.overlay-panel .panel-header .btn-close{margin-right:-10px}.overlay-panel .panel-header .tabs-header{margin-bottom:-24px}.overlay-panel .panel-content{z-index:auto;flex-grow:1;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;scroll-behavior:smooth}.tox-fullscreen .overlay-panel .panel-content{z-index:9}.overlay-panel .panel-header~.panel-content{padding-top:5px}.overlay-panel .panel-footer{z-index:2;column-gap:var(--smSpacing);display:flex;align-items:center;justify-content:flex-end;border-top:1px solid var(--baseAlt2Color);padding:calc(var(--baseSpacing) - 7px) var(--baseSpacing)}.overlay-panel.scrollable .panel-header{box-shadow:0 4px 5px #0000000d}.overlay-panel.scrollable .panel-footer{box-shadow:0 -4px 5px #0000000d}.overlay-panel.scrollable.scroll-top-reached .panel-header,.overlay-panel.scrollable.scroll-bottom-reached .panel-footer{box-shadow:none}.overlay-panel.overlay-panel-xl{width:850px}.overlay-panel.overlay-panel-lg{width:700px}.overlay-panel.overlay-panel-sm{width:460px}.overlay-panel.popup{height:auto;max-height:100%;align-self:center;border-radius:var(--baseRadius);margin:0 auto}.overlay-panel.popup .panel-footer{background:var(--bodyColor)}.overlay-panel.hide-content .panel-content{display:none}.overlay-panel.colored-header .panel-header{background:var(--bodyColor);border-bottom:1px solid var(--baseAlt1Color)}.overlay-panel.colored-header .panel-header .tabs-header{border-bottom:0}.overlay-panel.colored-header .panel-header .tabs-header .tab-item{border:1px solid transparent;border-bottom:0}.overlay-panel.colored-header .panel-header .tabs-header .tab-item:hover,.overlay-panel.colored-header .panel-header .tabs-header .tab-item:focus-visible{background:var(--baseAlt1Color)}.overlay-panel.colored-header .panel-header .tabs-header .tab-item:after{content:none;display:none}.overlay-panel.colored-header .panel-header .tabs-header .tab-item.active{background:var(--baseColor);border-color:var(--baseAlt1Color)}.overlay-panel.colored-header .panel-header~.panel-content{padding-top:calc(var(--baseSpacing) - 5px)}.overlay-panel.compact-header .panel-header{row-gap:var(--smSpacing)}.overlay-panel.full-width-popup{width:100%}.overlay-panel.preview .panel-header{position:absolute;z-index:99;box-shadow:none}.overlay-panel.preview .panel-header .overlay-close{left:100%;right:auto;border-radius:0 50% 50% 0}.overlay-panel.preview .panel-header .overlay-close i{margin-right:5px}.overlay-panel.preview .panel-header,.overlay-panel.preview .panel-footer{padding:10px 15px}.overlay-panel.preview .panel-content{padding:0;text-align:center;display:flex;align-items:center;justify-content:center}.overlay-panel.preview img{max-width:100%;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.overlay-panel.preview object{position:absolute;z-index:1;left:0;top:0;width:100%;height:100%}.overlay-panel.preview.preview-image{width:auto;min-width:320px;min-height:300px;max-width:75%;max-height:90%}.overlay-panel.preview.preview-document,.overlay-panel.preview.preview-video{width:75%;height:90%}.overlay-panel.preview.preview-audio{min-width:320px;min-height:300px;max-width:90%;max-height:90%}@media (max-width: 900px){.overlay-panel .overlay-panel-section{padding:var(--smSpacing)}}.overlay-panel-container{display:flex;position:fixed;z-index:1000;flex-direction:row;align-items:center;top:0;left:0;width:100%;height:100%;overflow:hidden;margin:0;padding:0;outline:0}.overlay-panel-container .overlay{position:absolute;z-index:0;left:0;top:0;width:100%;height:100%;-webkit-user-select:none;user-select:none;background:var(--overlayColor)}.overlay-panel-container.padded{padding:10px}.overlay-panel-wrapper{position:relative;z-index:1000;outline:0}.alert{position:relative;display:flex;column-gap:15px;align-items:center;width:100%;min-height:50px;max-width:100%;word-break:break-word;margin:0 0 var(--baseSpacing);border-radius:var(--baseRadius);padding:12px 15px;background:var(--baseAlt1Color);color:var(--txtAltColor)}.alert .content,.alert .form-field .help-block,.form-field .alert .help-block,.alert .panel,.alert .sub-panel,.alert .overlay-panel .panel-content,.overlay-panel .alert .panel-content{flex-grow:1}.alert .icon,.alert .close{display:inline-flex;align-items:center;justify-content:center;flex-grow:0;flex-shrink:0;text-align:center}.alert .icon{align-self:stretch;font-size:1.2em;padding-right:15px;font-weight:400;border-right:1px solid rgba(0,0,0,.05);color:var(--txtHintColor)}.alert .close{display:inline-flex;margin-right:-5px;width:28px;height:28px;outline:0;cursor:pointer;text-align:center;font-size:var(--smFontSize);line-height:28px;border-radius:28px;text-decoration:none;color:inherit;opacity:.5;transition:opacity var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.alert .close:hover,.alert .close:focus{opacity:1;background:rgba(255,255,255,.2)}.alert .close:active{opacity:1;background:rgba(255,255,255,.3);transition-duration:var(--activeAnimationSpeed)}.alert code,.alert hr{background:rgba(0,0,0,.1)}.alert.alert-info{background:var(--infoAltColor)}.alert.alert-info .icon{color:var(--infoColor)}.alert.alert-warning{background:var(--warningAltColor)}.alert.alert-warning .icon{color:var(--warningColor)}.alert.alert-success{background:var(--successAltColor)}.alert.alert-success .icon{color:var(--successColor)}.alert.alert-danger{background:var(--dangerAltColor)}.alert.alert-danger .icon{color:var(--dangerColor)}.toasts-wrapper{position:fixed;z-index:999999;bottom:0;left:0;right:0;padding:0 var(--smSpacing);width:auto;display:block;text-align:center;pointer-events:none}.toasts-wrapper .alert{text-align:left;pointer-events:auto;width:var(--smWrapperWidth);margin:var(--baseSpacing) auto;box-shadow:0 2px 5px 0 var(--shadowColor)}@media screen and (min-width: 980px){body:not(.overlay-active):has(.app-sidebar) .toasts-wrapper{left:var(--appSidebarWidth)}body:not(.overlay-active):has(.page-sidebar) .toasts-wrapper{left:calc(var(--appSidebarWidth) + var(--pageSidebarWidth))}}button{outline:0;border:0;background:none;padding:0;text-align:left;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}.btn{position:relative;z-index:1;display:inline-flex;vertical-align:top;align-items:center;justify-content:center;outline:0;border:0;margin:0;flex-shrink:0;cursor:pointer;padding:5px 20px;column-gap:7px;-webkit-user-select:none;user-select:none;min-width:var(--btnHeight);min-height:var(--btnHeight);text-align:center;text-decoration:none;line-height:1;font-weight:600;color:#fff;font-size:var(--baseFontSize);font-family:var(--baseFontFamily);border-radius:var(--btnRadius);background:none;transition:color var(--baseAnimationSpeed)}.btn i{font-size:1.1428em;vertical-align:middle;display:inline-block}.btn .dropdown{-webkit-user-select:text;user-select:text}.btn:before{content:"";border-radius:inherit;position:absolute;left:0;top:0;z-index:-1;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none;backface-visibility:hidden;background:var(--primaryColor);transition:filter var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed),transform var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.btn:hover:before,.btn:focus-visible:before{opacity:.9}.btn.active,.btn:active{z-index:999}.btn.active:before,.btn:active:before{opacity:.8;transition-duration:var(--activeAnimationSpeed)}.btn.btn-info:before{background:var(--infoColor)}.btn.btn-info:hover:before,.btn.btn-info:focus-visible:before{opacity:.8}.btn.btn-info:active:before{opacity:.7}.btn.btn-success:before{background:var(--successColor)}.btn.btn-success:hover:before,.btn.btn-success:focus-visible:before{opacity:.8}.btn.btn-success:active:before{opacity:.7}.btn.btn-danger:before{background:var(--dangerColor)}.btn.btn-danger:hover:before,.btn.btn-danger:focus-visible:before{opacity:.8}.btn.btn-danger:active:before{opacity:.7}.btn.btn-warning:before{background:var(--warningColor)}.btn.btn-warning:hover:before,.btn.btn-warning:focus-visible:before{opacity:.8}.btn.btn-warning:active:before{opacity:.7}.btn.btn-hint:before{background:var(--baseAlt4Color)}.btn.btn-hint:hover:before,.btn.btn-hint:focus-visible:before{opacity:.8}.btn.btn-hint:active:before{opacity:.7}.btn.btn-outline{border:2px solid currentColor;background:#fff}.btn.btn-secondary,.btn.btn-transparent,.btn.btn-outline{box-shadow:none;color:var(--txtPrimaryColor)}.btn.btn-secondary:before,.btn.btn-transparent:before,.btn.btn-outline:before{opacity:0}.btn.btn-secondary:focus-visible:before,.btn.btn-secondary:hover:before,.btn.btn-transparent:focus-visible:before,.btn.btn-transparent:hover:before,.btn.btn-outline:focus-visible:before,.btn.btn-outline:hover:before{opacity:.3}.btn.btn-secondary.active:before,.btn.btn-secondary:active:before,.btn.btn-transparent.active:before,.btn.btn-transparent:active:before,.btn.btn-outline.active:before,.btn.btn-outline:active:before{opacity:.45}.btn.btn-secondary:before,.btn.btn-transparent:before,.btn.btn-outline:before{background:var(--baseAlt3Color)}.btn.btn-secondary.btn-info,.btn.btn-transparent.btn-info,.btn.btn-outline.btn-info{color:var(--infoColor)}.btn.btn-secondary.btn-info:before,.btn.btn-transparent.btn-info:before,.btn.btn-outline.btn-info:before{opacity:0}.btn.btn-secondary.btn-info:focus-visible:before,.btn.btn-secondary.btn-info:hover:before,.btn.btn-transparent.btn-info:focus-visible:before,.btn.btn-transparent.btn-info:hover:before,.btn.btn-outline.btn-info:focus-visible:before,.btn.btn-outline.btn-info:hover:before{opacity:.15}.btn.btn-secondary.btn-info.active:before,.btn.btn-secondary.btn-info:active:before,.btn.btn-transparent.btn-info.active:before,.btn.btn-transparent.btn-info:active:before,.btn.btn-outline.btn-info.active:before,.btn.btn-outline.btn-info:active:before{opacity:.25}.btn.btn-secondary.btn-info:before,.btn.btn-transparent.btn-info:before,.btn.btn-outline.btn-info:before{background:var(--infoColor)}.btn.btn-secondary.btn-success,.btn.btn-transparent.btn-success,.btn.btn-outline.btn-success{color:var(--successColor)}.btn.btn-secondary.btn-success:before,.btn.btn-transparent.btn-success:before,.btn.btn-outline.btn-success:before{opacity:0}.btn.btn-secondary.btn-success:focus-visible:before,.btn.btn-secondary.btn-success:hover:before,.btn.btn-transparent.btn-success:focus-visible:before,.btn.btn-transparent.btn-success:hover:before,.btn.btn-outline.btn-success:focus-visible:before,.btn.btn-outline.btn-success:hover:before{opacity:.15}.btn.btn-secondary.btn-success.active:before,.btn.btn-secondary.btn-success:active:before,.btn.btn-transparent.btn-success.active:before,.btn.btn-transparent.btn-success:active:before,.btn.btn-outline.btn-success.active:before,.btn.btn-outline.btn-success:active:before{opacity:.25}.btn.btn-secondary.btn-success:before,.btn.btn-transparent.btn-success:before,.btn.btn-outline.btn-success:before{background:var(--successColor)}.btn.btn-secondary.btn-danger,.btn.btn-transparent.btn-danger,.btn.btn-outline.btn-danger{color:var(--dangerColor)}.btn.btn-secondary.btn-danger:before,.btn.btn-transparent.btn-danger:before,.btn.btn-outline.btn-danger:before{opacity:0}.btn.btn-secondary.btn-danger:focus-visible:before,.btn.btn-secondary.btn-danger:hover:before,.btn.btn-transparent.btn-danger:focus-visible:before,.btn.btn-transparent.btn-danger:hover:before,.btn.btn-outline.btn-danger:focus-visible:before,.btn.btn-outline.btn-danger:hover:before{opacity:.15}.btn.btn-secondary.btn-danger.active:before,.btn.btn-secondary.btn-danger:active:before,.btn.btn-transparent.btn-danger.active:before,.btn.btn-transparent.btn-danger:active:before,.btn.btn-outline.btn-danger.active:before,.btn.btn-outline.btn-danger:active:before{opacity:.25}.btn.btn-secondary.btn-danger:before,.btn.btn-transparent.btn-danger:before,.btn.btn-outline.btn-danger:before{background:var(--dangerColor)}.btn.btn-secondary.btn-warning,.btn.btn-transparent.btn-warning,.btn.btn-outline.btn-warning{color:var(--warningColor)}.btn.btn-secondary.btn-warning:before,.btn.btn-transparent.btn-warning:before,.btn.btn-outline.btn-warning:before{opacity:0}.btn.btn-secondary.btn-warning:focus-visible:before,.btn.btn-secondary.btn-warning:hover:before,.btn.btn-transparent.btn-warning:focus-visible:before,.btn.btn-transparent.btn-warning:hover:before,.btn.btn-outline.btn-warning:focus-visible:before,.btn.btn-outline.btn-warning:hover:before{opacity:.15}.btn.btn-secondary.btn-warning.active:before,.btn.btn-secondary.btn-warning:active:before,.btn.btn-transparent.btn-warning.active:before,.btn.btn-transparent.btn-warning:active:before,.btn.btn-outline.btn-warning.active:before,.btn.btn-outline.btn-warning:active:before{opacity:.25}.btn.btn-secondary.btn-warning:before,.btn.btn-transparent.btn-warning:before,.btn.btn-outline.btn-warning:before{background:var(--warningColor)}.btn.btn-secondary.btn-hint,.btn.btn-transparent.btn-hint,.btn.btn-outline.btn-hint{color:var(--baseAlt4Color)}.btn.btn-secondary.btn-hint:before,.btn.btn-transparent.btn-hint:before,.btn.btn-outline.btn-hint:before{opacity:0}.btn.btn-secondary.btn-hint:focus-visible:before,.btn.btn-secondary.btn-hint:hover:before,.btn.btn-transparent.btn-hint:focus-visible:before,.btn.btn-transparent.btn-hint:hover:before,.btn.btn-outline.btn-hint:focus-visible:before,.btn.btn-outline.btn-hint:hover:before{opacity:.15}.btn.btn-secondary.btn-hint.active:before,.btn.btn-secondary.btn-hint:active:before,.btn.btn-transparent.btn-hint.active:before,.btn.btn-transparent.btn-hint:active:before,.btn.btn-outline.btn-hint.active:before,.btn.btn-outline.btn-hint:active:before{opacity:.25}.btn.btn-secondary.btn-hint:before,.btn.btn-transparent.btn-hint:before,.btn.btn-outline.btn-hint:before{background:var(--baseAlt4Color)}.btn.btn-secondary.btn-hint,.btn.btn-transparent.btn-hint,.btn.btn-outline.btn-hint{color:var(--txtHintColor)}.btn.btn-secondary.btn-hint:focus-visible,.btn.btn-secondary.btn-hint:hover,.btn.btn-secondary.btn-hint:active,.btn.btn-secondary.btn-hint.active,.btn.btn-transparent.btn-hint:focus-visible,.btn.btn-transparent.btn-hint:hover,.btn.btn-transparent.btn-hint:active,.btn.btn-transparent.btn-hint.active,.btn.btn-outline.btn-hint:focus-visible,.btn.btn-outline.btn-hint:hover,.btn.btn-outline.btn-hint:active,.btn.btn-outline.btn-hint.active{color:var(--txtPrimaryColor)}.btn.btn-secondary:before{opacity:.35}.btn.btn-secondary:focus-visible:before,.btn.btn-secondary:hover:before{opacity:.5}.btn.btn-secondary.active:before,.btn.btn-secondary:active:before{opacity:.7}.btn.btn-secondary.btn-info:before{opacity:.15}.btn.btn-secondary.btn-info:focus-visible:before,.btn.btn-secondary.btn-info:hover:before{opacity:.25}.btn.btn-secondary.btn-info.active:before,.btn.btn-secondary.btn-info:active:before{opacity:.3}.btn.btn-secondary.btn-success:before{opacity:.15}.btn.btn-secondary.btn-success:focus-visible:before,.btn.btn-secondary.btn-success:hover:before{opacity:.25}.btn.btn-secondary.btn-success.active:before,.btn.btn-secondary.btn-success:active:before{opacity:.3}.btn.btn-secondary.btn-danger:before{opacity:.15}.btn.btn-secondary.btn-danger:focus-visible:before,.btn.btn-secondary.btn-danger:hover:before{opacity:.25}.btn.btn-secondary.btn-danger.active:before,.btn.btn-secondary.btn-danger:active:before{opacity:.3}.btn.btn-secondary.btn-warning:before{opacity:.15}.btn.btn-secondary.btn-warning:focus-visible:before,.btn.btn-secondary.btn-warning:hover:before{opacity:.25}.btn.btn-secondary.btn-warning.active:before,.btn.btn-secondary.btn-warning:active:before{opacity:.3}.btn.btn-secondary.btn-hint:before{opacity:.15}.btn.btn-secondary.btn-hint:focus-visible:before,.btn.btn-secondary.btn-hint:hover:before{opacity:.25}.btn.btn-secondary.btn-hint.active:before,.btn.btn-secondary.btn-hint:active:before{opacity:.3}.btn.btn-disabled,.btn[disabled]{box-shadow:none;cursor:default;background:var(--baseAlt1Color);color:var(--txtDisabledColor)!important}.btn.btn-disabled:before,.btn[disabled]:before{display:none}.btn.btn-disabled.btn-transparent,.btn[disabled].btn-transparent{background:none}.btn.btn-disabled.btn-outline,.btn[disabled].btn-outline{border-color:var(--baseAlt2Color)}.btn.txt-left{text-align:left;justify-content:flex-start}.btn.txt-right{text-align:right;justify-content:flex-end}.btn.btn-expanded{min-width:150px}.btn.btn-expanded-sm{min-width:90px}.btn.btn-expanded-lg{min-width:170px}.btn.btn-lg{column-gap:10px;font-size:var(--lgFontSize);min-height:var(--lgBtnHeight);min-width:var(--lgBtnHeight);padding-left:30px;padding-right:30px}.btn.btn-lg i{font-size:1.2666em}.btn.btn-lg.btn-expanded{min-width:240px}.btn.btn-lg.btn-expanded-sm{min-width:160px}.btn.btn-lg.btn-expanded-lg{min-width:300px}.btn.btn-sm,.btn.btn-xs{column-gap:5px;font-size:var(--smFontSize);min-height:var(--smBtnHeight);min-width:var(--smBtnHeight);padding-left:12px;padding-right:12px}.btn.btn-sm i,.btn.btn-xs i{font-size:1rem}.btn.btn-sm.btn-expanded,.btn.btn-xs.btn-expanded{min-width:100px}.btn.btn-sm.btn-expanded-sm,.btn.btn-xs.btn-expanded-sm{min-width:80px}.btn.btn-sm.btn-expanded-lg,.btn.btn-xs.btn-expanded-lg{min-width:130px}.btn.btn-xs{padding-left:7px;padding-right:7px;min-width:var(--xsBtnHeight);min-height:var(--xsBtnHeight)}.btn.btn-block{display:flex;width:100%}.btn.btn-pill{border-radius:30px}.btn.btn-circle{border-radius:50%;padding:0;gap:0}.btn.btn-circle i{font-size:1.2857rem;text-align:center;width:19px;height:19px;line-height:19px}.btn.btn-circle i:before{margin:0;display:block}.btn.btn-circle.btn-sm i{font-size:1.1rem}.btn.btn-circle.btn-xs i{font-size:1.05rem}.btn.btn-loading{--loaderSize: 24px;cursor:default;pointer-events:none}.btn.btn-loading:after{content:"";position:absolute;display:inline-block;vertical-align:top;left:50%;top:50%;width:var(--loaderSize);height:var(--loaderSize);line-height:var(--loaderSize);font-size:var(--loaderSize);color:inherit;text-align:center;font-weight:400;margin-left:calc(var(--loaderSize) * -.5);margin-top:calc(var(--loaderSize) * -.5);font-family:var(--iconFontFamily);animation:loaderShow var(--baseAnimationSpeed),rotate .9s var(--baseAnimationSpeed) infinite linear}.btn.btn-loading>*{opacity:0;transform:scale(.9)}.btn.btn-loading.btn-sm,.btn.btn-loading.btn-xs{--loaderSize: 20px}.btn.btn-loading.btn-lg{--loaderSize: 28px}.btn.btn-prev i,.btn.btn-next i{transition:transform var(--baseAnimationSpeed)}.btn.btn-prev:hover i,.btn.btn-prev:focus-within i,.btn.btn-next:hover i,.btn.btn-next:focus-within i{transform:translate(3px)}.btn.btn-prev:hover i,.btn.btn-prev:focus-within i{transform:translate(-3px)}.btn.btn-horizontal-sticky{position:sticky;left:var(--xsSpacing);right:var(--xsSpacing)}.btns-group{display:inline-flex;align-items:center;gap:var(--xsSpacing)}.btns-group.no-gap{gap:0}.btns-group.no-gap>*{border-radius:0;min-width:0;box-shadow:-1px 0 #ffffff1a}.btns-group.no-gap>*:first-child{border-top-left-radius:var(--btnRadius);border-bottom-left-radius:var(--btnRadius);box-shadow:none}.btns-group.no-gap>*:last-child{border-top-right-radius:var(--btnRadius);border-bottom-right-radius:var(--btnRadius)}.tinymce-wrapper,.code-editor,.select .selected-container,input,select,textarea{display:block;width:100%;outline:0;border:0;margin:0;background:none;padding:5px 10px;line-height:20px;min-width:0;min-height:var(--inputHeight);background:var(--baseAlt1Color);color:var(--txtPrimaryColor);font-size:var(--baseFontSize);font-family:var(--baseFontFamily);font-weight:400;border-radius:var(--baseRadius);overflow:auto;overflow:overlay}.tinymce-wrapper::placeholder,.code-editor::placeholder,.select .selected-container::placeholder,input::placeholder,select::placeholder,textarea::placeholder{color:var(--txtDisabledColor)}@media screen and (min-width: 550px){.tinymce-wrapper:focus,.code-editor:focus,.select .selected-container:focus,input:focus,select:focus,textarea:focus,.tinymce-wrapper:focus-within,.code-editor:focus-within,.select .selected-container:focus-within,input:focus-within,select:focus-within,textarea:focus-within{scrollbar-color:var(--baseAlt3Color) transparent;scrollbar-width:thin;scroll-behavior:smooth}.tinymce-wrapper:focus::-webkit-scrollbar,.code-editor:focus::-webkit-scrollbar,.select .selected-container:focus::-webkit-scrollbar,input:focus::-webkit-scrollbar,select:focus::-webkit-scrollbar,textarea:focus::-webkit-scrollbar,.tinymce-wrapper:focus-within::-webkit-scrollbar,.code-editor:focus-within::-webkit-scrollbar,.select .selected-container:focus-within::-webkit-scrollbar,input:focus-within::-webkit-scrollbar,select:focus-within::-webkit-scrollbar,textarea:focus-within::-webkit-scrollbar{width:8px;height:8px;border-radius:var(--baseRadius)}.tinymce-wrapper:focus::-webkit-scrollbar-track,.code-editor:focus::-webkit-scrollbar-track,.select .selected-container:focus::-webkit-scrollbar-track,input:focus::-webkit-scrollbar-track,select:focus::-webkit-scrollbar-track,textarea:focus::-webkit-scrollbar-track,.tinymce-wrapper:focus-within::-webkit-scrollbar-track,.code-editor:focus-within::-webkit-scrollbar-track,.select .selected-container:focus-within::-webkit-scrollbar-track,input:focus-within::-webkit-scrollbar-track,select:focus-within::-webkit-scrollbar-track,textarea:focus-within::-webkit-scrollbar-track{background:transparent;border-radius:var(--baseRadius)}.tinymce-wrapper:focus::-webkit-scrollbar-thumb,.code-editor:focus::-webkit-scrollbar-thumb,.select .selected-container:focus::-webkit-scrollbar-thumb,input:focus::-webkit-scrollbar-thumb,select:focus::-webkit-scrollbar-thumb,textarea:focus::-webkit-scrollbar-thumb,.tinymce-wrapper:focus-within::-webkit-scrollbar-thumb,.code-editor:focus-within::-webkit-scrollbar-thumb,.select .selected-container:focus-within::-webkit-scrollbar-thumb,input:focus-within::-webkit-scrollbar-thumb,select:focus-within::-webkit-scrollbar-thumb,textarea:focus-within::-webkit-scrollbar-thumb{background-color:var(--baseAlt3Color);border-radius:15px;border:2px solid transparent;background-clip:padding-box}.tinymce-wrapper:focus::-webkit-scrollbar-thumb:hover,.code-editor:focus::-webkit-scrollbar-thumb:hover,.select .selected-container:focus::-webkit-scrollbar-thumb:hover,input:focus::-webkit-scrollbar-thumb:hover,select:focus::-webkit-scrollbar-thumb:hover,textarea:focus::-webkit-scrollbar-thumb:hover,.tinymce-wrapper:focus::-webkit-scrollbar-thumb:active,.code-editor:focus::-webkit-scrollbar-thumb:active,.select .selected-container:focus::-webkit-scrollbar-thumb:active,input:focus::-webkit-scrollbar-thumb:active,select:focus::-webkit-scrollbar-thumb:active,textarea:focus::-webkit-scrollbar-thumb:active,.tinymce-wrapper:focus-within::-webkit-scrollbar-thumb:hover,.code-editor:focus-within::-webkit-scrollbar-thumb:hover,.select .selected-container:focus-within::-webkit-scrollbar-thumb:hover,input:focus-within::-webkit-scrollbar-thumb:hover,select:focus-within::-webkit-scrollbar-thumb:hover,textarea:focus-within::-webkit-scrollbar-thumb:hover,.tinymce-wrapper:focus-within::-webkit-scrollbar-thumb:active,.code-editor:focus-within::-webkit-scrollbar-thumb:active,.select .selected-container:focus-within::-webkit-scrollbar-thumb:active,input:focus-within::-webkit-scrollbar-thumb:active,select:focus-within::-webkit-scrollbar-thumb:active,textarea:focus-within::-webkit-scrollbar-thumb:active{background-color:var(--baseAlt4Color)}}[readonly].tinymce-wrapper,[readonly].code-editor,.select [readonly].selected-container,input[readonly],select[readonly],textarea[readonly],.readonly.tinymce-wrapper,.readonly.code-editor,.select .readonly.selected-container,input.readonly,select.readonly,textarea.readonly{cursor:default;color:var(--txtHintColor)}[disabled].tinymce-wrapper,[disabled].code-editor,.select [disabled].selected-container,input[disabled],select[disabled],textarea[disabled],.disabled.tinymce-wrapper,.disabled.code-editor,.select .disabled.selected-container,input.disabled,select.disabled,textarea.disabled{cursor:default;color:var(--txtDisabledColor)}.txt-mono.tinymce-wrapper,.txt-mono.code-editor,.select .txt-mono.selected-container,input.txt-mono,select.txt-mono,textarea.txt-mono{line-height:var(--smLineHeight)}.code.tinymce-wrapper,.code.code-editor,.select .code.selected-container,input.code,select.code,textarea.code{font-size:15px;line-height:1.379rem;font-family:var(--monospaceFontFamily)}input{height:var(--inputHeight)}input:-webkit-autofill{-webkit-text-fill-color:var(--txtPrimaryColor);-webkit-box-shadow:inset 0 0 0 50px var(--baseAlt1Color)}.form-field:focus-within input:-webkit-autofill,input:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 50px var(--baseAlt2Color)}input[type=file]{padding:9px}input[type=checkbox],input[type=radio]{width:auto;height:auto;display:inline}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}textarea{min-height:80px;resize:vertical}select{padding-left:8px}.form-field{--hPadding: 15px;position:relative;display:block;width:100%;margin-bottom:var(--baseSpacing)}.form-field .tinymce-wrapper,.form-field .code-editor,.form-field .select .selected-container,.select .form-field .selected-container,.form-field input,.form-field select,.form-field textarea{z-index:0;padding-left:var(--hPadding);padding-right:var(--hPadding)}.form-field select{padding-left:8px}.form-field label{display:flex;width:100%;column-gap:5px;align-items:center;-webkit-user-select:none;user-select:none;font-weight:600;font-size:var(--smFontSize);letter-spacing:.1px;color:var(--txtHintColor);line-height:1;padding-top:12px;padding-bottom:3px;padding-left:var(--hPadding);padding-right:var(--hPadding);border:0;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.form-field label~.tinymce-wrapper,.form-field label~.code-editor,.form-field .select label~.selected-container,.select .form-field label~.selected-container,.form-field label~input,.form-field label~select,.form-field label~textarea{border-top:0;padding-top:2px;padding-bottom:8px;border-top-left-radius:0;border-top-right-radius:0}.form-field label i{font-size:.96rem;margin-bottom:-1px}.form-field label i:before{margin:0}.form-field .tinymce-wrapper,.form-field .code-editor,.form-field .select .selected-container,.select .form-field .selected-container,.form-field input,.form-field select,.form-field textarea,.form-field label{background:var(--baseAlt1Color);transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.form-field:focus-within .tinymce-wrapper,.form-field:focus-within .code-editor,.form-field:focus-within .select .selected-container,.select .form-field:focus-within .selected-container,.form-field:focus-within input,.form-field:focus-within select,.form-field:focus-within textarea,.form-field:focus-within label{background:var(--baseAlt2Color)}.form-field:focus-within label{color:var(--txtPrimaryColor)}.form-field .form-field-addon{position:absolute;display:inline-flex;align-items:center;z-index:1;top:0;right:var(--hPadding);min-height:var(--inputHeight);color:var(--txtHintColor)}.form-field .form-field-addon .btn{margin-right:-5px}.form-field .form-field-addon:not(.prefix)~.tinymce-wrapper,.form-field .form-field-addon:not(.prefix)~.code-editor,.form-field .select .form-field-addon:not(.prefix)~.selected-container,.select .form-field .form-field-addon:not(.prefix)~.selected-container,.form-field .form-field-addon:not(.prefix)~input,.form-field .form-field-addon:not(.prefix)~select,.form-field .form-field-addon:not(.prefix)~textarea{padding-right:45px}.form-field .form-field-addon.prefix{right:auto;left:var(--hPadding)}.form-field .form-field-addon.prefix~.tinymce-wrapper,.form-field .form-field-addon.prefix~.code-editor,.form-field .select .form-field-addon.prefix~.selected-container,.select .form-field .form-field-addon.prefix~.selected-container,.form-field .form-field-addon.prefix~input,.form-field .form-field-addon.prefix~select,.form-field .form-field-addon.prefix~textarea{padding-left:45px}.form-field label~.form-field-addon{min-height:calc(26px + var(--inputHeight))}.form-field .help-block{position:relative;margin-top:8px;font-size:var(--smFontSize);line-height:var(--smLineHeight);color:var(--txtHintColor);word-break:break-word}.form-field .help-block pre{white-space:pre-wrap}.form-field .help-block-error{color:var(--dangerColor)}.form-field.error>label,.form-field.invalid>label{color:var(--dangerColor)}.form-field.invalid label,.form-field.invalid .tinymce-wrapper,.form-field.invalid .code-editor,.form-field.invalid .select .selected-container,.select .form-field.invalid .selected-container,.form-field.invalid input,.form-field.invalid select,.form-field.invalid textarea{background:var(--dangerAltColor)}.form-field.required:not(.form-field-toggle)>label:after{content:"*";color:var(--dangerColor);margin-top:-2px;margin-left:-2px}.form-field.readonly label,.form-field.readonly .tinymce-wrapper,.form-field.readonly .code-editor,.form-field.readonly .select .selected-container,.select .form-field.readonly .selected-container,.form-field.readonly input,.form-field.readonly select,.form-field.readonly textarea,.form-field.disabled label,.form-field.disabled .tinymce-wrapper,.form-field.disabled .code-editor,.form-field.disabled .select .selected-container,.select .form-field.disabled .selected-container,.form-field.disabled input,.form-field.disabled select,.form-field.disabled textarea{background:var(--baseAlt1Color)}.form-field.readonly>label,.form-field.disabled>label{color:var(--txtHintColor)}.form-field.readonly.required>label:after,.form-field.disabled.required>label:after{opacity:.5}.form-field.disabled label,.form-field.disabled .tinymce-wrapper,.form-field.disabled .code-editor,.form-field.disabled .select .selected-container,.select .form-field.disabled .selected-container,.form-field.disabled input,.form-field.disabled select,.form-field.disabled textarea{box-shadow:inset 0 0 0 var(--btnHeight) #ffffff73}.form-field.disabled>label{color:var(--txtDisabledColor)}.form-field input[type=radio],.form-field input[type=checkbox]{position:absolute;z-index:-1;left:0;width:0;height:0;min-height:0;min-width:0;border:0;background:none;-webkit-user-select:none;user-select:none;pointer-events:none;box-shadow:none;opacity:0}.form-field input[type=radio]~label,.form-field input[type=checkbox]~label{border:0;margin:0;outline:0;background:none;display:inline-flex;vertical-align:top;align-items:center;width:auto;column-gap:5px;-webkit-user-select:none;user-select:none;padding:0 0 0 27px;line-height:20px;min-height:20px;font-weight:400;font-size:var(--baseFontSize);text-transform:none;color:var(--txtPrimaryColor)}.form-field input[type=radio]~label:before,.form-field input[type=checkbox]~label:before{content:"";display:inline-block;vertical-align:top;position:absolute;z-index:0;left:0;top:0;width:20px;height:20px;line-height:16px;font-family:var(--iconFontFamily);font-size:1.2rem;text-align:center;color:var(--baseColor);cursor:pointer;background:var(--baseColor);border-radius:var(--baseRadius);border:2px solid var(--baseAlt3Color);transition:transform var(--baseAnimationSpeed),border-color var(--baseAnimationSpeed),color var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.form-field input[type=radio]~label:active:before,.form-field input[type=checkbox]~label:active:before{transform:scale(.9)}.form-field input[type=radio]:focus~label:before,.form-field input[type=radio]~label:hover:before,.form-field input[type=checkbox]:focus~label:before,.form-field input[type=checkbox]~label:hover:before{border-color:var(--baseAlt4Color)}.form-field input[type=radio]:checked~label:before,.form-field input[type=checkbox]:checked~label:before{content:"";box-shadow:none;mix-blend-mode:unset;background:var(--successColor);border-color:var(--successColor)}.form-field input[type=radio]:disabled~label,.form-field input[type=checkbox]:disabled~label{pointer-events:none;cursor:not-allowed;color:var(--txtDisabledColor)}.form-field input[type=radio]:disabled~label:before,.form-field input[type=checkbox]:disabled~label:before{opacity:.5}.form-field input[type=radio]~label:before{border-radius:50%;font-size:1rem}.form-field .form-field-block{position:relative;margin:0 0 var(--xsSpacing)}.form-field .form-field-block:last-child{margin-bottom:0}.form-field.form-field-toggle input[type=radio]~label,.form-field.form-field-toggle input[type=checkbox]~label{position:relative}.form-field.form-field-toggle input[type=radio]~label:before,.form-field.form-field-toggle input[type=checkbox]~label:before{content:"";border:0;box-shadow:none;background:var(--baseAlt3Color);transition:background var(--activeAnimationSpeed)}.form-field.form-field-toggle input[type=radio]~label:after,.form-field.form-field-toggle input[type=checkbox]~label:after{content:"";position:absolute;z-index:1;cursor:pointer;background:var(--baseColor);transition:left var(--activeAnimationSpeed),transform var(--activeAnimationSpeed),background var(--activeAnimationSpeed);box-shadow:0 2px 5px 0 var(--shadowColor)}.form-field.form-field-toggle input[type=radio]~label:active:before,.form-field.form-field-toggle input[type=checkbox]~label:active:before{transform:none}.form-field.form-field-toggle input[type=radio]~label:active:after,.form-field.form-field-toggle input[type=checkbox]~label:active:after{transform:scale(.9)}.form-field.form-field-toggle input[type=radio]:focus-visible~label:before,.form-field.form-field-toggle input[type=checkbox]:focus-visible~label:before{box-shadow:0 0 0 2px var(--baseAlt2Color)}.form-field.form-field-toggle input[type=radio]~label:hover:before,.form-field.form-field-toggle input[type=checkbox]~label:hover:before{background:var(--baseAlt4Color)}.form-field.form-field-toggle input[type=radio]:checked~label:before,.form-field.form-field-toggle input[type=checkbox]:checked~label:before{background:var(--successColor)}.form-field.form-field-toggle input[type=radio]:checked~label:after,.form-field.form-field-toggle input[type=checkbox]:checked~label:after{background:var(--baseColor)}.form-field.form-field-toggle input[type=radio]~label,.form-field.form-field-toggle input[type=checkbox]~label{min-height:24px;padding-left:47px}.form-field.form-field-toggle input[type=radio]~label:empty,.form-field.form-field-toggle input[type=checkbox]~label:empty{padding-left:40px}.form-field.form-field-toggle input[type=radio]~label:before,.form-field.form-field-toggle input[type=checkbox]~label:before{width:40px;height:24px;border-radius:24px}.form-field.form-field-toggle input[type=radio]~label:after,.form-field.form-field-toggle input[type=checkbox]~label:after{top:4px;left:4px;width:16px;height:16px;border-radius:16px}.form-field.form-field-toggle input[type=radio]:checked~label:after,.form-field.form-field-toggle input[type=checkbox]:checked~label:after{left:20px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label{min-height:20px;padding-left:39px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label:empty,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label:empty{padding-left:32px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label:before,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label:before{width:32px;height:20px;border-radius:20px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label:after,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label:after{top:4px;left:4px;width:12px;height:12px;border-radius:12px}.form-field.form-field-toggle.form-field-sm input[type=radio]:checked~label:after,.form-field.form-field-toggle.form-field-sm input[type=checkbox]:checked~label:after{left:16px}.form-field-group{display:flex;width:100%;align-items:center}.form-field-group>.form-field{flex-grow:1;border-left:1px solid var(--baseAlt2Color)}.form-field-group>.form-field:first-child{border-left:0}.form-field-group>.form-field:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.form-field-group>.form-field:not(:first-child)>label{border-top-left-radius:0}.form-field-group>.form-field:not(:first-child)>.tinymce-wrapper,.form-field-group>.form-field:not(:first-child)>.code-editor,.select .form-field-group>.form-field:not(:first-child)>.selected-container,.form-field-group>.form-field:not(:first-child)>input,.form-field-group>.form-field:not(:first-child)>select,.form-field-group>.form-field:not(:first-child)>textarea,.form-field-group>.form-field:not(:first-child)>.select .selected-container{border-bottom-left-radius:0}.form-field-group>.form-field:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.form-field-group>.form-field:not(:last-child)>label{border-top-right-radius:0}.form-field-group>.form-field:not(:last-child)>.tinymce-wrapper,.form-field-group>.form-field:not(:last-child)>.code-editor,.select .form-field-group>.form-field:not(:last-child)>.selected-container,.form-field-group>.form-field:not(:last-child)>input,.form-field-group>.form-field:not(:last-child)>select,.form-field-group>.form-field:not(:last-child)>textarea,.form-field-group>.form-field:not(:last-child)>.select .selected-container{border-bottom-right-radius:0}.form-field-group .form-field.col-12{width:100%}.form-field-group .form-field.col-11{width:91.6666666667%}.form-field-group .form-field.col-10{width:83.3333333333%}.form-field-group .form-field.col-9{width:75%}.form-field-group .form-field.col-8{width:66.6666666667%}.form-field-group .form-field.col-7{width:58.3333333333%}.form-field-group .form-field.col-6{width:50%}.form-field-group .form-field.col-5{width:41.6666666667%}.form-field-group .form-field.col-4{width:33.3333333333%}.form-field-group .form-field.col-3{width:25%}.form-field-group .form-field.col-2{width:16.6666666667%}.form-field-group .form-field.col-1{width:8.3333333333%}.select{position:relative;display:block;outline:0}.select .option{-webkit-user-select:none;user-select:none;column-gap:5px}.select .option .icon{min-width:20px;text-align:center;line-height:inherit}.select .option .icon i{vertical-align:middle;line-height:inherit}.select .txt-placeholder{color:var(--txtHintColor)}label~.select .selected-container{border-top:0}.select .selected-container{position:relative;display:flex;flex-wrap:wrap;width:100%;align-items:center;padding-top:0;padding-bottom:0;padding-right:35px!important;-webkit-user-select:none;user-select:none}.select .selected-container:after{content:"";position:absolute;right:5px;top:50%;width:20px;height:20px;line-height:20px;text-align:center;margin-top:-10px;display:inline-block;vertical-align:top;font-size:1rem;font-family:var(--iconFontFamily);align-self:flex-end;color:var(--txtHintColor);transition:color var(--baseAnimationSpeed),transform var(--baseAnimationSpeed)}.select .selected-container:active,.select .selected-container.active{border-bottom-left-radius:0;border-bottom-right-radius:0}.select .selected-container:active:after,.select .selected-container.active:after{color:var(--txtPrimaryColor);transform:rotate(180deg)}.select .selected-container .option{display:flex;width:100%;align-items:center;max-width:100%;-webkit-user-select:text;user-select:text}.select .selected-container .clear{margin-left:auto;cursor:pointer;color:var(--txtHintColor);transition:color var(--baseAnimationSpeed)}.select .selected-container .clear i{display:inline-block;vertical-align:middle;line-height:1}.select .selected-container .clear:hover{color:var(--txtPrimaryColor)}.select.multiple .selected-container{display:flex;align-items:center;padding-left:2px;row-gap:3px;column-gap:4px}.select.multiple .selected-container .txt-placeholder{margin-left:5px}.select.multiple .selected-container .option{display:inline-flex;width:auto;padding:3px 5px;line-height:1;border-radius:var(--baseRadius);background:var(--baseColor)}.select:not(.multiple) .selected-container .label{margin-left:-2px}.select:not(.multiple) .selected-container .option .txt{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%;line-height:normal}.select:not(.disabled) .selected-container:hover{cursor:pointer}.select.readonly,.select.disabled{color:var(--txtHintColor);pointer-events:none}.select.readonly .txt-placeholder,.select.disabled .txt-placeholder,.select.readonly .selected-container,.select.disabled .selected-container{color:inherit}.select.readonly .selected-container .link-hint,.select.disabled .selected-container .link-hint{pointer-events:auto}.select.readonly .selected-container *:not(.link-hint),.select.disabled .selected-container *:not(.link-hint){color:inherit!important}.select.readonly .selected-container:after,.select.readonly .selected-container .clear,.select.disabled .selected-container:after,.select.disabled .selected-container .clear{display:none}.select.readonly .selected-container:hover,.select.disabled .selected-container:hover{cursor:inherit}.select.disabled{color:var(--txtDisabledColor)}.select .txt-missing{color:var(--txtHintColor);padding:5px 12px;margin:0}.select .options-dropdown{max-height:none;border:0;overflow:auto;border-top-left-radius:0;border-top-right-radius:0;margin-top:-2px;box-shadow:0 2px 5px 0 var(--shadowColor),inset 0 0 0 2px var(--baseAlt2Color)}.select .options-dropdown .input-group:focus-within{box-shadow:none}.select .options-dropdown .form-field.options-search{margin:0 0 5px;padding:0 0 2px;color:var(--txtHintColor);border-bottom:1px solid var(--baseAlt2Color)}.select .options-dropdown .form-field.options-search .input-group{border-radius:0;padding:0 0 0 10px;margin:0;background:none;column-gap:0;border:0}.select .options-dropdown .form-field.options-search input{border:0;padding-left:9px;padding-right:9px;background:none}.select .options-dropdown .options-list{overflow:auto;max-height:240px;width:auto;margin-left:0;margin-right:-5px;padding-right:5px}.select .options-list:not(:empty)~[slot=afterOptions]:not(:empty){margin:5px -5px -5px}.select .options-list:not(:empty)~[slot=afterOptions]:not(:empty) .btn-block{border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius)}label~.select .selected-container{padding-bottom:4px;border-top-left-radius:0;border-top-right-radius:0}label~.select.multiple .selected-container{padding-top:3px;padding-bottom:3px;padding-left:10px}.select.block-options.multiple .selected-container .option{width:100%;box-shadow:0 2px 5px 0 var(--shadowColor)}.select.upside .selected-container.active{border-radius:0 0 var(--baseRadius) var(--baseRadius)}.select.upside .options-dropdown{border-radius:var(--baseRadius) var(--baseRadius) 0 0;margin:0}.field-type-select .options-dropdown{padding:2px 1px 1px 2px}.field-type-select .options-dropdown .form-field.options-search{margin:0}.field-type-select .options-dropdown .options-list{max-height:490px;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;padding:0}.field-type-select .options-dropdown .dropdown-item{width:50%;margin:0;padding-left:12px;border-radius:0;border-bottom:1px solid var(--baseAlt2Color);border-right:1px solid var(--baseAlt2Color)}.field-type-select .options-dropdown .dropdown-item.selected{background:var(--baseAlt1Color)}.form-field-list{border-radius:var(--baseRadius);transition:box-shadow var(--baseAnimationSpeed)}.form-field-list label{padding-bottom:10px}.form-field-list .list{background:var(--baseAlt1Color);border:0;border-radius:0;border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius);transition:background var(--baseAnimationSpeed)}.form-field-list .list .list-item{border-top:1px solid var(--baseAlt2Color)}.form-field-list .list .list-item:hover,.form-field-list .list .list-item:focus,.form-field-list .list .list-item:focus-within,.form-field-list .list .list-item:focus-visible,.form-field-list .list .list-item:active{background:none}.form-field-list .list .list-item.selected{background:var(--baseAlt2Color)}.form-field-list .list .list-item.handle:not(.disabled):hover,.form-field-list .list .list-item.handle:not(.disabled):focus-visible{background:var(--baseAlt2Color)}.form-field-list .list .list-item.handle:not(.disabled):active{background:var(--baseAlt3Color)}.form-field-list .list .list-item.dragging{z-index:9;box-shadow:inset 0 0 0 1px var(--baseAlt3Color)}.form-field-list .list .list-item.dragover{background:var(--baseAlt2Color)}.form-field-list:focus-within .list,.form-field-list:focus-within label{background:var(--baseAlt1Color)}.form-field-list.dragover:not(:has(.dragging)){box-shadow:0 0 0 2px var(--warningColor)}.code-editor{display:flex;flex-direction:column;width:100%}.form-field label~.code-editor{padding-bottom:6px;padding-top:4px}.code-editor .cm-editor{flex-grow:1;border:0!important;outline:none!important}.code-editor .cm-editor .cm-line{padding-left:0;padding-right:0}.code-editor .cm-editor .cm-tooltip-autocomplete{box-shadow:0 2px 5px 0 var(--shadowColor);border-radius:var(--baseRadius);background:var(--baseColor);border:0;z-index:9999;padding:0 3px;font-size:.92rem}.code-editor .cm-editor .cm-tooltip-autocomplete ul{margin:0;border-radius:inherit}.code-editor .cm-editor .cm-tooltip-autocomplete ul>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.code-editor .cm-editor .cm-tooltip-autocomplete ul>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.code-editor .cm-editor .cm-tooltip-autocomplete ul li[aria-selected]{background:var(--infoColor)}.code-editor .cm-editor .cm-scroller{flex-grow:1;outline:0!important;font-family:var(--monospaceFontFamily);font-size:var(--baseFontSize);line-height:var(--baseLineHeight)}.code-editor .cm-editor .cm-cursorLayer .cm-cursor{margin-left:0!important}.code-editor .cm-editor .cm-placeholder{color:var(--txtDisabledColor);font-family:var(--monospaceFontFamily);font-size:var(--baseFontSize);line-height:var(--baseLineHeight)}.code-editor .cm-editor .cm-selectionMatch{background:var(--infoAltColor)}.code-editor .cm-editor.cm-focused .cm-matchingBracket{background-color:#328c821a}.code-editor .ͼf{color:var(--dangerColor)}.tinymce-wrapper{min-height:277px}.tinymce-wrapper .tox-tinymce{border-radius:var(--baseRadius);border:0}.form-field label~.tinymce-wrapper{position:relative;z-index:auto;padding:5px 2px 2px}.form-field label~.tinymce-wrapper:before{content:"";position:absolute;z-index:-1;top:5px;left:2px;right:2px;bottom:2px;background:#fff;border-radius:var(--baseRadius)}body .tox .tox-dialog{border:0;border-radius:var(--baseRadius)}body .tox .tox-dialog-wrap__backdrop{background:var(--overlayColor)}body .tox .tox-tbtn{height:30px}body .tox .tox-tbtn svg{transform:scale(.85)}body .tox .tox-collection__item-checkmark,body .tox .tox-collection__item-icon{width:22px;height:22px;transform:scale(.85)}body .tox .tox-tbtn:not(.tox-tbtn--select){width:30px}body .tox .tox-button,body .tox .tox-button--secondary{font-size:var(--smFontSize)}body .tox .tox-toolbar-overlord{box-shadow:0 2px 5px 0 var(--shadowColor)}body .tox .tox-listboxfield .tox-listbox--select,body .tox .tox-textarea,body .tox .tox-textfield,body .tox .tox-toolbar-textfield{padding:3px 5px}body .tox-swatch:not(.tox-swatch--remove):not(.tox-collection__item--enabled) svg{display:none}body .tox .tox-textarea-wrap{display:flex;flex:1}body.tox-fullscreen .overlay-panel-section{overflow:hidden}.main-menu{--menuItemSize: 45px;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:var(--smSpacing);font-size:var(--xlFontSize);color:var(--txtPrimaryColor)}.main-menu i{font-size:24px;line-height:1}.main-menu .menu-item{position:relative;outline:0;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;text-align:center;justify-content:center;-webkit-user-select:none;user-select:none;color:inherit;min-width:var(--menuItemSize);min-height:var(--menuItemSize);border:2px solid transparent;border-radius:var(--lgRadius);transition:background var(--baseAnimationSpeed),border var(--baseAnimationSpeed)}.main-menu .menu-item:focus-visible,.main-menu .menu-item:hover{background:var(--baseAlt1Color)}.main-menu .menu-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.main-menu .menu-item.active,.main-menu .menu-item.current-route{background:var(--baseColor);border-color:var(--primaryColor)}.app-sidebar{position:relative;z-index:1;display:flex;flex-grow:0;flex-shrink:0;flex-direction:column;align-items:center;width:var(--appSidebarWidth);padding:var(--smSpacing) 0px var(--smSpacing);background:var(--baseColor);border-right:1px solid var(--baseAlt2Color)}.app-sidebar .main-menu{flex-grow:1;justify-content:flex-start;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;margin-top:34px;margin-bottom:var(--baseSpacing)}.app-layout{display:flex;width:100%;height:100vh}.app-layout .app-body{flex-grow:1;min-width:0;height:100%;display:flex;align-items:stretch}.app-layout .app-sidebar~.app-body{min-width:650px}.page-sidebar{--sidebarListItemMargin: 10px;position:relative;z-index:0;display:flex;flex-direction:column;width:var(--pageSidebarWidth);min-width:var(--pageSidebarWidth);max-width:400px;flex-shrink:0;flex-grow:0;overflow-x:hidden;overflow-y:auto;background:var(--baseColor);padding:calc(var(--baseSpacing) - 5px) 0 var(--smSpacing);border-right:1px solid var(--baseAlt2Color)}.page-sidebar>*{padding:0 var(--xsSpacing)}.page-sidebar .sidebar-content{overflow-x:hidden;overflow-y:auto;overflow-y:overlay}.page-sidebar .sidebar-content>:first-child{margin-top:0}.page-sidebar .sidebar-content>:last-child{margin-bottom:0}.page-sidebar .sidebar-footer{margin-top:var(--smSpacing)}.page-sidebar .search{display:flex;align-items:center;width:auto;column-gap:5px;margin:0 0 var(--xsSpacing);color:var(--txtHintColor);opacity:.7;transition:opacity var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.page-sidebar .search input{border:0;background:var(--baseColor);transition:box-shadow var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.page-sidebar .search .btn-clear{margin-right:-8px}.page-sidebar .search:hover,.page-sidebar .search:focus-within,.page-sidebar .search.active{opacity:1;color:var(--txtPrimaryColor)}.page-sidebar .search:hover input,.page-sidebar .search:focus-within input,.page-sidebar .search.active input{background:var(--baseAlt2Color)}.page-sidebar .sidebar-title{display:flex;align-items:center;gap:5px;width:100%;margin:var(--baseSpacing) 5px var(--xsSpacing);font-weight:600;font-size:1rem;line-height:var(--smLineHeight);color:var(--txtHintColor)}.page-sidebar .sidebar-title .label{font-weight:400}.page-sidebar .sidebar-list-item{cursor:pointer;outline:0;text-decoration:none;position:relative;display:flex;width:100%;align-items:center;column-gap:10px;margin:var(--sidebarListItemMargin) 0;padding:3px 10px;font-size:var(--xlFontSize);min-height:var(--btnHeight);min-width:0;color:var(--txtHintColor);border-radius:var(--baseRadius);-webkit-user-select:none;user-select:none;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.page-sidebar .sidebar-list-item i{font-size:18px}.page-sidebar .sidebar-list-item .txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.page-sidebar .sidebar-list-item:focus-visible,.page-sidebar .sidebar-list-item:hover,.page-sidebar .sidebar-list-item:active,.page-sidebar .sidebar-list-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.page-sidebar .sidebar-list-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.page-sidebar .sidebar-content-compact .sidebar-list-item{--sidebarListItemMargin: 5px}@media screen and (max-height: 600px){.page-sidebar{--sidebarListItemMargin: 5px}}@media screen and (max-width: 1100px){.page-sidebar{min-width:200px}.page-sidebar>*{padding-left:10px;padding-right:10px}}.page-header{display:flex;flex-shrink:0;align-items:center;width:100%;min-height:var(--btnHeight);gap:var(--xsSpacing);margin:0 0 var(--baseSpacing)}.page-header .btns-group{margin-left:auto;justify-content:end}@media screen and (max-width: 1050px){.page-header{flex-wrap:wrap}.page-header .btns-group{width:100%}.page-header .btns-group .btn{flex-grow:1;flex-basis:0}}.page-header-wrapper{background:var(--baseColor);width:auto;margin-top:calc(-1 * (var(--baseSpacing) - 5px));margin-left:calc(-1 * var(--baseSpacing));margin-right:calc(-1 * var(--baseSpacing));margin-bottom:var(--baseSpacing);padding:calc(var(--baseSpacing) - 5px) var(--baseSpacing);border-bottom:1px solid var(--baseAlt2Color)}.breadcrumbs{display:flex;align-items:center;gap:30px;color:var(--txtDisabledColor)}.breadcrumbs .breadcrumb-item{position:relative;margin:0;line-height:1;font-weight:400}.breadcrumbs .breadcrumb-item:after{content:"/";position:absolute;right:-20px;top:0;width:10px;text-align:center;pointer-events:none;opacity:.4}.breadcrumbs .breadcrumb-item:last-child{word-break:break-word;color:var(--txtPrimaryColor)}.breadcrumbs .breadcrumb-item:last-child:after{content:none;display:none}.breadcrumbs a{text-decoration:none;color:inherit;transition:color var(--baseAnimationSpeed)}.breadcrumbs a:hover{color:var(--txtPrimaryColor)}.page-content{position:relative;display:block;width:100%;flex-grow:1;padding:calc(var(--baseSpacing) - 5px) var(--baseSpacing) var(--smSpacing)}.page-footer{display:flex;gap:5px;align-items:center;justify-content:right;padding:0px var(--baseSpacing) var(--smSpacing);color:var(--txtDisabledColor);font-size:var(--xsFontSize);line-height:var(--smLineHeight)}.page-footer i{font-size:1.2em}.page-footer a{color:inherit;text-decoration:none;transition:color var(--baseAnimationSpeed)}.page-footer a:focus-visible,.page-footer a:hover,.page-footer a:active{color:var(--txtPrimaryColor)}.page-wrapper{display:flex;flex-direction:column;flex-grow:1;width:100%;overflow-x:hidden;overflow-y:auto;scroll-behavior:smooth;scrollbar-gutter:stable}.overlay-active .page-wrapper{overflow-y:hidden}.page-wrapper.full-page{scrollbar-gutter:auto;background:var(--baseColor)}.page-wrapper.center-content .page-content{display:flex;align-items:center}.page-wrapper.flex-content{scrollbar-gutter:auto}.page-wrapper.flex-content .page-content{display:flex;min-height:0;flex-direction:column}@keyframes tabChange{0%{opacity:.7}to{opacity:1}}.tabs-header{display:flex;align-items:stretch;justify-content:flex-start;column-gap:10px;width:100%;min-height:50px;-webkit-user-select:none;user-select:none;margin:0 0 var(--baseSpacing);border-bottom:2px solid var(--baseAlt2Color)}.tabs-header .tab-item{position:relative;outline:0;border:0;background:none;display:inline-flex;align-items:center;justify-content:center;min-width:70px;gap:5px;padding:10px;margin:0;font-size:var(--lgFontSize);line-height:var(--baseLineHeight);font-family:var(--baseFontFamily);color:var(--txtHintColor);text-align:center;text-decoration:none;cursor:pointer;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius);transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.tabs-header .tab-item:after{content:"";position:absolute;display:block;left:0;bottom:-2px;width:100%;height:2px;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius);background:var(--primaryColor);transform:rotateY(90deg);transition:transform .2s}.tabs-header .tab-item .txt,.tabs-header .tab-item i{display:inline-block;vertical-align:top}.tabs-header .tab-item:hover,.tabs-header .tab-item:focus-visible,.tabs-header .tab-item:active{color:var(--txtPrimaryColor)}.tabs-header .tab-item:focus-visible,.tabs-header .tab-item:active{transition-duration:var(--activeAnimationSpeed);background:var(--baseAlt2Color)}.tabs-header .tab-item.active{color:var(--txtPrimaryColor)}.tabs-header .tab-item.active:after{transform:rotateY(0)}.tabs-header .tab-item.disabled{pointer-events:none;color:var(--txtDisabledColor)}.tabs-header .tab-item.disabled:after{display:none}.tabs-header.right{justify-content:flex-end}.tabs-header.center{justify-content:center}.tabs-header.stretched .tab-item{flex-grow:1;flex-basis:0}.tabs-header.compact{min-height:30px;margin-bottom:var(--smSpacing)}.tabs-header.combined{border:0;margin-bottom:-2px}.tabs-header.combined .tab-item:after{content:none;display:none}.tabs-header.combined .tab-item.active{background:var(--baseAlt1Color)}.tabs-content{position:relative}.tabs-content>.tab-item{width:100%;display:none}.tabs-content>.tab-item.active{display:block;opacity:0;animation:tabChange .2s forwards}.tabs-content>.tab-item>:first-child{margin-top:0}.tabs-content>.tab-item>:last-child{margin-bottom:0}.tabs-content.no-animations>.tab-item.active{opacity:1;animation:none}.tabs{position:relative}.accordion{outline:0;position:relative;border-radius:var(--baseRadius);background:var(--baseColor);border:1px solid var(--baseAlt2Color);transition:border-radius var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed),margin var(--baseAnimationSpeed)}.accordion .accordion-header{outline:0;position:relative;display:flex;min-height:52px;align-items:center;row-gap:10px;column-gap:var(--smSpacing);padding:12px 20px 10px;width:100%;-webkit-user-select:none;user-select:none;color:var(--txtPrimaryColor);border-radius:inherit;transition:border-radius var(--baseAnimationSpeed),background var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.accordion .accordion-header .icon{width:18px;text-align:center}.accordion .accordion-header .icon i{display:inline-block;vertical-align:top;font-size:1.1rem}.accordion .accordion-header.interactive{padding-right:50px;cursor:pointer}.accordion .accordion-header.interactive:after{content:"";position:absolute;right:15px;top:50%;margin-top:-12.5px;width:25px;height:25px;line-height:25px;color:var(--txtHintColor);font-family:var(--iconFontFamily);font-size:1.3em;text-align:center;transition:color var(--baseAnimationSpeed)}.accordion .accordion-header:hover:after,.accordion .accordion-header.focus:after,.accordion .accordion-header:focus-visible:after{color:var(--txtPrimaryColor)}.accordion .accordion-header:active{transition-duration:var(--activeAnimationSpeed)}.accordion .accordion-content{padding:20px}.accordion:hover,.accordion:focus-visible,.accordion.active{z-index:9}.accordion:hover .accordion-header.interactive,.accordion:focus-visible .accordion-header.interactive,.accordion.active .accordion-header.interactive{background:var(--baseAlt1Color)}.accordion.drag-over .accordion-header{background:var(--bodyColor)}.accordion.active{box-shadow:0 2px 5px 0 var(--shadowColor)}.accordion.active .accordion-header{position:relative;top:0;z-index:9;box-shadow:0 0 0 1px var(--baseAlt2Color);border-bottom-left-radius:0;border-bottom-right-radius:0;background:var(--bodyColor)}.accordion.active .accordion-header.interactive{background:var(--bodyColor)}.accordion.active .accordion-header.interactive:after{color:inherit;content:""}.accordion.disabled{z-index:0;border-color:var(--baseAlt1Color)}.accordion.disabled .accordion-header{color:var(--txtDisabledColor)}.accordions .accordion{border-radius:0;margin:-1px 0 0}.accordions .accordion:has(+.accordion.active){border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius)}.accordions>.accordion.active,.accordions>.accordion-wrapper>.accordion.active{margin:var(--smSpacing) 0;border-radius:var(--baseRadius)}.accordions>.accordion.active+.accordion,.accordions>.accordion-wrapper>.accordion.active+.accordion{border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.accordions>.accordion:first-child,.accordions>.accordion-wrapper:first-child>.accordion{margin-top:0;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.accordions>.accordion:last-child,.accordions>.accordion-wrapper:last-child>.accordion{margin-bottom:0;border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius)}table{--entranceAnimationSpeed: .3s;border-collapse:separate;min-width:100%;transition:opacity var(--baseAnimationSpeed)}table .form-field{margin:0;line-height:1;text-align:left}table td,table th{outline:0;vertical-align:middle;position:relative;text-align:left;padding:10px;border-bottom:1px solid var(--baseAlt2Color)}table td:first-child,table th:first-child{padding-left:20px}table td:last-child,table th:last-child{padding-right:20px}table th{color:var(--txtHintColor);font-weight:600;font-size:1rem;-webkit-user-select:none;user-select:none;height:50px;line-height:var(--smLineHeight)}table th i{font-size:inherit}table td{height:60px;word-break:break-word}table .min-width{width:1%!important;white-space:nowrap}table .nowrap{white-space:nowrap}table .col-sort{cursor:pointer;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius);padding-right:30px;transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}table .col-sort:after{content:"";position:absolute;right:10px;top:50%;margin-top:-12.5px;line-height:25px;height:25px;font-family:var(--iconFontFamily);font-weight:400;color:var(--txtHintColor);opacity:0;transition:color var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed)}table .col-sort.sort-desc:after{content:""}table .col-sort.sort-asc:after{content:""}table .col-sort.sort-active:after{opacity:1}table .col-sort:hover,table .col-sort:focus-visible{background:var(--baseAlt1Color)}table .col-sort:hover:after,table .col-sort:focus-visible:after{opacity:1}table .col-sort:active{transition-duration:var(--activeAnimationSpeed);background:var(--baseAlt2Color)}table .col-sort.col-sort-disabled{cursor:default;background:none}table .col-sort.col-sort-disabled:after{display:none}table .col-header-content{display:inline-flex;align-items:center;flex-wrap:nowrap;gap:5px}table .col-header-content .txt{max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}table td.col-field-username,table .col-field-created,table .col-field-updated,table .col-type-action{width:1%!important;white-space:nowrap}table .col-type-action{white-space:nowrap;text-align:right;color:var(--txtHintColor)}table .col-type-action i{display:inline-block;vertical-align:top;transition:transform var(--baseAnimationSpeed)}table td.col-type-json{font-family:monospace;font-size:var(--smFontSize);line-height:var(--smLineHeight);max-width:300px}table .col-type-text{max-width:300px}table .col-type-editor{min-width:300px}table .col-type-select{min-width:150px}table .col-type-email{min-width:120px;white-space:nowrap}table .col-type-file{min-width:100px}table .col-type-number{white-space:nowrap}table td.col-field-id{width:175px;white-space:nowrap}table tr{outline:0;background:var(--bodyColor);transition:background var(--baseAnimationSpeed)}table tr.row-handle{cursor:pointer;-webkit-user-select:none;user-select:none}table tr.row-handle:focus-visible,table tr.row-handle:hover,table tr.row-handle:active{background:var(--baseAlt1Color)}table tr.row-handle:focus-visible .action-col,table tr.row-handle:hover .action-col,table tr.row-handle:active .action-col{color:var(--txtPrimaryColor)}table tr.row-handle:focus-visible .action-col i,table tr.row-handle:hover .action-col i,table tr.row-handle:active .action-col i{transform:translate(3px)}table tr.row-handle:active{transition-duration:var(--activeAnimationSpeed)}table.table-border{border:1px solid var(--baseAlt2Color);border-radius:var(--baseRadius)}table.table-border tr{background:var(--baseColor)}table.table-border td,table.table-border th{height:45px}table.table-border th{background:var(--baseAlt1Color)}table.table-border>:last-child>:last-child th,table.table-border>:last-child>:last-child td{border-bottom:0}table.table-border>tr:first-child>:first-child,table.table-border>:first-child>tr:first-child>:first-child{border-top-left-radius:var(--baseRadius)}table.table-border>tr:first-child>:last-child,table.table-border>:first-child>tr:first-child>:last-child{border-top-right-radius:var(--baseRadius)}table.table-border>tr:last-child>:first-child,table.table-border>:last-child>tr:last-child>:first-child{border-bottom-left-radius:var(--baseRadius)}table.table-border>tr:last-child>:last-child,table.table-border>:last-child>tr:last-child>:last-child{border-bottom-right-radius:var(--baseRadius)}table.table-compact td,table.table-compact th{height:auto}table.table-animate tr{animation:entranceTop var(--entranceAnimationSpeed)}table.table-loading{pointer-events:none;opacity:.7}.table-wrapper{width:auto;padding:0;max-height:100%;max-width:calc(100% + 2 * var(--baseSpacing));margin-left:calc(var(--baseSpacing) * -1);margin-right:calc(var(--baseSpacing) * -1);border-bottom:1px solid var(--baseAlt2Color)}.table-wrapper .bulk-select-col{min-width:70px}.table-wrapper td,.table-wrapper th{position:relative}.table-wrapper td:first-child,.table-wrapper th:first-child{padding-left:calc(var(--baseSpacing) + 3px)}.table-wrapper td:last-child,.table-wrapper th:last-child{padding-right:calc(var(--baseSpacing) + 3px)}.table-wrapper thead{position:sticky;top:0;z-index:100;transition:box-shadow var(--baseAnimationSpeed)}.table-wrapper tbody{position:relative;z-index:0}.table-wrapper tbody tr:last-child td,.table-wrapper tbody tr:last-child th{border-bottom:0}.table-wrapper .bulk-select-col,.table-wrapper .col-type-action{position:sticky;z-index:99;transition:box-shadow var(--baseAnimationSpeed)}.table-wrapper .bulk-select-col{left:0}.table-wrapper .col-type-action{right:0}.table-wrapper .bulk-select-col,.table-wrapper .col-type-action{background:inherit}.table-wrapper th.bulk-select-col,.table-wrapper th.col-type-action{background:var(--bodyColor)}.table-wrapper.h-scroll .bulk-select-col{box-shadow:3px 0 5px 0 var(--shadowColor)}.table-wrapper.h-scroll .col-type-action{box-shadow:-3px 0 5px 0 var(--shadowColor)}.table-wrapper.h-scroll.h-scroll-start .bulk-select-col,.table-wrapper.h-scroll.h-scroll-end .col-type-action{box-shadow:none}.table-wrapper.v-scroll:not(.v-scroll-start) thead{box-shadow:0 2px 5px 0 var(--shadowColor)}.searchbar{--searchHeight: 44px;outline:0;display:flex;align-items:center;min-height:var(--searchHeight);width:100%;padding:5px 7px;margin:0;white-space:nowrap;color:var(--txtHintColor);background:var(--baseAlt1Color);border-radius:var(--btnHeight);transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.searchbar>:first-child{border-top-left-radius:var(--btnHeight);border-bottom-left-radius:var(--btnHeight)}.searchbar>:last-child{border-top-right-radius:var(--btnHeight);border-bottom-right-radius:var(--btnHeight)}.searchbar .btn{border-radius:var(--btnHeight)}.searchbar .code-editor,.searchbar input,.searchbar input:focus{font-size:var(--baseFontSize);font-family:var(--monospaceFontFamily);border:0;background:none;min-height:0;padding-top:0;padding-bottom:0}.searchbar label>i{line-height:inherit}.searchbar .search-options{flex-shrink:0;width:90px}.searchbar .search-options .selected-container{border-radius:inherit;background:none;padding-right:25px!important}.searchbar .search-options:not(:focus-within) .selected-container{color:var(--txtHintColor)}.searchbar:focus-within{color:var(--txtPrimaryColor);background:var(--baseAlt2Color)}.bulkbar{position:absolute;bottom:var(--baseSpacing);left:50%;z-index:101;gap:10px;display:flex;justify-content:center;align-items:center;width:var(--smWrapperWidth);max-width:100%;margin-bottom:10px;padding:10px var(--smSpacing);border-radius:var(--btnHeight);background:var(--baseColor);border:1px solid var(--baseAlt2Color);box-shadow:0 2px 5px 0 var(--shadowColor);transform:translate(-50%)}.flatpickr-calendar{opacity:0;display:none;text-align:center;visibility:hidden;padding:0;animation:none;direction:ltr;border:0;font-size:1rem;line-height:24px;position:absolute;width:298px;box-sizing:border-box;-webkit-user-select:none;user-select:none;color:var(--txtPrimaryColor);background:var(--baseColor);border-radius:var(--baseRadius);box-shadow:0 2px 5px 0 var(--shadowColor),0 0 0 1px var(--baseAlt2Color)}.flatpickr-calendar input,.flatpickr-calendar select{box-shadow:none;min-height:0;height:var(--smBtnHeight);padding-top:3px;padding-bottom:3px;background:none;border-radius:var(--baseRadius);border:1px solid var(--baseAlt1Color)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:0;width:100%}.flatpickr-calendar.static{position:absolute;top:100%;margin-top:2px;margin-bottom:10px;width:100%}.flatpickr-calendar.static .flatpickr-days{width:100%}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 var(--baseAlt2Color),5px 0 0 var(--baseAlt2Color);box-shadow:-2px 0 0 var(--baseAlt2Color),5px 0 0 var(--baseAlt2Color)}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid var(--baseAlt2Color)}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:var(--baseColor)}.flatpickr-calendar.arrowTop:after{border-bottom-color:var(--baseColor)}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:var(--baseColor)}.flatpickr-calendar.arrowBottom:after{border-top-color:var(--baseColor)}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative}.flatpickr-months{display:flex;align-items:center;padding:5px 0}.flatpickr-months .flatpickr-month{display:flex;align-items:center;justify-content:center;background:transparent;color:var(--txtPrimaryColor);fill:var(--txtPrimaryColor);line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{display:flex;align-items:center;text-decoration:none;cursor:pointer;height:34px;padding:5px 12px;z-index:3;color:var(--txtPrimaryColor);fill:var(--txtPrimaryColor)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:var(--txtHintColor)}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto;border-radius:var(--baseRadius)}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:#00000080}.numInputWrapper:hover{background:var(--baseAlt1Color)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{line-height:inherit;color:inherit;width:85%;padding:1px 0;line-height:1;display:flex;gap:10px;align-items:center;justify-content:center;text-align:center}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:var(--baseAlt1Color)}.flatpickr-current-month .numInputWrapper{display:inline-flex;align-items:center;justify-content:center;width:62px}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:var(--txtPrimaryColor)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:var(--txtPrimaryColor)}.flatpickr-current-month input.cur-year{background:transparent;box-sizing:border-box;color:inherit;cursor:text;margin:0;display:inline-block;font-size:inherit;font-family:inherit;line-height:inherit;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{color:var(--txtDisabledColor);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;line-height:inherit;outline:none;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:var(--baseAlt1Color)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{display:block;flex:1;margin:0;cursor:default;line-height:1;background:transparent;color:var(--txtHintColor);text-align:center;font-weight:bolder;font-size:var(--smFontSize)}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:100%;box-sizing:border-box;display:inline-block;display:flex;flex-wrap:wrap;transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 var(--baseAlt2Color);box-shadow:-1px 0 0 var(--baseAlt2Color)}.flatpickr-day{background:none;border:1px solid transparent;border-radius:var(--baseRadius);box-sizing:border-box;color:var(--txtPrimaryColor);cursor:pointer;font-weight:400;width:calc(14.2857143% - 2px);flex-basis:calc(14.2857143% - 2px);height:39px;margin:1px;display:inline-flex;align-items:center;justify-content:center;position:relative;text-align:center;flex-direction:column}.flatpickr-day.weekend,.flatpickr-day:nth-child(7n+6),.flatpickr-day:nth-child(7n+7){color:var(--dangerColor)}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:var(--baseAlt2Color);border-color:var(--baseAlt2Color)}.flatpickr-day.today{border-color:var(--baseColor)}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:var(--primaryColor);background:var(--primaryColor);color:var(--baseColor)}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:var(--primaryColor);-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:var(--primaryColor)}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 var(--primaryColor);box-shadow:-10px 0 0 var(--primaryColor)}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;box-shadow:-5px 0 0 var(--baseAlt2Color),5px 0 0 var(--baseAlt2Color)}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:var(--txtDisabledColor);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:var(--txtDisabledColor);background:var(--baseAlt2Color)}.flatpickr-day.week.selected{border-radius:0;box-shadow:-5px 0 0 var(--primaryColor),5px 0 0 var(--primaryColor)}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 var(--baseAlt2Color);box-shadow:1px 0 0 var(--baseAlt2Color)}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:var(--txtHintColor);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:flex;box-sizing:border-box;overflow:hidden;padding:5px}.flatpickr-rContainer{display:inline-block;padding:0;width:100%;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:var(--txtPrimaryColor)}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:var(--txtPrimaryColor)}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;box-shadow:none;border:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:var(--txtPrimaryColor);font-size:14px;position:relative;box-sizing:border-box;background:var(--baseColor);-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:var(--txtPrimaryColor);font-weight:700;width:2%;-webkit-user-select:none;user-select:none;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:var(--baseAlt1Color)}.flatpickr-input[readonly]{cursor:pointer}@keyframes fpFadeInDown{0%{opacity:0;transform:translate3d(0,10px,0)}to{opacity:1;transform:translateZ(0)}}.flatpickr-hide-prev-next-month-days .flatpickr-calendar .prevMonthDay{visibility:hidden}.flatpickr-hide-prev-next-month-days .flatpickr-calendar .nextMonthDay,.flatpickr-inline-container .flatpickr-input{display:none}.flatpickr-inline-container .flatpickr-calendar{margin:0;box-shadow:none;border:1px solid var(--baseAlt2Color)}.docs-sidebar{--itemsSpacing: 10px;--itemsHeight: 40px;position:relative;min-width:180px;max-width:300px;height:100%;flex-shrink:0;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;background:var(--bodyColor);padding:var(--smSpacing) var(--xsSpacing);border-right:1px solid var(--baseAlt1Color)}.docs-sidebar .sidebar-content{display:block;width:100%}.docs-sidebar .sidebar-item{position:relative;outline:0;cursor:pointer;text-decoration:none;display:flex;width:100%;gap:10px;align-items:center;text-align:right;justify-content:start;padding:5px 15px;margin:0 0 var(--itemsSpacing) 0;font-size:var(--lgFontSize);min-height:var(--itemsHeight);border-radius:var(--baseRadius);-webkit-user-select:none;user-select:none;color:var(--txtHintColor);transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.docs-sidebar .sidebar-item:last-child{margin-bottom:0}.docs-sidebar .sidebar-item:focus-visible,.docs-sidebar .sidebar-item:hover,.docs-sidebar .sidebar-item:active,.docs-sidebar .sidebar-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.docs-sidebar .sidebar-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.docs-sidebar.compact .sidebar-item{--itemsSpacing: 7px}.docs-content{width:100%;display:block;padding:calc(var(--baseSpacing) - 3px) var(--baseSpacing);overflow:auto}.docs-content-wrapper{display:flex;width:100%;height:100%}.docs-panel{width:960px;height:100%}.docs-panel .overlay-panel-section.panel-header{padding:0;border:0;box-shadow:none}.docs-panel .overlay-panel-section.panel-content{padding:0!important}.docs-panel .overlay-panel-section.panel-footer{display:none}@media screen and (max-width: 1000px){.docs-panel .overlay-panel-section.panel-footer{display:flex}}.schema-field-header{position:relative;display:flex;width:100%;min-height:42px;gap:5px;padding:0 5px;align-items:center;justify-content:stretch;background:var(--baseAlt1Color);border-radius:var(--baseRadius);transition:border-radius var(--baseAnimationSpeed)}.schema-field-header .form-field{margin:0}.schema-field-header .form-field .form-field-addon.prefix{left:10px}.schema-field-header .form-field .form-field-addon.prefix~input,.schema-field-header .form-field .form-field-addon.prefix~select,.schema-field-header .form-field .form-field-addon.prefix~textarea,.schema-field-header .form-field .select .form-field-addon.prefix~.selected-container,.select .schema-field-header .form-field .form-field-addon.prefix~.selected-container,.schema-field-header .form-field .form-field-addon.prefix~.code-editor,.schema-field-header .form-field .form-field-addon.prefix~.tinymce-wrapper{padding-left:37px}.schema-field-header .options-trigger{padding:2px;margin:0 3px}.schema-field-header .options-trigger i{transition:transform var(--baseAnimationSpeed)}.schema-field-header .separator{flex-shrink:0;width:1px;height:42px;background:rgba(0,0,0,.05)}.schema-field-header .drag-handle-wrapper{position:absolute;top:0;left:auto;right:100%;height:100%;display:flex;align-items:center}.schema-field-header .drag-handle{padding:0 5px;transform:translate(5px);opacity:0;visibility:hidden}.schema-field-header .form-field-single-multiple-select{width:100px;flex-shrink:0}.schema-field-header .form-field-single-multiple-select .dropdown{min-width:0}.schema-field-header .field-labels{position:absolute;z-index:1;right:0;top:0;gap:2px;display:inline-flex;align-items:center;transition:opacity var(--baseAnimationSpeed)}.schema-field-header .field-labels .label{min-height:0;font-size:inherit;padding:0 2px;font-size:.7rem;line-height:.75rem;border-radius:var(--baseRadius)}.schema-field-header .field-labels~.inline-error-icon{margin-top:4px}.schema-field-header .field-labels~.inline-error-icon i{font-size:1rem}.schema-field-header .form-field:focus-within .field-labels{opacity:.2}.schema-field-options{background:#fff;padding:var(--xsSpacing);border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius);border-top:2px solid transparent;transition:border-color var(--baseAnimationSpeed)}.schema-field-options-footer{display:flex;flex-wrap:wrap;align-items:center;width:100%;min-width:0;gap:var(--baseSpacing)}.schema-field-options-footer .form-field{margin:0;width:auto}.schema-field{position:relative;margin:0 0 var(--xsSpacing);border-radius:var(--baseRadius);background:var(--baseAlt1Color);transition:border var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed);border:2px solid var(--baseAlt1Color)}.schema-field:not(.deleted):hover .drag-handle{transform:translate(0);opacity:1;visibility:visible}.dragover .schema-field,.schema-field.dragover{opacity:.5}.schema-field.expanded{box-shadow:0 2px 5px 0 var(--shadowColor);border-color:var(--baseAlt2Color)}.schema-field.expanded .schema-field-header{border-bottom-left-radius:0;border-bottom-right-radius:0}.schema-field.expanded .schema-field-header .options-trigger i{transform:rotate(-60deg)}.schema-field.expanded .schema-field-options{border-top-color:var(--baseAlt2Color)}.schema-field.deleted .schema-field-header{background:var(--bodyColor)}.schema-field.deleted .markers,.schema-field.deleted .separator{opacity:.5}.schema-field.deleted input,.schema-field.deleted select,.schema-field.deleted textarea,.schema-field.deleted .select .selected-container,.select .schema-field.deleted .selected-container,.schema-field.deleted .code-editor,.schema-field.deleted .tinymce-wrapper{background:none;box-shadow:none}.file-picker-sidebar{flex-shrink:0;width:180px;text-align:right;max-height:100%;overflow:auto}.file-picker-sidebar .sidebar-item{outline:0;cursor:pointer;text-decoration:none;display:flex;width:100%;align-items:center;text-align:left;gap:10px;font-weight:600;padding:5px 10px;margin:0 0 10px;color:var(--txtHintColor);min-height:var(--btnHeight);border-radius:var(--baseRadius);word-break:break-word;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.file-picker-sidebar .sidebar-item:last-child{margin-bottom:0}.file-picker-sidebar .sidebar-item:hover,.file-picker-sidebar .sidebar-item:focus-visible,.file-picker-sidebar .sidebar-item:active,.file-picker-sidebar .sidebar-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.file-picker-sidebar .sidebar-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.files-list{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--xsSpacing);flex-grow:1;min-height:0;max-height:100%;overflow:auto;scrollbar-gutter:stable}.files-list .list-item{cursor:pointer;outline:0;transition:box-shadow var(--baseAnimationSpeed)}.file-picker-size-select{width:170px;margin:0}.file-picker-size-select .selected-container{min-height:var(--btnHeight)}.file-picker-content{position:relative;display:flex;flex-direction:column;width:100%;flex-grow:1;min-width:0;min-height:0;height:100%}.file-picker-content .thumb{--thumbSize: 14.6%}.file-picker{display:flex;height:420px;max-height:100%;align-items:stretch;gap:var(--baseSpacing)}.overlay-panel.file-picker-popup{width:930px}.panel-wrapper.svelte-lxxzfu{animation:slideIn .2s}@keyframes svelte-1bvelc2-refresh{to{transform:rotate(180deg)}}.btn.refreshing.svelte-1bvelc2 i.svelte-1bvelc2{animation:svelte-1bvelc2-refresh .15s ease-out}.scroller.svelte-3a0gfs{width:auto;min-height:0;overflow:auto}.scroller-wrapper.svelte-3a0gfs{position:relative;min-height:0}.scroller-wrapper .columns-dropdown{top:40px;z-index:101;max-height:340px}.log-level-label.svelte-ha6hme{min-width:75px;font-weight:600;font-size:var(--xsFontSize)}.log-level-label.svelte-ha6hme:before{content:"";width:5px;height:5px;border-radius:5px;background:var(--baseAlt4Color)}.log-level-label.level--8.svelte-ha6hme:before{background:var(--primaryColor)}.log-level-label.level-0.svelte-ha6hme:before{background:var(--infoColor)}.log-level-label.level-4.svelte-ha6hme:before{background:var(--warningColor)}.log-level-label.level-8.svelte-ha6hme:before{background:var(--dangerColor)}.bulkbar.svelte-pk7op9{position:sticky;margin-top:var(--smSpacing);bottom:var(--baseSpacing)}.chart-wrapper.svelte-12c378i.svelte-12c378i{position:relative;display:block;width:100%;height:170px}.chart-wrapper.loading.svelte-12c378i .chart-canvas.svelte-12c378i{pointer-events:none;opacity:.5}.chart-loader.svelte-12c378i.svelte-12c378i{position:absolute;z-index:999;top:50%;left:50%;transform:translate(-50%,-50%)}.total-logs.svelte-12c378i.svelte-12c378i{position:absolute;right:0;top:-50px;font-size:var(--smFontSize);color:var(--txtHintColor)}.prism-light code[class*=language-],.prism-light pre[class*=language-]{color:#111b27;background:0 0;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}.prism-light code[class*=language-] ::-moz-selection,.prism-light code[class*=language-]::-moz-selection,.prism-light pre[class*=language-] ::-moz-selection,.prism-light pre[class*=language-]::-moz-selection{background:#8da1b9}.prism-light code[class*=language-] ::selection,.prism-light code[class*=language-]::selection,.prism-light pre[class*=language-] ::selection,.prism-light pre[class*=language-]::selection{background:#8da1b9}.prism-light pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}.prism-light :not(pre)>code[class*=language-],.prism-light pre[class*=language-]{background:#e3eaf2}.prism-light :not(pre)>code[class*=language-]{padding:.1em .3em;border-radius:.3em;white-space:normal}.prism-light .token.cdata,.prism-light .token.comment,.prism-light .token.doctype,.prism-light .token.prolog{color:#3c526d}.prism-light .token.punctuation{color:#111b27}.prism-light .token.delimiter.important,.prism-light .token.selector .parent,.prism-light .token.tag,.prism-light .token.tag .token.punctuation{color:#006d6d}.prism-light .token.attr-name,.prism-light .token.boolean,.prism-light .token.boolean.important,.prism-light .token.constant,.prism-light .token.number,.prism-light .token.selector .token.attribute{color:#755f00}.prism-light .token.class-name,.prism-light .token.key,.prism-light .token.parameter,.prism-light .token.property,.prism-light .token.property-access,.prism-light .token.variable{color:#005a8e}.prism-light .token.attr-value,.prism-light .token.color,.prism-light .token.inserted,.prism-light .token.selector .token.value,.prism-light .token.string,.prism-light .token.string .token.url-link{color:#116b00}.prism-light .token.builtin,.prism-light .token.keyword-array,.prism-light .token.package,.prism-light .token.regex{color:#af00af}.prism-light .token.function,.prism-light .token.selector .token.class,.prism-light .token.selector .token.id{color:#7c00aa}.prism-light .token.atrule .token.rule,.prism-light .token.combinator,.prism-light .token.keyword,.prism-light .token.operator,.prism-light .token.pseudo-class,.prism-light .token.pseudo-element,.prism-light .token.selector,.prism-light .token.unit{color:#a04900}.prism-light .token.deleted,.prism-light .token.important{color:#c22f2e}.prism-light .token.keyword-this,.prism-light .token.this{color:#005a8e}.prism-light .token.bold,.prism-light .token.important,.prism-light .token.keyword-this,.prism-light .token.this{font-weight:700}.prism-light .token.delimiter.important{font-weight:inherit}.prism-light .token.italic{font-style:italic}.prism-light .token.entity{cursor:help}.prism-light .language-markdown .token.title,.prism-light .language-markdown .token.title .token.punctuation{color:#005a8e;font-weight:700}.prism-light .language-markdown .token.blockquote.punctuation{color:#af00af}.prism-light .language-markdown .token.code{color:#006d6d}.prism-light .language-markdown .token.hr.punctuation{color:#005a8e}.prism-light .language-markdown .token.url>.token.content{color:#116b00}.prism-light .language-markdown .token.url-link{color:#755f00}.prism-light .language-markdown .token.list.punctuation{color:#af00af}.prism-light .language-markdown .token.table-header,.prism-light .language-json .token.operator{color:#111b27}.prism-light .language-scss .token.variable{color:#006d6d}.prism-light .token.token.cr:before,.prism-light .token.token.lf:before,.prism-light .token.token.space:before,.prism-light .token.token.tab:not(:empty):before{color:#3c526d}.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>a,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>button{color:#e3eaf2;background:#005a8e}.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>a:focus,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>a:hover,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>button:focus,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>button:hover{color:#e3eaf2;background:rgba(0,90,142,.8549019608);text-decoration:none}.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>span,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>span:focus,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>span:hover{color:#e3eaf2;background:#3c526d}.prism-light .line-highlight.line-highlight{background:rgba(141,161,185,.1843137255);background:linear-gradient(to right,rgba(141,161,185,.1843137255) 70%,rgba(141,161,185,.1450980392))}.prism-light .line-highlight.line-highlight:before,.prism-light .line-highlight.line-highlight[data-end]:after{background-color:#3c526d;color:#e3eaf2;box-shadow:0 1px #8da1b9}.prism-light pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:#3c526d1f}.prism-light .line-numbers.line-numbers .line-numbers-rows{border-right:1px solid rgba(141,161,185,.4784313725);background:rgba(208,218,231,.4784313725)}.prism-light .line-numbers .line-numbers-rows>span:before{color:#3c526dda}.prism-light .rainbow-braces .token.token.punctuation.brace-level-1,.prism-light .rainbow-braces .token.token.punctuation.brace-level-5,.prism-light .rainbow-braces .token.token.punctuation.brace-level-9{color:#755f00}.prism-light .rainbow-braces .token.token.punctuation.brace-level-10,.prism-light .rainbow-braces .token.token.punctuation.brace-level-2,.prism-light .rainbow-braces .token.token.punctuation.brace-level-6{color:#af00af}.prism-light .rainbow-braces .token.token.punctuation.brace-level-11,.prism-light .rainbow-braces .token.token.punctuation.brace-level-3,.prism-light .rainbow-braces .token.token.punctuation.brace-level-7{color:#005a8e}.prism-light .rainbow-braces .token.token.punctuation.brace-level-12,.prism-light .rainbow-braces .token.token.punctuation.brace-level-4,.prism-light .rainbow-braces .token.token.punctuation.brace-level-8{color:#7c00aa}.prism-light pre.diff-highlight>code .token.token.deleted:not(.prefix),.prism-light pre>code.diff-highlight .token.token.deleted:not(.prefix){background-color:#c22f2e1f}.prism-light pre.diff-highlight>code .token.token.inserted:not(.prefix),.prism-light pre>code.diff-highlight .token.token.inserted:not(.prefix){background-color:#116b001f}.prism-light .command-line .command-line-prompt{border-right:1px solid rgba(141,161,185,.4784313725)}.prism-light .command-line .command-line-prompt>span:before{color:#3c526dda}code.svelte-10s5tkd.svelte-10s5tkd{display:block;width:100%;padding:10px 15px;white-space:pre-wrap;word-break:break-word}.code-wrapper.svelte-10s5tkd.svelte-10s5tkd{display:block;width:100%;max-height:100%;overflow:auto;overflow:overlay}.prism-light.svelte-10s5tkd code.svelte-10s5tkd{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.dragline.svelte-1g2t3dj{position:relative;z-index:101;left:0;top:0;height:100%;width:5px;padding:0;margin:0 -3px 0 -1px;background:none;cursor:ew-resize;box-sizing:content-box;transition:box-shadow var(--activeAnimationSpeed);box-shadow:inset 1px 0 0 0 var(--baseAlt2Color)}.dragline.svelte-1g2t3dj:hover,.dragline.dragging.svelte-1g2t3dj{box-shadow:inset 3px 0 0 0 var(--baseAlt2Color)}.indexes-list.svelte-167lbwu{display:flex;flex-wrap:wrap;width:100%;gap:10px}.label.svelte-167lbwu{overflow:hidden;min-width:50px}.field-types-btn.active.svelte-1gz9b6p{border-bottom-left-radius:0;border-bottom-right-radius:0}.field-types-dropdown{display:flex;flex-wrap:wrap;width:100%;max-width:none;padding:10px;margin-top:2px;border:0;box-shadow:0 0 0 2px var(--primaryColor);border-top-left-radius:0;border-top-right-radius:0}.field-types-dropdown .dropdown-item.svelte-1gz9b6p{width:25%}.form-field-file-max-select{width:100px;flex-shrink:0}.draggable.svelte-28orm4{-webkit-user-select:none;user-select:none;outline:0;min-width:0}.lock-toggle.svelte-1akuazq.svelte-1akuazq{position:absolute;right:0;top:0;min-width:135px;padding:10px;border-top-left-radius:0;border-bottom-right-radius:0;background:rgba(53,71,104,.09)}.rule-field .code-editor .cm-placeholder{font-family:var(--baseFontFamily)}.input-wrapper.svelte-1akuazq.svelte-1akuazq{position:relative}.unlock-overlay.svelte-1akuazq.svelte-1akuazq{--hoverAnimationSpeed:.2s;position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;display:flex;padding:20px;gap:10px;align-items:center;justify-content:end;text-align:center;border-radius:var(--baseRadius);background:rgba(255,255,255,.2);outline:0;cursor:pointer;text-decoration:none;color:var(--successColor);border:2px solid var(--baseAlt1Color);transition:border-color var(--baseAnimationSpeed)}.unlock-overlay.svelte-1akuazq i.svelte-1akuazq{font-size:inherit}.unlock-overlay.svelte-1akuazq .icon.svelte-1akuazq{color:var(--successColor);font-size:1.15rem;line-height:1;font-weight:400;transition:transform var(--hoverAnimationSpeed)}.unlock-overlay.svelte-1akuazq .txt.svelte-1akuazq{opacity:0;font-size:var(--xsFontSize);font-weight:600;line-height:var(--smLineHeight);transform:translate(5px);transition:transform var(--hoverAnimationSpeed),opacity var(--hoverAnimationSpeed)}.unlock-overlay.svelte-1akuazq.svelte-1akuazq:hover,.unlock-overlay.svelte-1akuazq.svelte-1akuazq:focus-visible,.unlock-overlay.svelte-1akuazq.svelte-1akuazq:active{border-color:var(--baseAlt3Color)}.unlock-overlay.svelte-1akuazq:hover .icon.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:focus-visible .icon.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:active .icon.svelte-1akuazq{transform:scale(1.1)}.unlock-overlay.svelte-1akuazq:hover .txt.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:focus-visible .txt.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:active .txt.svelte-1akuazq{opacity:1;transform:scale(1)}.unlock-overlay.svelte-1akuazq.svelte-1akuazq:active{transition-duration:var(--activeAnimationSpeed);border-color:var(--baseAlt3Color)}.changes-list.svelte-xqpcsf.svelte-xqpcsf{word-break:break-word;line-height:var(--smLineHeight)}.changes-list.svelte-xqpcsf li.svelte-xqpcsf{margin-top:10px;margin-bottom:10px}.upsert-panel-title.svelte-12y0yzb{display:inline-flex;align-items:center;min-height:var(--smBtnHeight)}.tabs-content.svelte-12y0yzb:focus-within{z-index:9}.pin-collection.svelte-1u3ag8h.svelte-1u3ag8h{margin:0 -5px 0 -15px;opacity:0;transition:opacity var(--baseAnimationSpeed)}.pin-collection.svelte-1u3ag8h i.svelte-1u3ag8h{font-size:inherit}a.svelte-1u3ag8h:hover .pin-collection.svelte-1u3ag8h{opacity:.4}a.svelte-1u3ag8h:hover .pin-collection.svelte-1u3ag8h:hover{opacity:1}.secret.svelte-1md8247{font-family:monospace;font-weight:400;-webkit-user-select:all;user-select:all}.email-visibility-addon.svelte-1751a4d~input.svelte-1751a4d{padding-right:100px}textarea.svelte-1x1pbts{resize:none;padding-top:4px!important;padding-bottom:5px!important;min-height:var(--inputHeight);height:var(--inputHeight)}.clear-btn.svelte-11df51y{margin-top:20px}.json-state.svelte-p6ecb8{position:absolute;right:10px}.record-info.svelte-fhw3qk.svelte-fhw3qk{display:inline-flex;vertical-align:top;align-items:center;max-width:100%;min-width:0;gap:5px;line-height:normal}.record-info.svelte-fhw3qk>.svelte-fhw3qk{line-height:inherit}.record-info.svelte-fhw3qk .thumb{box-shadow:none}.picker-list.svelte-1u8jhky{max-height:380px}.selected-list.svelte-1u8jhky{display:flex;flex-wrap:wrap;align-items:center;gap:10px;max-height:220px;overflow:auto}.relations-list.svelte-1ynw0pc{max-height:300px;overflow:auto;overflow:overlay}.panel-title.svelte-qc5ngu{line-height:var(--smBtnHeight)}.datetime.svelte-5pjd03{display:inline-block;vertical-align:top;white-space:nowrap;line-height:var(--smLineHeight)}.time.svelte-5pjd03{font-size:var(--smFontSize);color:var(--txtHintColor)}.fallback-block.svelte-jdf51v{max-height:100px;overflow:auto}.col-field.svelte-1nt58f7{max-width:1px}.export-preview.svelte-jm5c4z.svelte-jm5c4z{position:relative;height:500px}.export-preview.svelte-jm5c4z .copy-schema.svelte-jm5c4z{position:absolute;right:15px;top:15px}.collections-diff-table.svelte-lmkr38.svelte-lmkr38{color:var(--txtHintColor);border:2px solid var(--primaryColor)}.collections-diff-table.svelte-lmkr38 tr.svelte-lmkr38{background:none}.collections-diff-table.svelte-lmkr38 th.svelte-lmkr38,.collections-diff-table.svelte-lmkr38 td.svelte-lmkr38{height:auto;padding:2px 15px;border-bottom:1px solid rgba(0,0,0,.07)}.collections-diff-table.svelte-lmkr38 th.svelte-lmkr38{height:35px;padding:4px 15px;color:var(--txtPrimaryColor)}.collections-diff-table.svelte-lmkr38 thead tr.svelte-lmkr38{background:var(--primaryColor)}.collections-diff-table.svelte-lmkr38 thead tr th.svelte-lmkr38{color:var(--baseColor);background:none}.collections-diff-table.svelte-lmkr38 .label.svelte-lmkr38{font-weight:400}.collections-diff-table.svelte-lmkr38 .changed-none-col.svelte-lmkr38{color:var(--txtDisabledColor);background:var(--baseAlt1Color)}.collections-diff-table.svelte-lmkr38 .changed-old-col.svelte-lmkr38{color:var(--txtPrimaryColor);background:var(--dangerAltColor)}.collections-diff-table.svelte-lmkr38 .changed-new-col.svelte-lmkr38{color:var(--txtPrimaryColor);background:var(--successAltColor)}.collections-diff-table.svelte-lmkr38 .field-key-col.svelte-lmkr38{padding-left:30px}.list-label.svelte-1jx20fl{min-width:65px}.popup-title.svelte-1fcgldh{max-width:80%}.list-content.svelte-1ulbkf5.svelte-1ulbkf5{overflow:auto;max-height:342px}.list-content.svelte-1ulbkf5 .list-item.svelte-1ulbkf5{min-height:49px}.backup-name.svelte-1ulbkf5.svelte-1ulbkf5{max-width:300px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} diff --git a/ui/dist/assets/index-102ce751.js b/ui/dist/assets/index-102ce751.js new file mode 100644 index 00000000..86cb1bcd --- /dev/null +++ b/ui/dist/assets/index-102ce751.js @@ -0,0 +1,13 @@ +class V{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ue.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),Ue.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new ci(this),r=new ci(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new ci(this,e)}iterRange(e,t=this.length){return new ul(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new dl(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?V.empty:e.length<=32?new X(e):Ue.from(X.split(e,[]))}}class X extends V{constructor(e,t=nc(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new sc(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new X(Tr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=en(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new X(l,o.length+r.length));else{let a=l.length>>1;i.push(new X(l.slice(0,a)),new X(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof X))return super.replace(e,t,i);let s=en(this.text,en(i.text,Tr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new X(s,r):Ue.from(X.split(s,[]),r)}sliceString(e,t=this.length,i=` +`){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new X(i,s)),i=[],s=-1);return s>-1&&t.push(new X(i,s)),t}}class Ue extends V{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new Ue(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` +`){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ue))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new X(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Ue)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof X&&a&&(p=c[c.length-1])instanceof X&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new X(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Ue.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Ue(l,t)}}V.empty=new X([""],0);function nc(n){let e=-1;for(let t of n)e+=t.length+1;return e}function en(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof X?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof X?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(s instanceof X){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof X?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ul{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new ci(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class dl{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(V.prototype[Symbol.iterator]=function(){return this.iter()},ci.prototype[Symbol.iterator]=ul.prototype[Symbol.iterator]=dl.prototype[Symbol.iterator]=function(){return this});class sc{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Ft="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return Ft[e-1]<=n;return!1}function Br(n){return n>=127462&&n<=127487}const Pr=8205;function ce(n,e,t=!0,i=!0){return(t?pl:oc)(n,e,i)}function pl(n,e,t){if(e==n.length)return e;e&&gl(n.charCodeAt(e))&&ml(n.charCodeAt(e-1))&&e--;let i=ne(n,e);for(e+=Be(i);e=0&&Br(ne(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function oc(n,e,t){for(;e>0;){let i=pl(n,e-2,t);if(i=56320&&n<57344}function ml(n){return n>=55296&&n<56320}function ne(n,e){let t=n.charCodeAt(e);if(!ml(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return gl(i)?(t-55296<<10)+(i-56320)+65536:t}function Zs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Be(n){return n<65536?1:2}const ls=/\r\n?|\n/;var le=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(le||(le={}));class _e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=le.Simple&&h>=e&&(i==le.TrackDel&&se||i==le.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new _e(e)}static create(e){return new _e(e)}}class ee extends _e{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return as(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return hs(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&<(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?V.of(d.split(i||ls)):d:V.empty,m=p.length;if(f==u&&m==0)return;fo&&oe(s,f-o,-1),oe(s,u-f,m),lt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new ee(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function lt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function hs(n,e,t,i=!1){let s=[],r=i?[]:null,o=new di(n),l=new di(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);oe(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class di{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?V.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?V.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class xt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new xt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new xt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>xt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function bl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let er=0;class O{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=er++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new O(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:tr),!!e.static,e.enables)}of(e){return new tn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new tn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new tn(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function tr(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class tn{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=er++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||cs(f,c)){let d=i(f);if(l?!Lr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=cn(u,p);if(this.dependencies.every(g=>g instanceof O?u.facet(g)===f.facet(g):g instanceof ye?u.field(g,!1)==f.field(g,!1):!0)||(l?Lr(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function Lr(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Rr).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Rr.of({field:this,create:e})]}get extension(){return this}}const wt={lowest:4,low:3,default:2,high:1,highest:0};function Zt(n){return e=>new wl(e,n)}const Tt={highest:Zt(wt.highest),high:Zt(wt.high),default:Zt(wt.default),low:Zt(wt.low),lowest:Zt(wt.lowest)};class wl{constructor(e,t){this.inner=e,this.prec=t}}class Tn{of(e){return new fs(this,e)}reconfigure(e){return Tn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class fs{constructor(e,t){this.compartment=e,this.inner=t}}class hn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of ac(e,t,o))u instanceof ye?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,tr(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>lc(g,p,d))}}let f=h.map(u=>u(l));return new hn(e,o,f,l,a,r)}}function ac(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof fs&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof fs){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof wl)r(o.inner,o.prec);else if(o instanceof ye)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof tn)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,wt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,wt.default),i.reduce((o,l)=>o.concat(l))}function fi(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function cn(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const xl=O.define(),vl=O.define({combine:n=>n.some(e=>e),static:!0}),kl=O.define({combine:n=>n.length?n[0]:void 0,static:!0}),Sl=O.define(),Cl=O.define(),Al=O.define(),Ml=O.define({combine:n=>n.length?n[0]:!1});class nt{constructor(e,t){this.type=e,this.value=t}static define(){return new hc}}class hc{of(e){return new nt(this,e)}}class cc{constructor(e){this.map=e}of(e){return new F(this,e)}}class F{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new F(this.type,t)}is(e){return this.type==e}static define(e={}){return new cc(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}F.reconfigure=F.define();F.appendConfig=F.define();class te{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&bl(i,t.newLength),r.some(l=>l.type==te.time)||(this.annotations=r.concat(te.time.of(Date.now())))}static create(e,t,i,s,r,o){return new te(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(te.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}te.time=nt.define();te.userEvent=nt.define();te.addToHistory=nt.define();te.remote=nt.define();function fc(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof te?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof te?n=r[0]:n=Ol(e,Vt(r),!1)}return n}function dc(n){let e=n.startState,t=e.facet(Al),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Dl(i,us(e,r,n.changes.newLength),!0))}return i==n?n:te.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const pc=[];function Vt(n){return n==null?pc:Array.isArray(n)?n:[n]}var U=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(U||(U={}));const gc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ds;try{ds=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function mc(n){if(ds)return ds.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||gc.test(t)))return!0}return!1}function yc(n){return e=>{if(!/\S/.test(e))return U.Space;if(mc(e))return U.Word;for(let t=0;t-1)return U.Word;return U.Other}}class H{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(F.reconfigure)?(t=null,i=o.value):o.is(F.appendConfig)&&(t=null,i=Vt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=hn.resolve(i,s,this),r=new H(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new H(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Vt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return H.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=hn.resolve(e.extensions||[],new Map),i=e.doc instanceof V?e.doc:V.of((e.doc||"").split(t.staticFacet(H.lineSeparator)||ls)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return bl(s,i.length),t.staticFacet(vl)||(s=s.asSingle()),new H(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(H.tabSize)}get lineBreak(){return this.facet(H.lineSeparator)||` +`}get readOnly(){return this.facet(Ml)}phrase(e,...t){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(xl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return yc(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ce(t,o,!1);if(r(t.slice(a,o))!=U.Word)break;o=a}for(;ln.length?n[0]:4});H.lineSeparator=kl;H.readOnly=Ml;H.phrases=O.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});H.languageData=xl;H.changeFilter=Sl;H.transactionFilter=Cl;H.transactionExtender=Al;Tn.reconfigure=F.define();function Bt(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Ct{eq(e){return this==e}range(e,t=e){return ps.create(e,t,this)}}Ct.prototype.startSide=Ct.prototype.endSide=0;Ct.prototype.point=!1;Ct.prototype.mapMode=le.TrackDel;let ps=class Tl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Tl(e,t,i)}};function gs(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class ir{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new ir(s,r,i,l):null,pos:o}}}class Y{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new Y(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(gs)),this.isEmpty)return t.length?Y.of(t):this;let l=new Bl(this,null,-1).goto(0),a=0,h=[],c=new At;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return pi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return pi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Er(o,l,i),h=new ei(o,a,r),c=new ei(l,a,r);i.iterGaps((f,u,d)=>Ir(h,f,c,u,d,s)),i.empty&&i.length==0&&Ir(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Er(r,o),a=new ei(r,l,0).goto(i),h=new ei(o,l,0).goto(i);for(;;){if(a.to!=h.to||!ms(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new ei(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new At;for(let s of e instanceof ps?[e]:t?bc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}Y.empty=new Y([],[],null,-1);function bc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(gs);e=i}return n}Y.empty.nextLayer=Y.empty;class At{finishChunk(e){this.chunks.push(new ir(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new At)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Y.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Y.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Er(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new Bl(o,t,i,r));return s.length==1?s[0]:new pi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)zn(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)zn(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),zn(this.heap,0)}}}function zn(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class ei{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=pi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Ei(this.active,e),Ei(this.activeTo,e),Ei(this.activeRank,e),this.minActive=Nr(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Ei(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Ir(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&ms(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!ms(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function ms(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Nr(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ce(n,s)}return i===!0?-1:n.length}const bs="ͼ",Fr=typeof Symbol>"u"?"__"+bs:Symbol.for(bs),ws=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ut{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=Vr[Fr]||1;return Vr[Fr]=e+1,bs+e.toString(36)}static mount(e,t,i){let s=e[ws],r=i&&i.nonce;s?r&&s.setNonce(r):s=new wc(e,r),s.mount(Array.isArray(t)?t:[t])}}let Wr=new Map;class wc{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=Wr.get(i);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[ws]=r;this.sheet=new s.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Wr.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[ws]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},xc=typeof navigator<"u"&&/Mac/.test(navigator.platform),vc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var se=0;se<10;se++)dt[48+se]=dt[96+se]=String(se);for(var se=1;se<=24;se++)dt[se+111]="F"+se;for(var se=65;se<=90;se++)dt[se]=String.fromCharCode(se+32),gi[se]=String.fromCharCode(se);for(var qn in dt)gi.hasOwnProperty(qn)||(gi[qn]=dt[qn]);function kc(n){var e=xc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||vc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?gi:dt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function fn(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function xs(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Sc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nn(n,e){if(!e.anchorNode)return!1;try{return xs(n,e.anchorNode)}catch{return!1}}function $t(n){return n.nodeType==3?Mt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function un(n,e,t,i){return t?Hr(n,e,t,i,-1)||Hr(n,e,t,i,1):!1}function mi(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Hr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:et(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=mi(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?et(n):0}else return!1}}function et(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Bn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Cc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Ac(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,m=1;if(d)u=Cc(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let x=c.getBoundingClientRect();p=x.width/c.offsetWidth,m=x.height/c.offsetHeight,u={left:x.left,right:x.left+c.clientWidth*p,top:x.top,bottom:x.top+c.clientHeight*m}}let g=0,y=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y0&&e.right>u.right+g&&(g=e.right-u.right+g+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Dc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?et(t):0),i,Math.min(e.focusOffset,i?et(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Rt=null;function Pl(n){if(n.setActive)return n.setActive();if(Rt)return n.focus(Rt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Rt==null?{get preventScroll(){return Rt={preventScroll:!0},!0}}:void 0),!Rt){Rt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class ae{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new ae(e.parentNode,mi(e),t)}static after(e,t){return new ae(e.parentNode,mi(e)+1,t)}}const nr=[];class j{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=j.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=qr(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=qr(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=et(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!j.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=nr){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Il(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var D={mac:jr||/Mac/.test(Me.platform),windows:/Win/.test(Me.platform),linux:/Linux|X11/.test(Me.platform),ie:Pn,ie_version:Fl?vs.documentMode||6:Ss?+Ss[1]:ks?+ks[1]:0,gecko:$r,gecko_version:$r?+(/Firefox\/(\d+)/.exec(Me.userAgent)||[0,0])[1]:0,chrome:!!$n,chrome_version:$n?+$n[1]:0,ios:jr,android:/Android\b/.test(Me.userAgent),webkit:Kr,safari:Vl,webkit_version:Kr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:vs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Bc=256;class tt extends j{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof tt)||this.length-(t-e)+i.length>Bc||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new tt(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ae(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Pc(this.dom,e,t)}}class it extends j{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Ll(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof it&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new it(this.mark,t,o)}domAtPos(e){return Wl(this,e)}coordsAt(e,t){return zl(this,e,t)}}function Pc(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?D.chrome||D.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return D.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Bn(a,o<0):a||null}class vt extends j{static create(e,t,i){return new vt(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=vt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof vt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?ae.before(this.dom):ae.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?ae.before(this.dom):ae.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return V.empty}get isHidden(){return!0}}tt.prototype.children=vt.prototype.children=Kt.prototype.children=nr;function Wl(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof it&&s.length&&(i=s[s.length-1])instanceof it&&i.mark.eq(e.mark)?Hl(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function zl(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function As(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function Rc(n){let e=Object.create(null);for(let t=0;t0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){sr(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Hl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=Cs(t,this.attrs||{})),i&&(this.attrs=Cs({class:i},this.attrs||{}))}domAtPos(e){return Wl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Ll(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(As(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&j.get(s)instanceof it;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=j.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!D.ios||!this.children.some(r=>r instanceof tt))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof tt)||/[^ -~]/.test(i.text))return null;let s=$t(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=zl(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof Z)return r;if(o>t)break}s=o+r.breakAfter}return null}}class ht extends j{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof ht)||!this.widget.compare(i.widget)||e>0&&r<=0||t0}}class Pt{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}destroy(e){}}var De=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(De||(De={}));class P extends Ct{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Di(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new pt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=ql(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new pt(e,i,s,t,e.widget||null,!0)}static line(e){return new Oi(e)}static set(e,t=!1){return Y.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}P.none=Y.empty;class Di extends P{constructor(e){let{start:t,end:i}=ql(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof Di&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&sr(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Di.prototype.point=!1;class Oi extends P{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Oi&&this.spec.class==e.spec.class&&sr(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Oi.prototype.mapMode=le.TrackBefore;Oi.prototype.point=!0;class pt extends P{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?le.TrackBefore:le.TrackAfter:le.TrackDel}get type(){return this.startSide!=this.endSide?De.WidgetRange:this.startSide<=0?De.WidgetBefore:De.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof pt&&Ec(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}pt.prototype.point=!0;function ql(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Ec(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ms(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class ui{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ht&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Z),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ni(new Kt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ht)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Ni(new tt(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof pt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof pt)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ht(i.widget||new Gr("div"),l,i));else{let a=vt.create(i.widget||new Gr("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Ni(new Kt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Ni(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new ui(e,t,i,r);return o.openEnd=Y.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ni(n,e){for(let t of e)n=new it(t,[n],n.length);return n}class Gr extends Pt{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const $l=O.define(),Kl=O.define(),jl=O.define(),Ul=O.define(),Ds=O.define(),Gl=O.define(),Jl=O.define(),Yl=O.define({combine:n=>n.some(e=>e)}),Xl=O.define({combine:n=>n.some(e=>e)});class Ht{constructor(e,t="nearest",i="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Ht(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Ht(b.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Fi=F.define({map:(n,e)=>n.map(e)});function Ne(n,e,t){let i=n.facet(Ul);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Ln=O.define({combine:n=>n.length?n[0]:!0});let Ic=0;const ri=O.define();class ue{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new ue(Ic++,e,i,s,l=>{let a=[ri.of(l)];return o&&a.push(yi.of(h=>{let c=h.plugin(l);return c?o(c):P.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return ue.define(i=>new e(i),t)}}class Kn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ne(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ne(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ne(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const _l=O.define(),rr=O.define(),yi=O.define(),or=O.define(),Ql=O.define();function Jr(n,e,t){let i=n.state.facet(Ql);if(!i.length)return i;let s=i.map(o=>o instanceof Function?o(n):o),r=[];return Y.spans(s,e,t,{point(){},span(o,l,a,h){let c=r;for(let f=a.length-1;f>=0;f--,h--){let u=a[f].spec.bidiIsolate,d;if(u!=null)if(h>0&&c.length&&(d=c[c.length-1]).to==o&&d.direction==u)d.to=l,c=d.inner;else{let p={from:o,to:l,direction:u,inner:[]};c.push(p),c=p.inner}}}}),r}const Zl=O.define();function ea(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Zl)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const oi=O.define();class Ee{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Ee(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Ee(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class dn{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=ee.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Ee(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new dn(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var _=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(_||(_={}));const bi=_.LTR,ta=_.RTL;function ia(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function na(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(ze[m+1]==-d){let g=ze[m+2],y=g&2?s:g&4?g&1?r:s:0;y&&(q[f]=q[ze[m]]=y),l=m;break}}else{if(ze.length==189)break;ze[l++]=f,ze[l++]=u,ze[l++]=a}else if((p=q[f])==2||p==1){let m=p==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let y=ze[g+2];if(y&2)break;if(m)ze[g+2]|=2;else{if(y&4)break;ze[g+2]|=4}}}}}function qc(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=sa;)p==g&&(p=t[--m].from,g=m?t[m-1].to:n),q[--p]=d;a=c}else r=h,a++}}}function Ts(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;aa&&o.push(new at(a,m.from,d));let g=m.direction==bi!=!(d%2);Bs(n,g?i+1:i,s,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(c?q[p]!=l:q[p]==l))break;p++}u?Ts(n,a,p,i+1,s,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let m=q[a-1];m!=l&&(c=!1,f=m==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let m=r[--h];if(!c)for(let g=m.from,y=h;;){if(g==e)break e;if(y&&r[y-1].to==g)g=r[--y].from;else{if(q[g-1]==l)break e;break}}if(u)u.push(m);else{m.toq.length;)q[q.length]=256;let i=[],s=e==bi?0:1;return Bs(n,s,s,t,0,n.length,i),i}function sa(n){return[new at(0,n,0)]}let ra="";function Kc(n,e,t,i,s){var r;let o=i.head-n.from,l=-1;if(o==0){if(!s||!n.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),l=0)}else if(o==n.length){if(s)return null;let u=e[e.length-1];u.level!=t&&(o=u.side(!0,t),l=e.length-1)}l<0&&(l=at.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc));let a=e[l];o==a.side(s,t)&&(a=e[l+=s?1:-1],o=a.side(!s,t));let h=s==(a.dir==t),c=ce(n.text,o,h);if(ra=n.text.slice(Math.min(o,c),Math.max(o,c)),c!=a.side(s,t))return b.cursor(c+n.from,h?-1:1,a.level);let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return!f&&a.level!=t?b.cursor(s?n.to:n.from,s?-1:1,t):f&&f.level0&&i.length&&(i.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let s=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!_c(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?Uc(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new Ee(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(D.ie||D.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=Yc(o,l,e.changes);return i=Ee.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=D.chrome||D.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,m;if(i&&i.range.fromBc){let v=ui.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=ui.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=v.breakAtStart,p=v.openStart,m=w.openEnd;let A=this.compositionView(i);w.breakAtStart?A.breakAfter=1:w.content.length&&A.merge(A.length,A.length,w.content[0],!1,w.openStart,0)&&(A.breakAfter=w.content[0].breakAfter,w.content.shift()),v.content.length&&A.merge(0,0,v.content[v.content.length-1],!0,0,v.openEnd)&&v.content.pop(),u=v.content.concat(A).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=ui.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=r.findPos(h,1),{i:x,off:S}=r.findPos(a,-1);Il(this,x,S,g,y,u,d,p,m)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new tt(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new it(s,[t],t.length);let i=new Z;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=j.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&nn(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(D.gecko&&l.empty&&!this.hasComposition&&jc(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new ae(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!un(a.node,a.offset,c.anchorNode,c.anchorOffset)||!un(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{D.android&&D.chrome&&this.dom.contains(c.focusNode)&&Xc(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=fn(this.view.root);if(f)if(l.empty){if(D.gecko){let u=Gc(a.node,a.offset);if(u&&u!=3){let d=la(a.node,a.offset,u==1?1:-1);d&&(a=new ae(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new ae(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new ae(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=fn(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=Z.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let s=e.offset;!i&&s=0;s--){let r=j.get(t.childNodes[s]);r instanceof Z&&(i=r.domAtPos(r.length))}return i?new ae(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=j.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(ae||l.covers(1))&&(!i||l instanceof Z&&!(i instanceof Z&&t>=0))&&(i=l,s=h),r=h}return i?i.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof Z))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof tt))return null;let r=ce(s.text,i);if(r==i)return null;let o=Mt(s.dom,i,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==_.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?$t(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?_.RTL:_.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Z){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=$t(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new El(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(P.replace({widget:new Xr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return P.set(e)}updateDeco(){let e=this.view.state.facet(yi).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=ea(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;Ac(this.view.scrollDOM,o,t.head0)i=i.childNodes[s-1],s=et(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return{node:i,offset:s};if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function Gc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function Qc(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return b.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=ce(s.text,r,!1):l=ce(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let h=ce(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function ef(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function jn(n,e){return n.tope.top+1}function _r(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Ps(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=$t(p);for(let g=0;gS||o==S&&r>x){i=p,s=y,r=x,o=S;let v=S?t0?g0)}x==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&jn(c,y)?c=Qr(c,y.bottom):f&&jn(f,y)&&(f=_r(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Zr(i,u,t);if(l&&i.contentEditable!="false")return Ps(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function Zr(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((D.chrome||D.gecko)&&Mt(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function aa(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let v=n.viewState.heightOracle.textHeight/2,w=!1;a=n.elementAtHeight(u),a.type!=De.Text;)for(;u=i>0?a.bottom+v:a.top-v,!(u>=0&&u<=h);){if(w)return t?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:eo(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,x=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let v=p.caretPositionFromPoint(c,f);v&&({offsetNode:y,offset:x}=v)}else if(p.caretRangeFromPoint){let v=p.caretRangeFromPoint(c,f);v&&({startContainer:y,startOffset:x}=v,(!n.contentDOM.contains(y)||D.safari&&tf(y,x,c)||D.chrome&&nf(y,x,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let v=Z.find(n.docView,d);if(!v)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:x}=Ps(v.dom,c,f))}let S=n.docView.nearest(y);if(!S)return null;if(S.isWidget&&((r=S.dom)===null||r===void 0?void 0:r.nodeType)==1){let v=S.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+ys(o,r,n.state.tabSize)}function tf(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Mt(n,i-1,i).getBoundingClientRect().left>t}function nf(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Mt(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Ls(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==De.Text))return i}return t}function sf(n,e,t,i){let s=Ls(n,e.head),r=!i||s.type!=De.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==_.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,t?-1:1)}return b.cursor(t?s.to:s.from,t?-1:1)}function to(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=Kc(s,r,o,l,t),c=ra;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` +`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=b.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function rf(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==U.Space&&(s=o),s==o}}function of(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||-1),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=aa(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms)){let g=n.docView.coordsForChar(m),y=!g||p{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,inull),D.gecko&&Sf(e.contentDOM.ownerDocument)}handleEvent(e){!gf(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=af(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()i.keyCode==e.keyCode))&&!e.ctrlKey||hf.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Wt(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:D.safari&&!D.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function io(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Ne(t.state,s)}}}function af(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(io(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(io(i.value,o))}}for(let i in Fe)t(i).handlers.push(Fe[i]);for(let i in Ve)t(i).observers.push(Ve[i]);return e}const ha=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],hf="dthko",ca=[16,17,18,20,91,92,224,225],Vi=6;function Wi(n){return Math.max(0,n)*.7+8}function cf(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class ff{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Mc(e.contentDOM),this.atoms=e.state.facet(or).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(H.allowMultipleSelections)&&uf(e,t),this.dragging=pf(e,t)&&pa(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&cf(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=ea(this.view);e.clientX-o.left<=r.left+Vi?i=-Wi(r.left-e.clientX):e.clientX+o.right>=r.right-Vi&&(i=Wi(e.clientX-r.right)),e.clientY-o.top<=r.top+Vi?s=-Wi(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Vi&&(s=Wi(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function uf(n,e){let t=n.state.facet($l);return t.length?t[0](e):D.mac?e.metaKey:e.ctrlKey}function df(n,e){let t=n.state.facet(Kl);return t.length?t[0](e):D.mac?!e.altKey:!e.ctrlKey}function pf(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=fn(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function gf(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=j.get(t))&&i.ignoreEvent(e))return!1;return!0}const Fe=Object.create(null),Ve=Object.create(null),fa=D.ie&&D.ie_version<15||D.ios&&D.webkit_version<604;function mf(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),ua(n,t.value)},50)}function ua(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Rs!=null&&t.selection.ranges.every(a=>a.empty)&&Rs==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Ve.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Fe.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Ve.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Ve.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Fe.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(jl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=wf(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new ff(n,e,t,i)),i&&n.observer.ignore(()=>Pl(n.contentDOM));let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function no(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return Qc(n.state,e,t);{let s=Z.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,so=(n,e,t)=>da(e,t)&&n>=t.left&&n<=t.right;function yf(n,e,t,i){let s=Z.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&so(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&so(t,i,l)?1:o&&da(i,o)?-1:1}function ro(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:yf(n,t,e.clientX,e.clientY)}}const bf=D.ie&&D.ie_version<=11;let oo=null,lo=0,ao=0;function pa(n){if(!bf)return n.detail;let e=oo,t=ao;return oo=n,ao=Date.now(),lo=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(lo+1)%3:1}function wf(n,e){let t=ro(n,e),i=pa(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=ro(n,r),h,c=no(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=no(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=xf(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function xf(n,e){for(let t=0;t=e)return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Fe.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let s=n.docView.nearest(e.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=b.range(r,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Fe.dragend=n=>(n.inputState.draggedContent=null,!1);function ho(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=n.inputState,o=i&&r&&df(n,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Fe.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,r=()=>{++s==t.length&&ho(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return ho(n,e,i,!0),!0}return!1};Fe.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=fa?null:e.clipboardData;return t?(ua(n,t.getData("text/plain")||t.getData("text/uri-text")),!0):(mf(n),!1)};function vf(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function kf(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Rs=null;Fe.copy=Fe.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=kf(n.state);if(!t&&!s)return!1;Rs=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=fa?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(vf(n,t),!1)};const ga=nt.define();function ma(n,e){let t=[];for(let i of n.facet(Jl)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:ga.of(!0)}):null}function ya(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=ma(n.state,e);t?n.dispatch(t):n.update([])}},10)}Ve.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),ya(n)};Ve.blur=n=>{n.observer.clearSelectionRange(),ya(n)};Ve.compositionstart=Ve.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Ve.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,D.chrome&&D.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Ve.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Fe.beforeinput=(n,e)=>{var t;let i;if(D.chrome&&D.android&&(i=ha.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return!1};const co=new Set;function Sf(n){co.has(n)||(co.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const fo=["pre-wrap","normal","pre-line","break-spaces"];class Cf{constructor(e){this.lineWrapping=e,this.doc=V.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return fo.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>rn&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return pe.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,K.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,K.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ce extends ba{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new Ge(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ce||s instanceof ie&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ie?s=new Ce(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pe.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ie extends pe{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new Ge(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new Ge(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==K.ByHeight)return this.blockAt(e,i,s,r);if(t==K.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new Ge(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new Ge(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new Ge(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ie?i[i.length-1]=new ie(r.length+s):i.push(null,new ie(s-1))}if(e>0){let r=i[0];r instanceof ie?i[0]=new ie(e+r.length):i.unshift(new ie(e-1),null)}return pe.of(i)}decomposeLeft(e,t){t.push(new ie(e-1),null)}decomposeRight(e,t){t.push(null,new ie(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new ie(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=rn&&(a=-2);let u=new Ce(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new ie(r-l).updateHeight(e,l));let h=pe.of(o);return(a<0||Math.abs(h.height-this.height)>=rn||Math.abs(a-this.heightMetrics(e,t).perLine)>=rn)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Mf extends pe{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==K.ByPosNoHeight?K.ByPosNoHeight:K.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,K.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&uo(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?pe.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function uo(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ie&&(i=n[e+1])instanceof ie&&n.splice(e-1,3,new ie(t.length+1+i.length))}const Df=5;class lr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ce?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ce(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Df)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ce(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ie(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ce)return e;let t=new Ce(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ce)&&!this.isCovered?this.nodes.push(new Ce(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Pf(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Gn{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new Cf(t),this.stateDeco=e.facet(yi).filter(i=>typeof i!="function"),this.heightMap=pe.empty().applyChanges(this.stateDeco,V.empty,this.heightOracle.setDoc(e.doc),[new Ee(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=P.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Hi(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?go:new If(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:li(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(yi).filter(c=>typeof c!="function");let s=e.changedRanges,r=Ee.extendWithRanges(s,Of(i,this.stateDeco,e?e.changes:ee.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Xl)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?_.RTL:_.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let v=l.width/t.offsetWidth,w=l.height/t.offsetHeight;(v>.995&&v<1.005||!isFinite(v)||Math.abs(l.width-t.offsetWidth)<1)&&(v=1),(w>.995&&w<1.005||!isFinite(w)||Math.abs(l.height-t.offsetHeight)<1)&&(w=1),(this.scaleX!=v||this.scaleY!=w)&&(this.scaleX=v,this.scaleY=w,h|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Rl(e.scrollDOM);let p=(this.printing?Pf:Bf)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=l.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let v=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(v)&&(o=!0),o||s.lineWrapping&&Math.abs(x-this.contentDOMWidth)>s.charWidth){let{lineHeight:w,charWidth:A,textHeight:C}=e.docView.measureTextSize();o=w>0&&s.refresh(r,w,A,C,x/A,v),o&&(e.docView.minWidth=0,h|=8)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),s.heightChanged=!1;for(let w of this.viewports){let A=w.from==this.viewport.from?v:e.docView.measureVisibleLineHeights(w);this.heightMap=(o?pe.empty().applyChanges(this.stateDeco,V.empty,this.heightOracle,[new Ee(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Af(w.from,A))}s.heightChanged&&(h|=2)}let S=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return S&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Hi(s.lineAt(o-i*1e3,K.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,K.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,K.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=_.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromy));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(b.cursor(c),!1,!0).head;g>h&&(c=g)}m=new Gn(h,c,this.gapSize(f,h,c,u))}l.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Y.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||li(this.heightMap.lineAt(e,K.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return li(this.heightMap.lineAt(this.scaler.fromDOM(e),K.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return li(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Hi{constructor(e,t){this.from=e,this.to=t}}function Rf(n,e,t){let i=[],s=n,r=0;return Y.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function qi(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Ef(n,e){for(let t of n)if(e(t))return t}const go={toDOM(n){return n},fromDOM(n){return n},scale:1};class If{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,K.ByPos,e,0,0).top,c=t.lineAt(a,K.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tli(s,e)):n._content)}const $i=O.define({combine:n=>n.join(" ")}),Es=O.define({combine:n=>n.indexOf(!0)>-1}),Is=ut.newName(),wa=ut.newName(),xa=ut.newName(),va={"&light":"."+wa,"&dark":"."+xa};function Ns(n,e,t){return new ut(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const Nf=Ns("."+Is,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},va),ai="￿";class Ff{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(H.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ai}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=j.get(s),a=j.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:mo(s))||mo(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=j.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Vf(e,i.node,i.offset)?t:0))}}function Vf(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:qf(e),a=new Ff(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=$f(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!xs(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!xs(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(h,a)}}}function ka(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||D.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(D.mac||D.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:V.of([" "])}):D.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:V.of([" "])}),t){if(D.ios&&n.inputState.flushIOSKey()||D.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Wt(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengths.head)&&Wt(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Wt(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,a=()=>l||(l=Hf(n,t,i));return n.state.facet(Gl).some(h=>h(n,t.from,t.to,o,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Hf(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=n.state.sliceDoc(e.from,e.to),c,f=t&&oa(n,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=n.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let m=p.to-u,g=m-h.length;if(p.to-p.from!=d||n.state.sliceDoc(g,m)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let y=s.changes({from:g,to:m,insert:e.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function zf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function qf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new yo(t,i)),(s!=t||r!=i)&&e.push(new yo(s,r))),e}function $f(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const Kf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Jn=D.ie&&D.ie_version<=11;class jf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Dc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(D.ie&&D.ie_version<=11||D.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Jn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Ln)?i.root.activeElement!=this.dom:!nn(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(D.ie&&D.ie_version<=11||D.android&&D.chrome)&&!i.state.selection.main.empty&&s.focusNode&&un(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=D.safari&&e.root.nodeType==11&&Sc(this.dom.ownerDocument)==this.dom&&Uf(this.view)||fn(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=nn(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Wt(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&nn(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Wf(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,s=ka(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=bo(t,e.previousSibling||e.target.previousSibling,-1),s=bo(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function bo(n,e,t){for(;e;){let i=j.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function Uf(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return un(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class T{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Oc(e.parent)||document,this.viewState=new po(e.state||H.create(e)),e.scrollTo&&e.scrollTo.is(Fi)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ri).map(i=>new Kn(i));for(let i of this.plugins)i.update(this);this.observer=new jf(this),this.inputState=new lf(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Yr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof te?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(ga))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=ma(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(H.phrases)!=this.state.facet(H.phrases))return this.setState(r);s=dn.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new Ht(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(Fi)&&(f=d.value.clip(this.state))}this.viewState.update(s,f),this.bidiCache=pn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(oi)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet($i)!=s.state.facet($i)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(Ds))try{u(s)}catch(d){Ne(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!ka(this,c)&&h.force&&Wt(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new po(e),this.plugins=e.facet(ri).map(i=>new Kn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Yr(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ri),i=e.state.facet(ri);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Kn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Rl(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ne(this.state,p),wo}}),f=dn.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ds))l(t)}get themeClasses(){return Is+" "+(this.state.facet(Es)?xa:wa)+" "+this.state.facet($i)}updateAttrs(){let e=xo(this,_l,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Ln)?"true":"false",class:"cm-content",style:`${D.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),xo(this,rr,t);let i=this.observer.ignore(()=>{let s=As(this.contentDOM,this.contentAttrs,t),r=As(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(T.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(oi);let e=this.state.facet(T.cspNonce);ut.mount(this.root,this.styleModules.concat(Nf).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Un(this,e,to(this,e,t,i))}moveByGroup(e,t){return Un(this,e,to(this,e,t,i=>rf(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return sf(this,e,t,i)}moveVertically(e,t,i){return Un(this,e,of(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),aa(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[at.find(r,e-s.from,-1,t)];return Bn(i,o.dir==_.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Yl)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Gf)return sa(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||na(r.isolates,i=Jr(this,e.from,e.to))))return r.order;i||(i=Jr(this,e.from,e.to));let s=$c(e.text,t,i);return this.bidiCache.push(new pn(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||D.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Pl(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Fi.of(new Ht(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Fi.of(new Ht(b.cursor(i.from),"start","start",i.top-e,t,!0))}static domEventHandlers(e){return ue.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ue.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ut.newName(),s=[$i.of(i),oi.of(Ns(`.${i}`,e))];return t&&t.dark&&s.push(Es.of(!0)),s}static baseTheme(e){return Tt.lowest(oi.of(Ns("."+Is,e,va)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&j.get(i)||j.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}T.styleModule=oi;T.inputHandler=Gl;T.focusChangeEffect=Jl;T.perLineTextDirection=Yl;T.exceptionSink=Ul;T.updateListener=Ds;T.editable=Ln;T.mouseSelectionStyle=jl;T.dragMovesSelection=Kl;T.clickAddsSelectionRange=$l;T.decorations=yi;T.atomicRanges=or;T.bidiIsolatedRanges=Ql;T.scrollMargins=Zl;T.darkTheme=Es;T.cspNonce=O.define({combine:n=>n.length?n[0]:""});T.contentAttributes=rr;T.editorAttributes=_l;T.lineWrapping=T.contentAttributes.of({class:"cm-lineWrapping"});T.announce=F.define();const Gf=4096,wo={};class pn{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:_.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&Cs(o,t)}return t}const Jf=D.mac?"mac":D.windows?"win":D.linux?"linux":"key";function Yf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function _f(n,e,t){return Ca(Sa(n.state),e,n,t)}let ot=null;const Qf=4e3;function Zf(n,e=Jf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Yf(y,e));for(let y=1;y{let v=ot={view:S,prefix:x,scope:o};return setTimeout(()=>{ot==v&&(ot=null)},Qf),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function Ca(n,e,t,i){let s=kc(e),r=ne(s,0),o=Be(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;ot&&ot.view==t&&ot.scope==i&&(l=ot.prefix+" ",ca.indexOf(e.keyCode)<0&&(h=!0,ot=null));let f=new Set,u=g=>{if(g){for(let y of g.run)if(!f.has(y)&&(f.add(y),y(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+Ki(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(D.windows&&e.ctrlKey&&e.altKey)&&(p=dt[e.keyCode])&&p!=s?(u(d[l+Ki(p,e,!0)])||e.shiftKey&&(m=gi[e.keyCode])!=s&&m!=p&&u(d[l+Ki(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Ki(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class Ti{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=Aa(e);return[new Ti(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return eu(e,t,i)}}function Aa(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==_.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function ko(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:De.Text}}function eu(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==_.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=Aa(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Ls(n,i),p=Ls(n,s),m=d.type==De.Text?d:null,g=p.type==De.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=ko(n,i,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=ko(n,s,g)),m&&g&&m.from==g.from)return x(S(t.from,t.to,m));{let w=m?S(t.from,null,m):v(d,!1),A=g?S(null,t.to,g):v(p,!0),C=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&w.bottom+n.defaultLineHeight/2L&&W.from=be)break;Q>G&&R(Math.max(Oe,G),w==null&&Oe<=L,Math.min(Q,be),A==null&&Q>=z,ke.dir)}if(G=we.to+1,G>=be)break}return N.length==0&&R(L,w==null,z,A==null,n.textDirection),{top:B,bottom:I,horizontal:N}}function v(w,A){let C=l.top+(A?w.top:w.bottom);return{top:C,bottom:C,horizontal:[]}}}function tu(n,e){return n.constructor==e.constructor&&n.eq(e)}class iu{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(on)!=e.state.facet(on)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,i=e.facet(on);for(;t!tu(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const on=O.define();function Ma(n){return[ue.define(e=>new iu(e,n)),on.of(n)]}const Da=!D.ios,wi=O.define({combine(n){return Bt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Qg(n={}){return[wi.of(n),nu,su,ru,Xl.of(!0)]}function Oa(n){return n.startState.facet(wi)!=n.state.facet(wi)}const nu=Ma({above:!0,markers(n){let{state:e}=n,t=e.facet(wi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||Da:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Ti.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Oa(n);return t&&So(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){So(e.state,n)},class:"cm-cursorLayer"});function So(n,e){e.style.animationDuration=n.facet(wi).cursorBlinkRate+"ms"}const su=Ma({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Ti.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Oa(n)},class:"cm-selectionLayer"}),Ta={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Da&&(Ta[".cm-line"].caretColor="transparent !important");const ru=Tt.highest(T.theme(Ta)),Ba=F.define({map(n,e){return n==null?null:e.mapPos(n)}}),hi=ye.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Ba)?i.value:t,n)}}),ou=ue.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(hi);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(hi)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(hi),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(hi)!=n&&this.view.dispatch({effects:Ba.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Zg(){return[hi,ou]}function Co(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function lu(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class au{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new At,i=t.add.bind(t);for(let{from:s,to:r}of lu(e,this.maxLength))Co(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const Fs=/x/.unicode!=null?"gu":"g",hu=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Fs),cu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Yn=null;function fu(){var n;if(Yn==null&&typeof document<"u"&&document.body){let e=document.body.style;Yn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Yn||!1}const ln=O.define({combine(n){let e=Bt(n,{render:null,specialChars:hu,addSpecialChars:null});return(e.replaceTabs=!fu())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Fs)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Fs)),e}});function em(n={}){return[ln.of(n),uu()]}let Ao=null;function uu(){return Ao||(Ao=ue.fromClass(class{constructor(n){this.view=n,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ln)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new au({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ne(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=Yt(o.text,l,i-o.from);return P.replace({widget:new mu((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new gu(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(ln);n.startState.facet(ln)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const du="•";function pu(n){return n>=32?du:n==10?"␤":String.fromCharCode(9216+n)}class gu extends Pt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=pu(this.code),i=e.state.phrase("Control character")+" "+(cu[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class mu extends Pt{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class yu extends Pt{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?$t(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=Bn(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function tm(n){return ue.fromClass(class{constructor(e){this.view=e,this.placeholder=n?P.set([P.widget({widget:new yu(n),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:e=>e.decorations})}const Vs=2e3;function bu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Vs||t.off>Vs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(b.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=ys(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=ys(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function wu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Mo(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Vs?-1:s==i.length?wu(n,e.clientX):Yt(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function xu(n,e){let t=Mo(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=Mo(n,s);if(!l)return i;let a=bu(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function im(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?xu(t,i):null)}const ti="-10000px";class vu{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[h]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function ku(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Xn=O.define({combine:n=>{var e,t,i;return{position:D.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||ku}}}),Do=new WeakMap,Pa=ue.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Xn);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new vu(n,La,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Xn);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=ti,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(D.gecko)i=s.offsetParent!=this.container.ownerDocument.body;else if(this.view.scaleX!=1||this.view.scaleY!=1)i=!0;else if(s.style.top==ti&&s.style.left=="0px"){let r=s.getBoundingClientRect();i=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((s,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Xn).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1){c.style.top=ti;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=Do.get(h))!==null&&e!==void 0?e:u.bottom-u.top,y=h.offset||Cu,x=this.view.textDirection==_.LTR,S=u.width>i.right-i.left?x?i.left:i.right-u.width:x?Math.min(f.left-(d?14:0)+y.x,i.right-m):Math.max(i.left,f.left-m+(d?14:0)-y.x),v=this.above[l];!a.strictSide&&(v?f.top-(u.bottom-u.top)-y.yi.bottom)&&v==i.bottom-f.bottom>f.top-i.top&&(v=this.above[l]=!v);let w=(v?f.top-i.top:i.bottom-f.bottom)-p;if(wS&&B.topA&&(A=v?B.top-g-2-p:B.bottom+p+2);if(this.position=="absolute"?(c.style.top=(A-n.parent.top)/r+"px",c.style.left=(S-n.parent.left)/s+"px"):(c.style.top=A/r+"px",c.style.left=S/s+"px"),d){let B=f.left+(x?y.x:-y.x)-(S+14-7);d.style.left=B/s+"px"}h.overlap!==!0&&o.push({left:S,top:A,right:C,bottom:A+g}),c.classList.toggle("cm-tooltip-above",v),c.classList.toggle("cm-tooltip-below",!v),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=ti}},{eventObservers:{scroll(){this.maybeMeasure()}}}),Su=T.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),Cu={x:0,y:0},La=O.define({enables:[Pa,Su]});function Ra(n,e){let t=n.plugin(Pa);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Oo=O.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function gn(n,e){let t=n.plugin(Ea),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Ea=ue.fromClass(class{constructor(n){this.input=n.state.facet(mn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Oo);this.top=new ji(n,!0,e.topContainer),this.bottom=new ji(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Oo);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ji(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ji(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(mn);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>T.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class ji{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=To(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=To(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function To(n){let e=n.nextSibling;return n.remove(),e}const mn=O.define({enables:Ea});class Dt extends Ct{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Dt.prototype.elementClass="";Dt.prototype.toDOM=void 0;Dt.prototype.mapMode=le.TrackBefore;Dt.prototype.startSide=Dt.prototype.endSide=-1;Dt.prototype.point=!0;const Au=O.define(),Mu=new class extends Dt{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Du=Au.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(Mu.range(s)))}return Y.of(e)});function nm(){return Du}const Ou=1024;let Tu=0;class Pe{constructor(e,t){this.from=e,this.to=t}}class E{constructor(e={}){this.id=Tu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ge.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}E.closedBy=new E({deserialize:n=>n.split(" ")});E.openedBy=new E({deserialize:n=>n.split(" ")});E.group=new E({deserialize:n=>n.split(" ")});E.contextHash=new E({perNode:!0});E.lookAhead=new E({perNode:!0});E.mounted=new E({perNode:!0});class xi{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[E.mounted.id]}}const Bu=Object.create(null);class ge{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Bu,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new ge(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(E.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(E.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}ge.none=new ge("",Object.create(null),0,8);class hr{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|J.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:ur(ge.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new $(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new $(ge.none,t,i,s)))}static build(e){return Eu(e)}}$.empty=new $(ge.none,[],[],0);class cr{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new cr(this.buffer,this.index)}}class gt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ge.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function vi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(Ia(s,i,f,f+c.length)){if(c instanceof gt){if(r&J.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new Je(new Pu(o,c,e,f),null,u)}else if(r&J.IncludeAnonymous||!c.type.isAnonymous||fr(c)){let u;if(!(r&J.IgnoreMounts)&&(u=xi.get(c))&&!u.overlay)return new fe(u.tree,f,e,o);let d=new fe(c,f,e,o);return r&J.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&J.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&J.IgnoreOverlays)&&(s=xi.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new fe(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Po(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Ws(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Pu{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class Je extends Na{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Je(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&J.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Je(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Je(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Je(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new $(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Fa(n){if(!n.length)return null;let e=0,t=n[0];for(let r=1;rt.from||o.to=e){let l=new fe(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[i])).push(vi(l,e,t,!1))}}return s?Fa(s):i}class yn{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof fe)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof fe?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&J.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&J.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&J.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&J.IncludeAnonymous||l instanceof gt||!l.type.isAnonymous||fr(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return Ws(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function fr(n){return n.children.some(e=>e instanceof gt||!e.type.isAnonymous||fr(e))}function Eu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Ou,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new cr(t,t.length):t,a=i.types,h=0,c=0;function f(w,A,C,B,I,N){let{id:R,start:L,end:z,size:W}=l,G=c;for(;W<0;)if(l.next(),W==-1){let Q=r[R];C.push(Q),B.push(L-w);return}else if(W==-3){h=R;return}else if(W==-4){c=R;return}else throw new RangeError(`Unrecognized record size: ${W}`);let be=a[R],we,ke,Oe=L-w;if(z-L<=s&&(ke=g(l.pos-A,I))){let Q=new Uint16Array(ke.size-ke.skip),Te=l.pos-ke.size,He=Q.length;for(;l.pos>Te;)He=y(ke.start,Q,He);we=new gt(Q,z-ke.start,i),Oe=ke.start-w}else{let Q=l.pos-W;l.next();let Te=[],He=[],yt=R>=o?R:-1,Lt=0,Ri=z;for(;l.pos>Q;)yt>=0&&l.id==yt&&l.size>=0?(l.end<=Ri-s&&(p(Te,He,L,Lt,l.end,Ri,yt,G),Lt=Te.length,Ri=l.end),l.next()):N>2500?u(L,Q,Te,He):f(L,Q,Te,He,yt,N+1);if(yt>=0&&Lt>0&&Lt-1&&Lt>0){let Or=d(be);we=ur(be,Te,He,0,Te.length,0,z-L,Or,Or)}else we=m(be,Te,He,z-L,G-z)}C.push(we),B.push(Oe)}function u(w,A,C,B){let I=[],N=0,R=-1;for(;l.pos>A;){let{id:L,start:z,end:W,size:G}=l;if(G>4)l.next();else{if(R>-1&&z=0;W-=3)L[G++]=I[W],L[G++]=I[W+1]-z,L[G++]=I[W+2]-z,L[G++]=G;C.push(new gt(L,I[2]-z,i)),B.push(z-w)}}function d(w){return(A,C,B)=>{let I=0,N=A.length-1,R,L;if(N>=0&&(R=A[N])instanceof $){if(!N&&R.type==w&&R.length==B)return R;(L=R.prop(E.lookAhead))&&(I=C[N]+R.length+L)}return m(w,A,C,B,I)}}function p(w,A,C,B,I,N,R,L){let z=[],W=[];for(;w.length>B;)z.push(w.pop()),W.push(A.pop()+C-I);w.push(m(i.types[R],z,W,N-I,L-N)),A.push(I-C)}function m(w,A,C,B,I=0,N){if(h){let R=[E.contextHash,h];N=N?[R].concat(N):[R]}if(I>25){let R=[E.lookAhead,I];N=N?[R].concat(N):[R]}return new $(w,A,C,B,N)}function g(w,A){let C=l.fork(),B=0,I=0,N=0,R=C.end-s,L={size:0,start:0,skip:0};e:for(let z=C.pos-w;C.pos>z;){let W=C.size;if(C.id==A&&W>=0){L.size=B,L.start=I,L.skip=N,N+=4,B+=4,C.next();continue}let G=C.pos-W;if(W<0||G=o?4:0,we=C.start;for(C.next();C.pos>G;){if(C.size<0)if(C.size==-3)be+=4;else break e;else C.id>=o&&(be+=4);C.next()}I=we,B+=W,N+=be}return(A<0||B==w)&&(L.size=B,L.start=I,L.skip=N),L.size>4?L:void 0}function y(w,A,C){let{id:B,start:I,end:N,size:R}=l;if(l.next(),R>=0&&B4){let z=l.pos-(R-4);for(;l.pos>z;)C=y(w,A,C)}A[--C]=L,A[--C]=N-w,A[--C]=I-w,A[--C]=B}else R==-3?h=B:R==-4&&(c=B);return C}let x=[],S=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,x,S,-1,0);let v=(e=n.length)!==null&&e!==void 0?e:x.length?S[0]+x[0].length:0;return new $(a[n.topID],x.reverse(),S.reverse(),v)}const Lo=new WeakMap;function an(n,e){if(!n.isAnonymous||e instanceof gt||e.type!=n)return 1;let t=Lo.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof $)){t=1;break}t+=an(n,i)}Lo.set(e,t)}return t}function ur(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;A+=C}if(S==v+1){if(A>c){let C=p[v];d(C.children,C.positions,0,C.children.length,m[v]+x);continue}f.push(p[v])}else{let C=m[S-1]+p[S-1].length-w;f.push(ur(n,p,m,v,S,w,C,null,a))}u.push(w+x-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class sm{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Je?this.setBuffer(e.context.buffer,e.index,t):e instanceof fe&&this.map.set(e.tree,t)}get(e){return e instanceof Je?this.getBuffer(e.context.buffer,e.index):e instanceof fe?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ze{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Ze(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ze(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Pe(s.from,s.to)):[new Pe(0,0)]:[new Pe(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Iu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function rm(n){return(e,t,i,s)=>new Fu(e,n,t,i,s)}class Ro{constructor(e,t,i,s,r){this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.from=r}}function Eo(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class Nu{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Hs=new E({perNode:!0});class Fu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new $(i.type,i.children,i.positions,i.length,i.propValues.concat([[Hs,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[E.mounted.id]=new xi(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(s)){if(t){let h=t.mounts.find(c=>c.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Vu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.fromnew Pe(f.from-s.from,f.to-s.from)):null,s.tree,c.length?c[0].from:s.from)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Pe(s.from,s.to)),a.fromnew Pe(c.from-t.start,c.to-t.start)),t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Vu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Io(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer,a=[i];function h(c,f,u,d,p,m){let g=t[m],y=[],x=[];Io(o,c,g,y,x,d);let S=l[g+1],v=l[g+2];a.push(y.length);let w=m?h(g+4,l[g+3],o.set.types[l[g]],S,v-S,m-1):e.toTree();return y.push(w),x.push(S-d),Io(o,l[g+3],f,y,x,d),new $(u,y,x,p)}s.children[i]=h(0,l.length,ge.none,0,o.length,t.length-1);for(let c of a){let f=n.tree.children[c],u=n.tree.positions[c];n.yield(new fe(f,u+n.from,c,n._tree))}}class No{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(J.IncludeAnonymous|J.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,J.IgnoreOverlays|J.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof $)t=t.children[0];else break}return!1}}class Hu{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Hs))!==null&&t!==void 0?t:i.to,this.inner=new No(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Hs))!==null&&e!==void 0?e:t.to,this.inner=new No(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(E.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Fo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Pe(l,a.to))):a.to>l?t[r--]=new Pe(l,a.to):t.splice(r--,1))}}return i}function zu(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Pe(u.from+i,u.to+i)),f=zu(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new Ze(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new Ze(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let qu=0;class je{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=qu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new je([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new bn;return t=>t.modified.indexOf(e)>-1?t:bn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let $u=0;class bn{constructor(){this.instances=[],this.id=$u++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Ku(t,l.modified));if(i)return i;let s=[],r=new je(s,e,t);for(let l of t)l.instances.push(r);let o=ju(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(bn.get(l,a));return r}}function Ku(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function ju(n){let e=[[]];for(let t=0;ti.length-t.length)}function Uu(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new wn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Wa.add(e)}const Wa=new E;class wn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Gu(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function Ju(n,e,t,i=0,s=n.length){let r=new Yu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Yu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Xu(e)||wn.empty,f=Gu(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(E.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let x=g=S||!e.nextSibling())););if(!x||S>i)break;y=x.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,x.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Xu(n){let e=n.type.prop(Wa);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const k=je.define,Gi=k(),st=k(),Wo=k(st),Ho=k(st),rt=k(),Ji=k(rt),_n=k(rt),Ke=k(),bt=k(Ke),qe=k(),$e=k(),zs=k(),ii=k(zs),Yi=k(),M={comment:Gi,lineComment:k(Gi),blockComment:k(Gi),docComment:k(Gi),name:st,variableName:k(st),typeName:Wo,tagName:k(Wo),propertyName:Ho,attributeName:k(Ho),className:k(st),labelName:k(st),namespace:k(st),macroName:k(st),literal:rt,string:Ji,docString:k(Ji),character:k(Ji),attributeValue:k(Ji),number:_n,integer:k(_n),float:k(_n),bool:k(rt),regexp:k(rt),escape:k(rt),color:k(rt),url:k(rt),keyword:qe,self:k(qe),null:k(qe),atom:k(qe),unit:k(qe),modifier:k(qe),operatorKeyword:k(qe),controlKeyword:k(qe),definitionKeyword:k(qe),moduleKeyword:k(qe),operator:$e,derefOperator:k($e),arithmeticOperator:k($e),logicOperator:k($e),bitwiseOperator:k($e),compareOperator:k($e),updateOperator:k($e),definitionOperator:k($e),typeOperator:k($e),controlOperator:k($e),punctuation:zs,separator:k(zs),bracket:ii,angleBracket:k(ii),squareBracket:k(ii),paren:k(ii),brace:k(ii),content:Ke,heading:bt,heading1:k(bt),heading2:k(bt),heading3:k(bt),heading4:k(bt),heading5:k(bt),heading6:k(bt),contentSeparator:k(Ke),list:k(Ke),quote:k(Ke),emphasis:k(Ke),strong:k(Ke),link:k(Ke),monospace:k(Ke),strikethrough:k(Ke),inserted:k(),deleted:k(),changed:k(),invalid:k(),meta:Yi,documentMeta:k(Yi),annotation:k(Yi),processingInstruction:k(Yi),definition:je.defineModifier(),constant:je.defineModifier(),function:je.defineModifier(),standard:je.defineModifier(),local:je.defineModifier(),special:je.defineModifier()};Ha([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var Qn;const kt=new E;function za(n){return O.define({combine:n?e=>e.concat(n):void 0})}const _u=new E;class Le{constructor(e,t,i=[],s=""){this.data=e,this.name=s,H.prototype.hasOwnProperty("tree")||Object.defineProperty(H.prototype,"tree",{get(){return me(this)}}),this.parser=t,this.extension=[Gt.of(this),H.languageData.of((r,o,l)=>{let a=zo(r,o,l),h=a.type.prop(kt);if(!h)return[];let c=r.facet(h),f=a.type.prop(_u);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return zo(e,t,i).type.prop(kt)==this.data}findRegions(e){let t=e.facet(Gt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(kt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(E.mounted);if(l){if(l.tree.prop(kt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new qs(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function me(n){let e=n.field(Le.state,!1);return e?e.tree:$.empty}class Qu{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ni=null;class jt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new jt(e,t,[],$.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Qu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=$.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ze.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ni;ni=this;try{return e()}finally{ni=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=qo(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ze.applyChanges(i,a),s=$.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=qo(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Va{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=ni;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new $(ge.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ni}}function qo(n,e,t){return Ze.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ut{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Ut(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=jt.create(e.facet(Gt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ut(i)}}Le.state=ye.define({create:Ut.init,update(n,e){for(let t of e.effects)if(t.is(Le.setState))return t.value;return e.startState.facet(Gt)!=e.state.facet(Gt)?Ut.init(e.state):n.apply(e)}});let qa=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(qa=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Zn=typeof navigator<"u"&&(!((Qn=navigator.scheduling)===null||Qn===void 0)&&Qn.isInputPending)?()=>navigator.scheduling.isInputPending():null,Zu=ue.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Le.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Le.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=qa(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Zn&&Zn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Le.setState.of(new Ut(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ne(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Gt=O.define({combine(n){return n.length?n[0]:null},enables:n=>[Le.state,Zu,T.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class lm{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const $a=O.define(),Rn=O.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ot(n){let e=n.facet(Rn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function xn(n,e){let t="",i=n.tabSize,s=n.facet(Rn)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?td(n,t,e):null}class En{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ot(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Yt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ed=new E;function td(n,e,t){let i=e.resolveStack(t),s=i.node.enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return ja(i,n,t)}function ja(n,e,t){for(let i=n;i;i=i.next){let s=nd(i.node);if(s)return s(dr.create(e,t,i))}return 0}function id(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function nd(n){let e=n.type.prop(ed);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(E.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Ua(o,!0,1,void 0,r&&!id(o)?s.from:void 0)}return n.parent==null?sd:null}function sd(){return 0}class dr extends En{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new dr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(rd(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return ja(this.context.next,this.base,this.pos)}}function rd(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function od(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromUa(i,e,t,n)}function Ua(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?od(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const hm=n=>n.baseIndent;function cm({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const fm=new E;function um(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(kt)==o.data:o?l=>l==o:void 0,this.style=Ha(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ut(i):null,this.themeType=t.themeType}static define(e,t){return new In(e,t||{})}}const $s=O.define(),Ga=O.define({combine(n){return n.length?[n[0]]:null}});function es(n){let e=n.facet($s);return e.length?e:n.facet(Ga)}function dm(n,e){let t=[ad],i;return n instanceof In&&(n.module&&t.push(T.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Ga.of(n)):i?t.push($s.computeN([T.darkTheme],s=>s.facet(T.darkTheme)==(i=="dark")?[n]:[])):t.push($s.of(n)),t}class ld{constructor(e){this.markCache=Object.create(null),this.tree=me(e.state),this.decorations=this.buildDeco(e,es(e.state))}update(e){let t=me(e.state),i=es(e.state),s=i!=es(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=P.mark({class:a})))},s,r);return i.finish()}}const ad=Tt.high(ue.fromClass(ld,{decorations:n=>n.decorations})),pm=In.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),hd=T.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ja=1e4,Ya="()[]{}",Xa=O.define({combine(n){return Bt(n,{afterCursor:!0,brackets:Ya,maxScanDistance:Ja,renderMatch:ud})}}),cd=P.mark({class:"cm-matchingBracket"}),fd=P.mark({class:"cm-nonmatchingBracket"});function ud(n){let e=[],t=n.matched?cd:fd;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const dd=ye.define({create(){return P.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Xa);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=Ye(e.state,s.head,-1,i)||s.head>0&&Ye(e.state,s.head-1,1,i)||i.afterCursor&&(Ye(e.state,s.head,1,i)||s.headT.decorations.from(n)}),pd=[dd,hd];function gm(n={}){return[Xa.of(n),pd]}const gd=new E;function Ks(n,e,t){let i=n.prop(e<0?E.openedBy:E.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function js(n){let e=n.type.prop(gd);return e?e(n.node):n}function Ye(n,e,t,i={}){let s=i.maxScanDistance||Ja,r=i.brackets||Ya,o=me(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=Ks(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return md(n,e,t,a,c,h,r)}}return yd(n,e,t,o,l.type,s,r)}function md(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function $o(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function bd(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||wd,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||gr}}function wd(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Ko=new WeakMap;class Qa extends Le{constructor(e){let t=za(e.languageData),i=bd(e),s,r=new class extends Va{createParse(o,l,a){return new vd(s,o,l,a)}};super(t,r,[$a.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=Cd(t),s=this,this.streamParser=i,this.stateAfter=new E({perNode:!0}),this.tokenTable=e.tokenTable?new ih(i.tokenTable):Sd}static define(e){return new Qa(e)}getIndent(e,t){let i=me(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=Ko.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof $&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&pr(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Za(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?Ot(i):4),tree:$.empty}}class vd{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=jt.get(),o=s[0].from,{state:l,tree:a}=xd(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +`&&(t="");else{let i=t.indexOf(` +`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new _a(t,e?e.state.tabSize:4,e?Ot(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=eh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const gr=Object.create(null),ki=[ge.none],kd=new hr(ki),jo=[],th=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])th[n]=nh(gr,e);class ih{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),th)}resolve(e){return e?this.table[e]||(this.table[e]=nh(this.extra,e)):0}}const Sd=new ih(gr);function ts(n,e){jo.indexOf(n)>-1||(jo.push(n),console.warn(e))}function nh(n,e){let t=[];for(let r of e.split(" ")){let o=[];for(let l of r.split(".")){let a=n[l]||M[l];a?typeof a=="function"?o.length?o=o.map(a):ts(l,`Modifier ${l} used at start of tag`):o.length?ts(l,`Tag ${l} used as modifier`):o=Array.isArray(a)?a:[a]:ts(l,`Unknown highlighting tag ${l}`)}for(let l of o)t.push(l)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=ge.define({id:ki.length,name:i,props:[Uu({[i]:t})]});return ki.push(s),s.id}function Cd(n){let e=ge.define({id:ki.length,name:"Document",props:[kt.add(()=>n)],top:!0});return ki.push(e),e}const Ad=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=yr(n.state,t.from);return i.line?Md(n):i.block?Od(n):!1};function mr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Md=mr(Pd,0),Dd=mr(sh,0),Od=mr((n,e)=>sh(n,e,Bd(e)),0);function yr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const si=50;function Td(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-si,i),o=n.sliceDoc(s,s+si),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*si?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+si),f=n.sliceDoc(s-si,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Bd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function sh(n,e,t=e.selection.ranges){let i=t.map(r=>yr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Td(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Us=nt.define(),Ld=nt.define(),Rd=O.define(),rh=O.define({combine(n){return Bt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function Ed(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const oh=ye.define({create(){return Xe.empty},update(n,e){let t=e.state.facet(rh),i=e.annotation(Us);if(i){let a=e.docChanged?b.single(Ed(e.changes)):void 0,h=ve.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=vn(f,f.length,t.minDepth,h):f=hh(f,e.startState.selection),new Xe(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(Ld);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(te.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=ve.fromTransaction(e),o=e.annotation(te.time),l=e.annotation(te.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Xe(n.done.map(ve.fromJSON),n.undone.map(ve.fromJSON))}});function mm(n={}){return[oh,rh.of(n),T.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?lh:e.inputType=="historyRedo"?Gs:null;return i?(e.preventDefault(),i(t)):!1}})]}function Nn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(oh,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const lh=Nn(0,!1),Gs=Nn(1,!1),Id=Nn(0,!0),Nd=Nn(1,!0);class ve{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new ve(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new ve(e.changes&&ee.fromJSON(e.changes),[],e.mapped&&_e.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Re;for(let s of e.startState.facet(Rd)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new ve(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Re)}static selection(e){return new ve(void 0,Re,void 0,void 0,e)}}function vn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Fd(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Vd(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function ah(n,e){return n.length?e.length?n.concat(e):n:e}const Re=[],Wd=200;function hh(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Wd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),vn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ve.selection([e])]}function Hd(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function is(n,e){if(!n.length)return n;let t=n.length,i=Re;for(;t;){let s=zd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[ve.selection(i)]:Re}function zd(n,e,t){let i=ah(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Re,t);if(!n.changes)return ve.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ve(s,F.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const qd=/^(input\.type|delete)($|\.)/;class Xe{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Xe(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||qd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):Fn(t,e))}function de(n){return n.textDirectionAt(n.state.selection.main.head)==_.LTR}const fh=n=>ch(n,!de(n)),uh=n=>ch(n,de(n));function dh(n,e){return We(n,t=>t.empty?n.moveByGroup(t,e):Fn(t,e))}const $d=n=>dh(n,!de(n)),Kd=n=>dh(n,de(n));function jd(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Vn(n,e,t){let i=me(n).resolveInner(e.head),s=t?E.closedBy:E.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;jd(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?Ye(n,i.from,1):Ye(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const Ud=n=>We(n,e=>Vn(n.state,e,!de(n))),Gd=n=>We(n,e=>Vn(n.state,e,de(n)));function ph(n,e){return We(n,t=>{if(!t.empty)return Fn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const gh=n=>ph(n,!1),mh=n=>ph(n,!0);function yh(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):Fn(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottombh(n,!1),Js=n=>bh(n,!0);function mt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const Jd=n=>We(n,e=>mt(n,e,!0)),Yd=n=>We(n,e=>mt(n,e,!1)),Xd=n=>We(n,e=>mt(n,e,!de(n))),_d=n=>We(n,e=>mt(n,e,de(n))),Qd=n=>We(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),Zd=n=>We(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function ep(n,e,t){let i=!1,s=Xt(n.selection,r=>{let o=Ye(n,r.head,-1)||Ye(n,r.head,1)||r.head>0&&Ye(n,r.head-1,1)||r.headep(n,e,!1);function Ie(n,e){let t=Xt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Qe(n.state,t)),!0)}function wh(n,e){return Ie(n,t=>n.moveByChar(t,e))}const xh=n=>wh(n,!de(n)),vh=n=>wh(n,de(n));function kh(n,e){return Ie(n,t=>n.moveByGroup(t,e))}const ip=n=>kh(n,!de(n)),np=n=>kh(n,de(n)),sp=n=>Ie(n,e=>Vn(n.state,e,!de(n))),rp=n=>Ie(n,e=>Vn(n.state,e,de(n)));function Sh(n,e){return Ie(n,t=>n.moveVertically(t,e))}const Ch=n=>Sh(n,!1),Ah=n=>Sh(n,!0);function Mh(n,e){return Ie(n,t=>n.moveVertically(t,e,yh(n).height))}const Go=n=>Mh(n,!1),Jo=n=>Mh(n,!0),op=n=>Ie(n,e=>mt(n,e,!0)),lp=n=>Ie(n,e=>mt(n,e,!1)),ap=n=>Ie(n,e=>mt(n,e,!de(n))),hp=n=>Ie(n,e=>mt(n,e,de(n))),cp=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).from)),fp=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).to)),Yo=({state:n,dispatch:e})=>(e(Qe(n,{anchor:0})),!0),Xo=({state:n,dispatch:e})=>(e(Qe(n,{anchor:n.doc.length})),!0),_o=({state:n,dispatch:e})=>(e(Qe(n,{anchor:n.selection.main.anchor,head:0})),!0),Qo=({state:n,dispatch:e})=>(e(Qe(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),up=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),dp=({state:n,dispatch:e})=>{let t=Wn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},pp=({state:n,dispatch:e})=>{let t=Xt(n.selection,i=>{var s;let r=me(n).resolveStack(i.from,1);for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&(!((s=l.parent)===null||s===void 0)&&s.parent))return b.range(l.to,l.from)}return i});return e(Qe(n,t)),!0},gp=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(Qe(n,i)),!0):!1};function Bi(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=Xi(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Xi(n,o,!1),l=Xi(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const Dh=(n,e)=>Bi(n,t=>{let i=t.from,{state:s}=n,r=s.doc.lineAt(i),o,l;if(!e&&i>r.from&&iDh(n,!1),Oh=n=>Dh(n,!0),Th=(n,e)=>Bi(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ce(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),Bh=n=>Th(n,!1),mp=n=>Th(n,!0),yp=n=>Bi(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headBi(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),wp=n=>Bi(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:V.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},vp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ce(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ce(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Wn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Ph(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Wn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const kp=({state:n,dispatch:e})=>Ph(n,e,!1),Sp=({state:n,dispatch:e})=>Ph(n,e,!0);function Lh(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Wn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Cp=({state:n,dispatch:e})=>Lh(n,e,!1),Ap=({state:n,dispatch:e})=>Lh(n,e,!0),Mp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Wn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Dp(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=me(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(E.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Op=Rh(!1),Tp=Rh(!0);function Rh(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Dp(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new En(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=Ka(h,r);for(c==null&&(c=Yt(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Bp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new En(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=br(n,(r,o,l)=>{let a=Ka(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=xn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(br(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Rn)})}),{userEvent:"input.indent"})),!0),Lp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(br(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Yt(s,n.tabSize),o=0,l=xn(n,Math.max(0,r-Ot(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),bm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Ud,shift:sp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Gd,shift:rp},{key:"Alt-ArrowUp",run:kp},{key:"Shift-Alt-ArrowUp",run:Cp},{key:"Alt-ArrowDown",run:Sp},{key:"Shift-Alt-ArrowDown",run:Ap},{key:"Escape",run:gp},{key:"Mod-Enter",run:Tp},{key:"Alt-l",mac:"Ctrl-l",run:dp},{key:"Mod-i",run:pp,preventDefault:!0},{key:"Mod-[",run:Lp},{key:"Mod-]",run:Pp},{key:"Mod-Alt-\\",run:Bp},{key:"Shift-Mod-k",run:Mp},{key:"Shift-Mod-\\",run:tp},{key:"Mod-/",run:Ad},{key:"Alt-A",run:Dd}].concat(Ep);function re(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class Jt{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Zo(l)):Zo,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ne(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Zs(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Be(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=kn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new zt(t,e.sliceString(t,i));return ns.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=kn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=zt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Nh.prototype[Symbol.iterator]=Fh.prototype[Symbol.iterator]=function(){return this});function Ip(n){try{return new RegExp(n,wr),!0}catch{return!1}}function kn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Xs(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=re("input",{class:"cm-textfield",name:"line",value:e}),i=re("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:Sn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},re("label",n.state.phrase("Go to line"),": ",t)," ",re("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=r,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),m=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[Sn.of(!1),T.scrollIntoView(m.from,{y:"center"})],selection:m}),n.focus()}return{dom:i}}const Sn=F.define(),el=ye.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Sn)&&(n=t.value);return n},provide:n=>mn.from(n,e=>e?Xs:null)}),Np=n=>{let e=gn(n,Xs);if(!e){let t=[Sn.of(!0)];n.state.field(el,!1)==null&&t.push(F.appendConfig.of([el,Fp])),n.dispatch({effects:t}),e=gn(n,Xs)}return e&&e.dom.querySelector("input").select(),!0},Fp=T.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Vp={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Vh=O.define({combine(n){return Bt(n,Vp,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function wm(n){let e=[$p,qp];return n&&e.push(Vh.of(n)),e}const Wp=P.mark({class:"cm-selectionMatch"}),Hp=P.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function tl(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=U.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=U.Word)}function zp(n,e,t,i){return n(e.sliceDoc(t,t+1))==U.Word&&n(e.sliceDoc(i-1,i))==U.Word}const qp=ue.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Vh),{state:t}=n,i=t.selection;if(i.ranges.length>1)return P.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return P.none;let a=t.wordAt(s.head);if(!a)return P.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return P.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(tl(o,t,s.from,s.to)&&zp(o,t,s.from,s.to)))return P.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return P.none}let l=[];for(let a of n.visibleRanges){let h=new Jt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||tl(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Hp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Wp.range(c,f)),l.length>e.maxMatches))return P.none}}return P.set(l)}},{decorations:n=>n.decorations}),$p=T.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Kp=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function jp(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Jt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Jt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Up=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Kp({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=jp(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:T.scrollIntoView(s.to)})),!0):!1},_t=O.define({combine(n){return Bt(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new ng(e),scrollToMatch:e=>T.scrollIntoView(e)})}});class Wh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Ip(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Xp(this):new Jp(this)}getCursor(e,t=0,i){let s=e.doc?e:H.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?It(this,s,t,i):Et(this,s,t,i)}}class Hh{constructor(e){this.spec=e}}function Et(n,e,t,i){return new Jt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Gp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Gp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Et(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function It(n,e,t,i){return new Nh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Yp(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Cn(n,e){return n.slice(ce(n,e,!1),e)}function An(n,e){return n.slice(e,ce(n,e))}function Yp(n){return(e,t,i)=>!i[0].length||(n(Cn(i.input,i.index))!=U.Word||n(An(i.input,i.index))!=U.Word)&&(n(An(i.input,i.index+i[0].length))!=U.Word||n(Cn(i.input,i.index+i[0].length))!=U.Word)}class Xp extends Hh{nextMatch(e,t,i){let s=It(this.spec,e,i,e.doc.length).next();return s.done&&(s=It(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=It(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=It(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Si=F.define(),xr=F.define(),ct=ye.define({create(n){return new ss(_s(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Si)?n=new ss(t.value.create(),n.panel):t.is(xr)&&(n=new ss(n.query,t.value?vr:null));return n},provide:n=>mn.from(n,e=>e.panel)});class ss{constructor(e,t){this.query=e,this.panel=t}}const _p=P.mark({class:"cm-searchMatch"}),Qp=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Zp=ue.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ct))}update(n){let e=n.state.field(ct);(e!=n.startState.field(ct)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return P.none;let{view:t}=this,i=new At;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Qp:_p)})}return i.finish()}},{decorations:n=>n.decorations});function Pi(n){return e=>{let t=e.state.field(ct,!1);return t&&t.query.spec.valid?n(e,t):$h(e)}}const Mn=Pi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(_t);return n.dispatch({selection:s,effects:[kr(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),qh(n),!0}),Dn=Pi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(_t);return n.dispatch({selection:r,effects:[kr(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),qh(n),!0}),eg=Pi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),tg=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Jt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},il=Pi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(T.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-c,r.to-c),h.push(kr(n,r)),h.push(t.facet(_t).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),ig=Pi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:T.announce.of(i),userEvent:"input.replace.all"}),!0});function vr(n){return n.state.facet(_t).createPanel(n)}function _s(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(_t);return new Wh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function zh(n){let e=gn(n,vr);return e&&e.dom.querySelector("[main-field]")}function qh(n){let e=zh(n);e&&e==n.root.activeElement&&e.select()}const $h=n=>{let e=n.state.field(ct,!1);if(e&&e.panel){let t=zh(n);if(t&&t!=n.root.activeElement){let i=_s(n.state,e.query.spec);i.valid&&n.dispatch({effects:Si.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[xr.of(!0),e?Si.of(_s(n.state,e.query.spec)):F.appendConfig.of(rg)]});return!0},Kh=n=>{let e=n.state.field(ct,!1);if(!e||!e.panel)return!1;let t=gn(n,vr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:xr.of(!1)}),!0},xm=[{key:"Mod-f",run:$h,scope:"editor search-panel"},{key:"F3",run:Mn,shift:Dn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Mn,shift:Dn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Kh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:tg},{key:"Alt-g",run:Np},{key:"Mod-d",run:Up,preventDefault:!0}];class ng{constructor(e){this.view=e;let t=this.query=e.state.field(ct).query.spec;this.commit=this.commit.bind(this),this.searchField=re("input",{value:t.search,placeholder:Se(e,"Find"),"aria-label":Se(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=re("input",{value:t.replace,placeholder:Se(e,"Replace"),"aria-label":Se(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=re("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=re("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=re("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return re("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=re("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>Mn(e),[Se(e,"next")]),i("prev",()=>Dn(e),[Se(e,"previous")]),i("select",()=>eg(e),[Se(e,"all")]),re("label",null,[this.caseField,Se(e,"match case")]),re("label",null,[this.reField,Se(e,"regexp")]),re("label",null,[this.wordField,Se(e,"by word")]),...e.state.readOnly?[]:[re("br"),this.replaceField,i("replace",()=>il(e),[Se(e,"replace")]),i("replaceAll",()=>ig(e),[Se(e,"replace all")])],re("button",{name:"close",onclick:()=>Kh(e),"aria-label":Se(e,"close"),type:"button"},["×"])])}commit(){let e=new Wh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Si.of(e)}))}keydown(e){_f(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Dn:Mn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),il(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Si)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(_t).top}}function Se(n,e){return n.state.phrase(e)}const _i=30,Qi=/[\s\.,:;?!]/;function kr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-_i),o=Math.min(s,t+_i),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<_i;a++)if(!Qi.test(l[a+1])&&Qi.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-_i;a--)if(!Qi.test(l[a-1])&&Qi.test(l[a])){l=l.slice(0,a);break}}return T.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const sg=T.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),rg=[ct,Tt.low(Zp),sg];class jh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=me(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(Uh(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function nl(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function og(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:og(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function vm(n,e){return t=>{for(let i=me(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class sl{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function ft(n){return n.selection.main.from}function Uh(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Gh=nt.define();function ag(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:b.cursor(l.from+r+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const rl=new WeakMap;function hg(n){if(!Array.isArray(n))return n;let e=rl.get(n);return e||rl.set(n,e=lg(n)),e}const Sr=F.define(),Ci=F.define();class cg{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:(A=Zs(w))!=A.toLowerCase()?1:A!=A.toUpperCase()?2:0;(!x||C==1&&g||v==0&&C!=0)&&(t[f]==w||i[f]==w&&(u=!0)?o[f++]=x:o.length&&(y=!1)),v=C,x+=Be(w)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Be(ne(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const he=O.define({combine(n){return Bt(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:fg,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>ol(e(i),t(i)),optionClass:(e,t)=>i=>ol(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function ol(n,e){return n?e?n+" "+e:n:e}function fg(n,e,t,i,s,r){let o=n.textDirection==_.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u=m||x>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function ug(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let h=0;ha&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className="cm-completionMatchedText",a=f}return at.position-i.position).map(t=>t.render)}function rs(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class dg{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(he);this.optionContent=ug(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=rs(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(he).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Ci.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=rs(r.length,o,e.state.facet(he).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=rs(t.options.length,t.selected,this.view.state.facet(he).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Ne(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&gg(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew dg(t,n,e)}function gg(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function ll(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function mg(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new sl(c,a.source,h?h(c):[],1e9-t.length));else{let c=new cg(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new sl(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):ll(a.completion)>ll(o)&&(r[r.length-1]=a),o=a.completion}return r}class Nt{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Nt(this.options,al(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=mg(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Nt(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(he).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:vg,above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Nt(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class On{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new On(wg,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(he),r=(i.override||t.languageDataAt("autocomplete",ft(t)).map(hg)).map(l=>(this.active.find(h=>h.source==l)||new xe(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!yg(r,this.active)?o=Nt.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new xe(l.source,0):l));for(let l of e.effects)l.is(Yh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new On(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:bg}}function yg(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const wg=[];function Qs(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class xe{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Qs(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new xe(s.source,0));for(let r of e.effects)if(r.is(Sr))s=new xe(s.source,1,r.value?ft(e.state):-1);else if(r.is(Ci))s=new xe(s.source,0);else if(r.is(Jh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new xe(this.source,1)}handleChange(e){return e.changes.touchesRange(ft(e.startState))?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new xe(this.source,this.state,e.mapPos(this.explicitPos))}}class qt extends xe{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ft(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&ft(e.startState)==this.from)return new xe(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return xg(this.result.validFor,e.state,r,o)?new qt(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new jh(e.state,l,a>=0)))?new qt(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:ft(e.state)):new xe(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new xe(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new qt(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function xg(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):Uh(n,!0).test(s)}const Jh=F.define({map(n,e){return n.map(t=>t.map(e))}}),Yh=F.define(),Ae=ye.define({create(){return On.start()},update(n,e){return n.update(e)},provide:n=>[La.from(n,e=>e.tooltip),T.contentAttributes.from(n,e=>e.attrs)]});function Xh(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Ae).active.find(s=>s.source==e.source);return i instanceof qt?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},ag(n.state,t,i.from,i.to)),{annotations:Gh.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const vg=pg(Ae,Xh);function Zi(n,e="option"){return t=>{let i=t.state.field(Ae,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Yh.of(l)}),!0}}const kg=n=>{let e=n.state.field(Ae,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Ae,!1)?(n.dispatch({effects:Sr.of(!0)}),!0):!1,Cg=n=>{let e=n.state.field(Ae,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Ci.of(null)}),!0)};class Ag{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Mg=50,Dg=1e3,Og=ue.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Ae).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ae);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ae)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Qs(i));for(let i=0;iMg&&Date.now()-s.time>Dg){for(let r of s.context.abortListeners)try{r()}catch(o){Ne(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),50):-1,this.composing!=0)for(let i of n.transactions)Qs(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Ae);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=ft(e),i=new jh(e,t,n.explicitPos==t),s=new Ag(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Ci.of(null)}),Ne(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(he).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(he);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new xe(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:Jh.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Ae,!1);if(e&&e.tooltip&&this.view.state.facet(he).closeOnBlur){let t=e.open&&Ra(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:Ci.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Sr.of(!1)}),20),this.composing=0}}}),_h=T.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Tg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class Cr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,le.TrackDel),i=e.mapPos(this.to,1,le.TrackDel);return t==null||i==null?null:new Cr(this.field,t,i)}}class Ar{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew Cr(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new Tg(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new Ar(i,s)}}let Bg=P.widget({widget:new class extends Pt{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),Pg=P.mark({class:"cm-snippetField"});class Qt{constructor(e,t){this.ranges=e,this.active=t,this.deco=P.set(e.map(i=>(i.from==i.to?Bg:Pg).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Qt(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Li=F.define({map(n,e){return n&&n.map(e)}}),Lg=F.define(),Ai=ye.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Li))return t.value;if(t.is(Lg)&&n)return new Qt(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>T.decorations.from(n,e=>e?e.deco:P.none)});function Mr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function Rg(n){let e=Ar.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:V.of(o)},scrollIntoView:!0,annotations:i?Gh.of(i):void 0};if(l.length&&(a.selection=Mr(l,0)),l.length>1){let h=new Qt(l,0),c=a.effects=[Li.of(h)];t.state.field(Ai,!1)===void 0&&c.push(F.appendConfig.of([Ai,Vg,Wg,_h]))}t.dispatch(t.state.update(a))}}function Qh(n){return({state:e,dispatch:t})=>{let i=e.field(Ai,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:Mr(i.ranges,s),effects:Li.of(r?null:new Qt(i.ranges,s)),scrollIntoView:!0})),!0}}const Eg=({state:n,dispatch:e})=>n.field(Ai,!1)?(e(n.update({effects:Li.of(null)})),!0):!1,Ig=Qh(1),Ng=Qh(-1),Fg=[{key:"Tab",run:Ig,shift:Ng},{key:"Escape",run:Eg}],hl=O.define({combine(n){return n.length?n[0]:Fg}}),Vg=Tt.highest(ar.compute([hl],n=>n.facet(hl)));function km(n,e){return Object.assign(Object.assign({},e),{apply:Rg(n)})}const Wg=T.domEventHandlers({mousedown(n,e){let t=e.state.field(Ai,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:Mr(t.ranges,s.field),effects:Li.of(t.ranges.some(r=>r.field>s.field)?new Qt(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Mi={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},St=F.define({map(n,e){let t=e.mapPos(n,-1,le.TrackAfter);return t??void 0}}),Dr=new class extends Ct{};Dr.startSide=1;Dr.endSide=-1;const Zh=ye.define({create(){return Y.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}n=n.map(e.changes);for(let t of e.effects)t.is(St)&&(n=n.update({add:[Dr.range(t.value,t.value+1)]}));return n}});function Sm(){return[zg,Zh]}const os="()[]{}<>";function ec(n){for(let e=0;e{if((Hg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Be(ne(i,0))==1||e!=s.from||t!=s.to)return!1;let r=$g(n.state,i);return r?(n.dispatch(r),!0):!1}),qg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=tc(n,n.selection.main.head).brackets||Mi.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Kg(n.doc,o.head);for(let a of i)if(a==l&&Hn(n.doc,o.head)==ec(ne(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Cm=[{key:"Backspace",run:qg}];function $g(n,e){let t=tc(n,n.selection.main.head),i=t.brackets||Mi.brackets;for(let s of i){let r=ec(ne(s,0));if(e==s)return r==s?Gg(n,s,i.indexOf(s+s+s)>-1,t):jg(n,s,r,t.before||Mi.before);if(e==r&&ic(n,n.selection.main.from))return Ug(n,s,r)}return null}function ic(n,e){let t=!1;return n.field(Zh).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Hn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Be(ne(t,0)))}function Kg(n,e){let t=n.sliceString(e-2,e);return Be(ne(t,0))==t.length?t:t.slice(1)}function jg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:St.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Hn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:St.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Ug(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Hn(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Gg(n,e,t,i){let s=i.stringPrefixes||Mi.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:St.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Hn(n.doc,a),c;if(h==e){if(cl(n,a))return{changes:{insert:e+e,from:a},effects:St.of(a+e.length),range:b.cursor(a+e.length)};if(ic(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=fl(n,a-2*e.length,s))>-1&&cl(n,c))return{changes:{insert:e+e+e+e,from:a},effects:St.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=U.Word&&fl(n,a,s)>-1&&!Jg(n,a,e,s))return{changes:{insert:e+e,from:a},effects:St.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function cl(n,e){let t=me(n).resolveInner(e+1);return t.parent&&t.from==e}function Jg(n,e,t,i){let s=me(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function fl(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=U.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=U.Word)return r}return-1}function Am(n={}){return[Ae,he.of(n),Og,Xg,_h]}const Yg=[{key:"Ctrl-Space",run:Sg},{key:"Escape",run:Cg},{key:"ArrowDown",run:Zi(!0)},{key:"ArrowUp",run:Zi(!1)},{key:"PageDown",run:Zi(!0,"page")},{key:"PageUp",run:Zi(!1,"page")},{key:"Enter",run:kg}],Xg=Tt.highest(ar.computeN([he],n=>n.facet(he).defaultKeymap?[Yg]:[]));export{cm as A,fm as B,Tn as C,Ou as D,T as E,um as F,lm as G,me as H,J as I,sm as J,vm as K,qs as L,lg as M,hr as N,b as O,Va as P,km as Q,hm as R,Qa as S,$ as T,am as U,_u as V,za as W,gd as X,H as a,em as b,mm as c,Qg as d,Zg as e,gm as f,Sm as g,nm as h,wm as i,Cm as j,ar as k,bm as l,xm as m,ym as n,Yg as o,Am as p,tm as q,im as r,dm as s,pm as t,ge as u,E as v,Uu as w,M as x,rm as y,ed as z}; diff --git a/ui/dist/assets/index-30dee195.js b/ui/dist/assets/index-30dee195.js deleted file mode 100644 index f3dc6b53..00000000 --- a/ui/dist/assets/index-30dee195.js +++ /dev/null @@ -1,13 +0,0 @@ -class N{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),qe.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),qe.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new li(this),r=new li(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new li(this,e)}iterRange(e,t=this.length){return new hl(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new cl(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?N.empty:e.length<=32?new G(e):qe.from(G.split(e,[]))}}class G extends N{constructor(e,t=ec(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new tc(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new G(Mr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Xi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new G(l,o.length+r.length));else{let a=l.length>>1;i.push(new G(l.slice(0,a)),new G(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof G))return super.replace(e,t,i);let s=Xi(this.text,Xi(i.text,Mr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new G(s,r):qe.from(G.split(s,[]),r)}sliceString(e,t=this.length,i=` -`){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new G(i,s)),i=[],s=-1);return s>-1&&t.push(new G(i,s)),t}}class qe extends N{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if(i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[s]=a,new qe(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` -`){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qe))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new G(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof qe)for(let m of d.children)f(m);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof G&&a&&(p=c[c.length-1])instanceof G&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new G(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:qe.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new qe(l,t)}}N.empty=new G([""],0);function ec(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Xi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-s)),s0?1:(e instanceof G?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof G?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(s instanceof G){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof G?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class hl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new li(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class cl{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(N.prototype[Symbol.iterator]=function(){return this.iter()},li.prototype[Symbol.iterator]=hl.prototype[Symbol.iterator]=cl.prototype[Symbol.iterator]=function(){return this});class tc{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let It="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return It[e-1]<=n;return!1}function Dr(n){return n>=127462&&n<=127487}const Or=8205;function fe(n,e,t=!0,i=!0){return(t?fl:nc)(n,e,i)}function fl(n,e,t){if(e==n.length)return e;e&&ul(n.charCodeAt(e))&&dl(n.charCodeAt(e-1))&&e--;let i=ie(n,e);for(e+=Oe(i);e=0&&Dr(ie(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function nc(n,e,t){for(;e>0;){let i=fl(n,e-2,t);if(i=56320&&n<57344}function dl(n){return n>=55296&&n<56320}function ie(n,e){let t=n.charCodeAt(e);if(!dl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return ul(i)?(t-55296<<10)+(i-56320)+65536:t}function Xs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Oe(n){return n<65536?1:2}const ss=/\r\n?|\n/;var ae=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ae||(ae={}));class Ge{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(i!=ae.Simple&&h>=e&&(i==ae.TrackDel&&se||i==ae.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ge(e)}static create(e){return new Ge(e)}}class Q extends Ge{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return rs(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return os(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length0&&rt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!s.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?N.of(d.split(i||ss)):d:N.empty,m=p.length;if(f==u&&m==0)return;fo&&le(s,f-o,-1),le(s,u-f,m),rt(r,s,p),o=u}}return h(e),a(!l),l}static empty(e){return new Q(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function rt(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,h,r,c,f),s=h,r=c}}}function os(n,e,t,i=!1){let s=[],r=i?[]:null,o=new ci(n),l=new ci(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);le(s,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class ci{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?N.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?N.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class yt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new yt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return b.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return b.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return b.range(e.anchor,e.head)}static create(e,t,i){return new yt(e,t,i)}}class b{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:b.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new b(e.ranges.map(t=>yt.fromJSON(t)),e.main)}static single(e,t=e){return new b([b.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?8:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?b.range(a,l):b.range(l,a))}}return new b(e,t)}}function gl(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _s=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=_s++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Qs),!!e.static,e.enables)}of(e){return new _i([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _i(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new _i(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Qs(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class _i{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=_s++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||ls(f,c)){let d=i(f);if(l?!Tr(d,f.values[o],s):!s(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let m=on(u,p);if(this.dependencies.every(g=>g instanceof D?u.facet(g)===f.facet(g):g instanceof be?u.field(g,!1)==f.field(g,!1):!0)||(l?Tr(d=i(f),m,s):s(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}}function Tr(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let h=[];for(let c=0;ci===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Br).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Br.of({field:this,create:e})]}get extension(){return this}}const mt={lowest:4,low:3,default:2,high:1,highest:0};function Xt(n){return e=>new ml(e,n)}const Mt={highest:Xt(mt.highest),high:Xt(mt.high),default:Xt(mt.default),low:Xt(mt.low),lowest:Xt(mt.lowest)};class ml{constructor(e,t){this.inner=e,this.prec=t}}class Mn{of(e){return new as(this,e)}reconfigure(e){return Mn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class as{constructor(e,t){this.compartment=e,this.inner=t}}class rn{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let u of rc(e,t,o))u instanceof be?s.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of s)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,m=c&&c[u]||[];if(d.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,Qs(m,d))a.push(i.facet(p));else{let g=p.combine(d.map(y=>y.value));a.push(i&&p.compare(g,i.facet(p))?i.facet(p):g)}else{for(let g of d)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=h.length<<1,h.push(y=>g.dynamicSlot(y)));l[p.id]=h.length<<1,h.push(g=>sc(g,p,d))}}let f=h.map(u=>u(l));return new rn(e,o,f,l,a,r)}}function rc(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof as&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof as){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof ml)r(o.inner,o.prec);else if(o instanceof be)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof _i)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,mt.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(n,mt.default),i.reduce((o,l)=>o.concat(l))}function ai(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function on(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const yl=D.define(),bl=D.define({combine:n=>n.some(e=>e),static:!0}),wl=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),xl=D.define(),vl=D.define(),kl=D.define(),Sl=D.define({combine:n=>n.length?n[0]:!1});class tt{constructor(e,t){this.type=e,this.value=t}static define(){return new oc}}class oc{of(e){return new tt(this,e)}}class lc{constructor(e){this.map=e}of(e){return new I(this,e)}}class I{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new I(this.type,t)}is(e){return this.type==e}static define(e={}){return new lc(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}I.reconfigure=I.define();I.appendConfig=I.define();class Z{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&gl(i,t.newLength),r.some(l=>l.type==Z.time)||(this.annotations=r.concat(Z.time.of(Date.now())))}static create(e,t,i,s,r,o){return new Z(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Z.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Z.time=tt.define();Z.userEvent=tt.define();Z.addToHistory=tt.define();Z.remote=tt.define();function ac(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof Z?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Z?n=r[0]:n=Al(e,Nt(r),!1)}return n}function cc(n){let e=n.startState,t=e.facet(kl),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Cl(i,hs(e,r,n.changes.newLength),!0))}return i==n?n:Z.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const fc=[];function Nt(n){return n==null?fc:Array.isArray(n)?n:[n]}var K=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(K||(K={}));const uc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let cs;try{cs=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function dc(n){if(cs)return cs.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||uc.test(t)))return!0}return!1}function pc(n){return e=>{if(!/\S/.test(e))return K.Space;if(dc(e))return K.Word;for(let t=0;t-1)return K.Word;return K.Other}}class F{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(I.reconfigure)?(t=null,i=o.value):o.is(I.appendConfig)&&(t=null,i=Nt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=rn.resolve(i,s,this),r=new F(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new F(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:b.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Nt(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return F.create({doc:e.doc,selection:b.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=rn.resolve(e.extensions||[],new Map),i=e.doc instanceof N?e.doc:N.of((e.doc||"").split(t.staticFacet(F.lineSeparator)||ss)),s=e.selection?e.selection instanceof b?e.selection:b.single(e.selection.anchor,e.selection.head):b.single(0);return gl(s,i.length),t.staticFacet(bl)||(s=s.asSingle()),new F(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(F.tabSize)}get lineBreak(){return this.facet(F.lineSeparator)||` -`}get readOnly(){return this.facet(Sl)}phrase(e,...t){for(let i of this.facet(F.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(yl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return pc(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=fe(t,o,!1);if(r(t.slice(a,o))!=K.Word)break;o=a}for(;ln.length?n[0]:4});F.lineSeparator=wl;F.readOnly=Sl;F.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});F.languageData=yl;F.changeFilter=xl;F.transactionFilter=vl;F.transactionExtender=kl;Mn.reconfigure=I.define();function Dt(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class vt{eq(e){return this==e}range(e,t=e){return fs.create(e,t,this)}}vt.prototype.startSide=vt.prototype.endSide=0;vt.prototype.point=!1;vt.prototype.mapMode=ae.TrackDel;let fs=class Ml{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Ml(e,t,i)}};function us(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Zs{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Zs(s,r,i,l):null,pos:o}}}class ${constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new $(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(us)),this.isEmpty)return t.length?$.of(t):this;let l=new Dl(this,null,-1).goto(0),a=0,h=[],c=new kt;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return fi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return fi.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=Pr(o,l,i),h=new _t(o,a,r),c=new _t(l,a,r);i.iterGaps((f,u,d)=>Lr(h,f,c,u,d,s)),i.empty&&i.length==0&&Lr(h,0,c,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=Pr(r,o),a=new _t(r,l,0).goto(i),h=new _t(o,l,0).goto(i);for(;;){if(a.to!=h.to||!ds(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>s)return!0;a.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new _t(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(s.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new kt;for(let s of e instanceof fs?[e]:t?gc(e):e)i.add(s.from,s.to,s.value);return i.finish()}}$.empty=new $([],[],null,-1);function gc(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(us);e=i}return n}$.empty.nextLayer=$.empty;class kt{finishChunk(e){this.chunks.push(new Zs(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new kt)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner($.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=$.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Pr(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new Dl(o,t,i,r));return s.length==1?s[0]:new fi(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Vn(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Vn(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Vn(this.heap,0)}}}function Vn(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class _t{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=fi.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Pi(this.active,e),Pi(this.activeTo,e),Pi(this.activeRank,e),this.minActive=Rr(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&Pi(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Lr(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let h=n.to+a-t.to||n.endSide-t.endSide,c=h<0?n.to+a:t.to,f=Math.min(c,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&ds(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(l,f,n.point,t.point):f>l&&!ds(n.active,t.active)&&r.compareRange(l,f,n.active,t.active),c>o)break;l=c,h<=0&&n.next(),h>=0&&t.next()}}function ds(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Rr(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=fe(n,s)}return i===!0?-1:n.length}const gs="ͼ",Er=typeof Symbol>"u"?"__"+gs:Symbol.for(gs),ms=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Ir=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ct{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(s(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Ir[Er]||1;return Ir[Er]=e+1,gs+e.toString(36)}static mount(e,t,i){let s=e[ms],r=i&&i.nonce;s?r&&s.setNonce(r):s=new mc(e,r),s.mount(Array.isArray(t)?t:[t])}}let Nr=new Map;class mc{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=Nr.get(i);if(r)return e.adoptedStyleSheets=[r.sheet,...e.adoptedStyleSheets],e[ms]=r;this.sheet=new s.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Nr.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let r=e.head||e;r.insertBefore(this.styleTag,r.firstChild)}this.modules=[],e[ms]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yc=typeof navigator<"u"&&/Mac/.test(navigator.platform),bc=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ne=0;ne<10;ne++)ft[48+ne]=ft[96+ne]=String(ne);for(var ne=1;ne<=24;ne++)ft[ne+111]="F"+ne;for(var ne=65;ne<=90;ne++)ft[ne]=String.fromCharCode(ne+32),ui[ne]=String.fromCharCode(ne);for(var Wn in ft)ui.hasOwnProperty(Wn)||(ui[Wn]=ft[Wn]);function wc(n){var e=yc&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||bc&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ui:ft)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function ln(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function ys(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function xc(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Qi(n,e){if(!e.anchorNode)return!1;try{return ys(n,e.anchorNode)}catch{return!1}}function Ht(n){return n.nodeType==3?St(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function an(n,e,t,i){return t?Fr(n,e,t,i,-1)||Fr(n,e,t,i,1):!1}function di(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Fr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:Qe(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=di(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?Qe(n):0}else return!1}}function Qe(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Dn(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function vc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function kc(n,e,t,i,s,r,o,l){let a=n.ownerDocument,h=a.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,m=1;if(d)u=vc(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let v=c.getBoundingClientRect();p=v.width/c.offsetWidth,m=v.height/c.offsetHeight,u={left:v.left,right:v.left+c.clientWidth*p,top:v.top,bottom:v.top+c.clientHeight*m}}let g=0,y=0;if(s=="nearest")e.top0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y0&&e.right>u.right+g&&(g=e.right-u.right+g+r)):e.right>u.right&&(g=e.right-u.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Cc{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Qe(t):0),i,Math.min(e.focusOffset,i?Qe(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Pt=null;function Ol(n){if(n.setActive)return n.setActive();if(Pt)return n.focus(Pt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Pt==null?{get preventScroll(){return Pt={preventScroll:!0},!0}}:void 0),!Pt){Pt=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class he{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new he(e.parentNode,di(e),t)}static after(e,t){return new he(e.parentNode,di(e)+1,t)}}const er=[];class q{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,s=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=s?s.nextSibling:i.firstChild)){let l=q.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(e,t),o.flags&=-8}if(r=s?s.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&r!=o.dom&&(t.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Wr(r);else i.insertBefore(o.dom,r);s=o.dom}for(r=s?s.nextSibling:i.firstChild,r&&t&&t.node==i&&(t.written=!0);r;)r=Wr(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=Qe(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!q.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return f.domBoundsAround(e,t,h);if(u>=e&&s==-1&&(s=a,r=h),h>t&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=er){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ll(n,e,t,i,s,r,o,l,a){let{children:h}=n,c=h.length?h[e]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(e==i&&c&&!o&&!u&&r.length<2&&c.merge(t,s,r.length?f:null,t==0,l,a))){if(i0&&(!o&&r.length&&c.merge(t,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(t2);var M={mac:qr||/Mac/.test(Me.platform),windows:/Win/.test(Me.platform),linux:/Linux|X11/.test(Me.platform),ie:On,ie_version:El?bs.documentMode||6:xs?+xs[1]:ws?+ws[1]:0,gecko:Hr,gecko_version:Hr?+(/Firefox\/(\d+)/.exec(Me.userAgent)||[0,0])[1]:0,chrome:!!Hn,chrome_version:Hn?+Hn[1]:0,ios:qr,android:/Android\b/.test(Me.userAgent),webkit:zr,safari:Il,webkit_version:zr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:bs.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Dc=256;class Ze extends q{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Ze)||this.length-(t-e)+i.length>Dc||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ze(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new he(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Oc(this.dom,e,t)}}class et extends q{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(Tl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof et&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new et(this.mark,t,o)}domAtPos(e){return Nl(this,e)}coordsAt(e,t){return Vl(this,e,t)}}function Oc(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?M.chrome||M.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return M.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Dn(a,o<0):a||null}class bt extends q{static create(e,t,i){return new bt(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=bt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof bt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?he.before(this.dom):he.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?he.before(this.dom):he.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return N.empty}get isHidden(){return!0}}Ze.prototype.children=bt.prototype.children=zt.prototype.children=er;function Nl(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof et&&s.length&&(i=s[s.length-1])instanceof et&&i.mark.eq(e.mark)?Fl(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Vl(n,e,t){let i=null,s=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&t>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of i)if(r!=t&&(s.indexOf(r)==-1||n[r]!==e[r]))return!1;return!0}function ks(n,e,t){let i=!1;if(e)for(let s in e)t&&s in t||(i=!0,s=="style"?n.style.cssText="":n.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(i=!0,s=="style"?n.style.cssText=t[s]:n.setAttribute(s,t[s]));return i}function Bc(n){let e=Object.create(null);for(let t=0;t0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){tr(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Fl(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=vs(t,this.attrs||{})),i&&(this.attrs=vs({class:i},this.attrs||{}))}domAtPos(e){return Nl(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(Tl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(ks(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&q.get(s)instanceof et;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=q.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!M.ios||!this.children.some(r=>r instanceof Ze))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Ze)||/[^ -~]/.test(i.text))return null;let s=Ht(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Vl(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof _)return r;if(o>t)break}s=o+r.breakAfter}return null}}class lt extends q{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof lt)||!this.widget.compare(i.widget)||e>0&&r<=0||t0}}class Ot{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}destroy(e){}}var De=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(De||(De={}));class B extends vt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Ci(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new ut(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Wl(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new ut(e,i,s,t,e.widget||null,!0)}static line(e){return new Ai(e)}static set(e,t=!1){return $.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}B.none=$.empty;class Ci extends B{constructor(e){let{start:t,end:i}=Wl(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof Ci&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&tr(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Ci.prototype.point=!1;class Ai extends B{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Ai&&this.spec.class==e.spec.class&&tr(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Ai.prototype.mapMode=ae.TrackBefore;Ai.prototype.point=!0;class ut extends B{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?ae.TrackBefore:ae.TrackAfter:ae.TrackDel}get type(){return this.startSide!=this.endSide?De.WidgetRange:this.startSide<=0?De.WidgetBefore:De.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof ut&&Pc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}ut.prototype.point=!0;function Wl(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Pc(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ss(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class hi{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof lt&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new _),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Ri(new zt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof lt)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Ri(new Ze(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ut){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof ut)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new lt(i.widget||new Kr("div"),l,i));else{let a=bt.create(i.widget||new Kr("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),c=!a.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Ri(new zt(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Ri(a,s),r),this.atCursorPos=c,this.pendingBuffer=c?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new hi(e,t,i,r);return o.openEnd=$.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Ri(n,e){for(let t of e)n=new et(t,[n],n.length);return n}class Kr extends Ot{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const Hl=D.define(),zl=D.define(),ql=D.define(),$l=D.define(),Cs=D.define(),Kl=D.define(),jl=D.define(),Ul=D.define({combine:n=>n.some(e=>e)}),Gl=D.define({combine:n=>n.some(e=>e)});class hn{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new hn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const jr=I.define({map:(n,e)=>n.map(e)});function Je(n,e,t){let i=n.facet($l);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Tn=D.define({combine:n=>n.length?n[0]:!0});let Lc=0;const ii=D.define();class ue{constructor(e,t,i,s,r){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this)}static define(e,t){const{eventHandlers:i,eventObservers:s,provide:r,decorations:o}=t||{};return new ue(Lc++,e,i,s,l=>{let a=[ii.of(l)];return o&&a.push(pi.of(h=>{let c=h.plugin(l);return c?o(c):B.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return ue.define(i=>new e(i),t)}}class zn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Je(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Je(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Je(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Jl=D.define(),ir=D.define(),pi=D.define(),nr=D.define(),Yl=D.define();function Ur(n,e,t){let i=n.state.facet(Yl);if(!i.length)return i;let s=i.map(o=>o instanceof Function?o(n):o),r=[];return $.spans(s,e,t,{point(){},span(o,l,a,h){let c=r;for(let f=a.length-1;f>=0;f--,h--){let u=a[f].spec.bidiIsolate,d;if(u!=null)if(h>0&&c.length&&(d=c[c.length-1]).to==o&&d.direction==u)d.to=l,c=d.inner;else{let p={from:o,to:l,direction:u,inner:[]};c.push(p),c=p.inner}}}}),r}const Xl=D.define();function _l(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(Xl)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const ni=D.define();class Le{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new Le(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAc)break;r+=2}if(!a)return i;new Le(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class cn{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Q.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new Le(r,o,l,a))),this.changedRanges=s}static create(e,t,i){return new cn(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var J=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(J||(J={}));const gi=J.LTR,Ql=J.RTL;function Zl(n){let e=[];for(let t=0;t=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function ea(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(Fe[m+1]==-d){let g=Fe[m+2],y=g&2?s:g&4?g&1?r:s:0;y&&(V[f]=V[Fe[m]]=y),l=m;break}}else{if(Fe.length==189)break;Fe[l++]=f,Fe[l++]=u,Fe[l++]=a}else if((p=V[f])==2||p==1){let m=p==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let y=Fe[g+2];if(y&2)break;if(m)Fe[g+2]|=2;else{if(y&4)break;Fe[g+2]|=4}}}}}function Wc(n,e,t,i){for(let s=0,r=i;s<=t.length;s++){let o=s?t[s-1].to:n,l=sa;)p==g&&(p=t[--m].from,g=m?t[m-1].to:n),V[--p]=d;a=c}else r=h,a++}}}function Ms(n,e,t,i,s,r,o){let l=i%2?2:1;if(i%2==s%2)for(let a=e,h=0;aa&&o.push(new ot(a,m.from,d));let g=m.direction==gi!=!(d%2);Ds(n,g?i+1:i,s,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==t||(c?V[p]!=l:V[p]==l))break;p++}u?Ms(n,a,p,i+1,s,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let m=V[a-1];m!=l&&(c=!1,f=m==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let m=r[--h];if(!c)for(let g=m.from,y=h;;){if(g==e)break e;if(y&&r[y-1].to==g)g=r[--y].from;else{if(V[g-1]==l)break e;break}}if(u)u.push(m);else{m.toV.length;)V[V.length]=256;let i=[],s=e==gi?0:1;return Ds(n,s,s,t,0,n.length,i),i}function ta(n){return[new ot(0,n,0)]}let ia="";function zc(n,e,t,i,s){var r;let o=i.head-n.from,l=-1;if(o==0){if(!s||!n.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),l=0)}else if(o==n.length){if(s)return null;let u=e[e.length-1];u.level!=t&&(o=u.side(!0,t),l=e.length-1)}l<0&&(l=ot.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc));let a=e[l];o==a.side(s,t)&&(a=e[l+=s?1:-1],o=a.side(!s,t));let h=s==(a.dir==t),c=fe(n.text,o,h);if(ia=n.text.slice(Math.min(o,c),Math.max(o,c)),c!=a.side(s,t))return b.cursor(c+n.from,h?-1:1,a.level);let f=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return!f&&a.level!=t?b.cursor(s?n.to:n.from,s?-1:1,t):f&&f.level0&&i.length&&(i.every(({fromA:h,toA:c})=>cthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let s=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!Jc(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?$c(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new Le(h,c,e.changes.mapPos(h,-1),e.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(M.ie||M.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=Uc(o,l,e.changes);return i=Le.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=M.chrome||M.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,m;if(i&&i.range.fromBc){let w=hi.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),x=hi.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=w.breakAtStart,p=w.openStart,m=x.openEnd;let k=this.compositionView(i);x.breakAtStart?k.breakAfter=1:x.content.length&&k.merge(k.length,k.length,x.content[0],!1,x.openStart,0)&&(k.breakAfter=x.content[0].breakAfter,x.content.shift()),w.content.length&&k.merge(0,0,w.content[w.content.length-1],!0,0,w.openEnd)&&w.content.pop(),u=w.content.concat(k).concat(x.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:m}=hi.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:g,off:y}=r.findPos(h,1),{i:v,off:C}=r.findPos(a,-1);Ll(this,v,C,g,y,u,d,p,m)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new Ze(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new et(s,[t],t.length);let i=new _;return i.append(t,0),i}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=q.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(e.range.fromB,1),s=this.children[i.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)i=s.childPos(i.off,1),s=s.children[i.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&Qi(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(M.gecko&&l.empty&&!this.hasComposition&&qc(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new he(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||!an(a.node,a.offset,c.anchorNode,c.anchorOffset)||!an(h.node,h.offset,c.focusNode,c.focusOffset))&&(this.view.observer.ignore(()=>{M.android&&M.chrome&&this.dom.contains(c.focusNode)&&Gc(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=ln(this.view.root);if(f)if(l.empty){if(M.gecko){let u=Kc(a.node,a.offset);if(u&&u!=3){let d=sa(a.node,a.offset,u==1?1:-1);d&&(a=new he(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new he(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new he(c.focusNode,c.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=ln(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=_.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let s=e.offset;!i&&s=0;s--){let r=q.get(t.childNodes[s]);r instanceof _&&(i=r.domAtPos(r.length))}return i?new he(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=q.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(ae||l.covers(1))&&(!i||l instanceof _&&!(i instanceof _&&t>=0))&&(i=l,s=h),r=h}return i?i.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),s=this.children[t];if(!(s instanceof _))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(i,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}i=a}if(!(s instanceof Ze))return null;let r=fe(s.text,i);if(r==i)return null;let o=St(s.dom,i,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==J.LTR;for(let h=0,c=0;cs)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(t.push(d.height),o){let p=f.dom.lastChild,m=p?Ht(p):[];if(m.length){let g=m[m.length-1],y=a?g.right-d.left:d.right-g.left;y>l&&(l=y,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?J.RTL:J.LTR}measureTextSize(){for(let r of this.children)if(r instanceof _){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=Ht(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Pl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(B.replace({widget:new Jr(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return B.set(e)}updateDeco(){let e=this.view.state.facet(pi).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=_l(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};kc(this.view.scrollDOM,o,t.head0)i=i.childNodes[s-1],s=Qe(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return{node:i,offset:s};if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function Kc(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function Yc(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return b.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=fe(s.text,r,!1):l=fe(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let h=fe(s.text,o,!1);if(i(s.text.slice(h,o))!=a)break;o=h}for(;ln?e.left-n:Math.max(0,n-e.right)}function _c(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function qn(n,e){return n.tope.top+1}function Yr(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Os(n,e,t){let i,s,r,o,l=!1,a,h,c,f;for(let p=n.firstChild;p;p=p.nextSibling){let m=Ht(p);for(let g=0;gC||o==C&&r>v){i=p,s=y,r=v,o=C;let w=C?t0?g0)}v==0?t>y.bottom&&(!c||c.bottomy.top)&&(h=p,f=y):c&&qn(c,y)?c=Xr(c,y.bottom):f&&qn(f,y)&&(f=Yr(f,y.top))}}if(c&&c.bottom>=t?(i=a,s=c):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let u=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return _r(i,u,t);if(l&&i.contentEditable!="false")return Os(i,u,t);let d=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:d}}function _r(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f=(c.left+c.right)/2,d=u;if((M.chrome||M.gecko)&&St(n,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:n,offset:l+(d?1:0)};s=l+(d?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function ra(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:h}=n.viewState,{x:c,y:f}=e,u=f-l;if(u<0)return 0;if(u>h)return n.state.doc.length;for(let w=n.viewState.heightOracle.textHeight/2,x=!1;a=n.elementAtHeight(u),a.type!=De.Text;)for(;u=i>0?a.bottom+w:a.top-w,!(u>=0&&u<=h);){if(x)return t?null:0;x=!0,i=-i}f=l+u;let d=a.from;if(dn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Qr(n,o,a,c,f);let p=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:p,g=m.elementFromPoint(c,f);g&&!n.contentDOM.contains(g)&&(g=null),g||(c=Math.max(o.left+1,Math.min(o.right-1,c)),g=m.elementFromPoint(c,f),g&&!n.contentDOM.contains(g)&&(g=null));let y,v=-1;if(g&&((s=n.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(p.caretPositionFromPoint){let w=p.caretPositionFromPoint(c,f);w&&({offsetNode:y,offset:v}=w)}else if(p.caretRangeFromPoint){let w=p.caretRangeFromPoint(c,f);w&&({startContainer:y,startOffset:v}=w,(!n.contentDOM.contains(y)||M.safari&&Qc(y,v,c)||M.chrome&&Zc(y,v,c))&&(y=void 0))}}if(!y||!n.docView.dom.contains(y)){let w=_.find(n.docView,d);if(!w)return u>a.top+a.height/2?a.to:a.from;({node:y,offset:v}=Os(w.dom,c,f))}let C=n.docView.nearest(y);if(!C)return null;if(C.isWidget&&((r=C.dom)===null||r===void 0?void 0:r.nodeType)==1){let w=C.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let l=n.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(n.defaultLineHeight-l)*.5)/l);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+ps(o,r,n.state.tabSize)}function Qc(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return St(n,i-1,i).getBoundingClientRect().left>t}function Zc(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():St(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Ts(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==De.Text))return i}return t}function ef(n,e,t,i){let s=Ts(n,e.head),r=!i||s.type!=De.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),l=n.textDirectionAt(s.from),a=n.posAtCoords({x:t==(l==J.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return b.cursor(a,t?-1:1)}return b.cursor(t?s.to:s.from,t?-1:1)}function Zr(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let h=zc(s,r,o,l,t),c=ia;if(!h){if(s.number==(t?n.state.doc.lines:1))return l;c=` -`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=b.cursor(t?s.from:s.to)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function tf(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==K.Space&&(s=o),s==o}}function nf(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s,e.assoc||-1),c=n.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,m=ra(n,{x:f,y:p},!1,r);if(pa.bottom||(r<0?ms)){let g=n.docView.coordsForChar(m),y=!g||p{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,inull),M.gecko&&xf(e.contentDOM.ownerDocument)}handleEvent(e){!uf(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let s of i.observers)s(this.view,t);for(let s of i.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=rf(e),i=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()i.keyCode==e.keyCode))&&!e.ctrlKey||of.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Ft(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&!M.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function eo(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(s){Je(t.state,s)}}}function rf(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let s=i.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(eo(i.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(eo(i.value,o))}}for(let i in Ye)t(i).handlers.push(Ye[i]);for(let i in Ee)t(i).observers.push(Ee[i]);return e}const oa=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],of="dthko",la=[16,17,18,20,91,92,224,225],Ei=6;function Ii(n){return Math.max(0,n)*.7+8}function lf(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class af{constructor(e,t,i,s){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=Sc(e.contentDOM),this.atoms=e.state.facet(nr).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(F.allowMultipleSelections)&&hf(e,t),this.dragging=ff(e,t)&&fa(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&lf(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=_l(this.view);e.clientX-o.left<=r.left+Ei?i=-Ii(r.left-e.clientX):e.clientX+o.right>=r.right-Ei&&(i=Ii(e.clientX-r.right)),e.clientY-o.top<=r.top+Ei?s=-Ii(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Ei&&(s=Ii(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function hf(n,e){let t=n.state.facet(Hl);return t.length?t[0](e):M.mac?e.metaKey:e.ctrlKey}function cf(n,e){let t=n.state.facet(zl);return t.length?t[0](e):M.mac?!e.altKey:!e.ctrlKey}function ff(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=ln(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function uf(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=q.get(t))&&i.ignoreEvent(e))return!1;return!0}const Ye=Object.create(null),Ee=Object.create(null),aa=M.ie&&M.ie_version<15||M.ios&&M.webkit_version<604;function df(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),ha(n,t.value)},50)}function ha(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Bs!=null&&t.selection.ranges.every(a=>a.empty)&&Bs==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:b.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(s++);return{changes:{from:a.from,to:a.to,insert:h.text},range:b.cursor(a.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Ee.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Ye.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Ee.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Ee.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ye.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(ql))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=mf(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new af(n,e,t,i)),i&&n.observer.ignore(()=>Ol(n.contentDOM));let s=n.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function to(n,e,t,i){if(i==1)return b.cursor(e,t);if(i==2)return Yc(n.state,e,t);{let s=_.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return ln>=e.top&&n<=e.bottom,io=(n,e,t)=>ca(e,t)&&n>=t.left&&n<=t.right;function pf(n,e,t,i){let s=_.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&io(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&io(t,i,l)?1:o&&ca(i,o)?-1:1}function no(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:pf(n,t,e.clientX,e.clientY)}}const gf=M.ie&&M.ie_version<=11;let so=null,ro=0,oo=0;function fa(n){if(!gf)return n.detail;let e=so,t=oo;return so=n,oo=Date.now(),ro=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(ro+1)%3:1}function mf(n,e){let t=no(n,e),i=fa(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=no(n,r),h,c=to(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!o){let f=to(n,t.pos,t.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=yf(s,a.pos))?h:l?s.addRange(c):b.create([c])}}}function yf(n,e){for(let t=0;t=e)return b.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Ye.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;return i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};function lo(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&cf(n,e)?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}Ye.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),s=0,r=()=>{++s==t.length&&lo(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return lo(n,e,i,!0),!0}return!1};Ye.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=aa?null:e.clipboardData;return t?(ha(n,t.getData("text/plain")||t.getData("text/uri-text")),!0):(df(n),!1)};function bf(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function wf(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Bs=null;Ye.copy=Ye.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=wf(n.state);if(!t&&!s)return!1;Bs=s?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=aa?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(bf(n,t),!1)};const ua=tt.define();function da(n,e){let t=[];for(let i of n.facet(jl)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:ua.of(!0)}):null}function pa(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=da(n.state,e);t?n.dispatch(t):n.update([])}},10)}Ee.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),pa(n)};Ee.blur=n=>{n.observer.clearSelectionRange(),pa(n)};Ee.compositionstart=Ee.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Ee.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,M.chrome&&M.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Ee.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Ye.beforeinput=(n,e)=>{var t;let i;if(M.chrome&&M.android&&(i=oa.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return!1};const ao=new Set;function xf(n){ao.has(n)||(ao.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const ho=["pre-wrap","normal","pre-line","break-spaces"];class vf{constructor(e){this.lineWrapping=e,this.doc=N.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return ho.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>en&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return pe.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=s[l],u=r.lineAt(a,z.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,z.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=s[l-1].toA;)a=s[l-1].fromA,c=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ce extends ga{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new $e(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ce||s instanceof te&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof te?s=new Ce(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):pe.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class te extends pe{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),c=t.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,e-f/2);return new $e(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.doc.line(r+h);return new $e(c,f,i+l*h,l,0)}}lineAt(e,t,i,s,r){if(t==z.ByHeight)return this.blockAt(e,i,s,r);if(t==z.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new $e(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(e),c=l+h.length*a,f=h.number-o,u=s+l*f+a*(h.from-r-f);return new $e(h.from,h.length,Math.max(s,Math.min(u,s+this.height-c)),c,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=e,f=s;c<=t;){let u=i.doc.lineAt(c);if(c==e){let p=u.number-l;f+=a*p+h*(e-r-p)}let d=a+h*u.length;o(new $e(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof te?i[i.length-1]=new te(r.length+s):i.push(null,new te(s-1))}if(e>0){let r=i[0];r instanceof te?i[0]=new te(e+r.length):i.unshift(new te(e-1),null)}return pe.of(i)}decomposeLeft(e,t){t.push(new te(e-1),null)}decomposeRight(e,t){t.push(null,new te(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new te(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=s.heights[s.index++];a==-1?a=f:Math.abs(f-a)>=en&&(a=-2);let u=new Ce(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new te(r-l).updateHeight(e,l));let h=pe.of(o);return(a<0||Math.abs(h.height-this.height)>=en||Math.abs(a-this.heightMetrics(e,t).perLine)>=en)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Sf extends pe{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return el))return h;let c=t==z.ByPosNoHeight?z.ByPosNoHeight:z.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,z.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&co(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?pe.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function co(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof te&&(i=n[e+1])instanceof te&&n.splice(e-1,3,new te(t.length+1+i.length))}const Cf=5;class sr{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ce?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ce(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=Cf)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ce(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new te(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ce)return e;let t=new Ce(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ce)&&!this.isCovered?this.nodes.push(new Ce(0,-1)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==n.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function Of(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Kn{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new vf(t),this.stateDeco=e.facet(pi).filter(i=>typeof i!="function"),this.heightMap=pe.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle.setDoc(e.doc),[new Le(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=B.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Ni(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?uo:new Lf(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:si(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(pi).filter(c=>typeof c!="function");let s=e.changedRanges,r=Le.extendWithRanges(s,Af(i,this.stateDeco,e?e.changes:Q.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Gl)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?J.RTL:J.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let w=l.width/t.offsetWidth,x=l.height/t.offsetHeight;(w>.995&&w<1.005||!isFinite(w)||Math.abs(l.width-t.offsetWidth)<1)&&(w=1),(x>.995&&x<1.005||!isFinite(x)||Math.abs(l.height-t.offsetHeight)<1)&&(x=1),(this.scaleX!=w||this.scaleY!=x)&&(this.scaleX=w,this.scaleY=x,h|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=Bl(e.scrollDOM);let p=(this.printing?Of:Df)(t,this.paddingTop),m=p.top-this.pixelViewport.top,g=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(w)&&(o=!0),o||s.lineWrapping&&Math.abs(v-this.contentDOMWidth)>s.charWidth){let{lineHeight:x,charWidth:k,textHeight:O}=e.docView.measureTextSize();o=x>0&&s.refresh(r,x,k,O,v/k,w),o&&(e.docView.minWidth=0,h|=8)}m>0&&g>0?c=Math.max(m,g):m<0&&g<0&&(c=Math.min(m,g)),s.heightChanged=!1;for(let x of this.viewports){let k=x.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(x);this.heightMap=(o?pe.empty().applyChanges(this.stateDeco,N.empty,this.heightOracle,[new Le(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new kf(x.from,k))}s.heightChanged&&(h|=2)}let C=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return C&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||C)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Ni(s.lineAt(o-i*1e3,z.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,z.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,z.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=J.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-h)g.fromy));if(!m){if(cg.from<=c&&g.to>=c)){let g=t.moveToLineBoundary(b.cursor(c),!1,!0).head;g>h&&(c=g)}m=new Kn(h,c,this.gapSize(f,h,c,u))}l.push(m)};for(let h of this.viewportLines){if(h.lengthh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];$.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||si(this.heightMap.lineAt(e,z.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return si(this.heightMap.lineAt(this.scaler.fromDOM(e),z.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return si(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ni{constructor(e,t){this.from=e,this.to=t}}function Bf(n,e,t){let i=[],s=n,r=0;return $.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Vi(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Pf(n,e){for(let t of n)if(e(t))return t}const uo={toDOM(n){return n},fromDOM(n){return n},scale:1};class Lf{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,z.ByPos,e,0,0).top,c=t.lineAt(a,z.ByPos,e,0,0).bottom;return s+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tsi(s,e)):n._content)}const Wi=D.define({combine:n=>n.join(" ")}),Ps=D.define({combine:n=>n.indexOf(!0)>-1}),Ls=ct.newName(),ma=ct.newName(),ya=ct.newName(),ba={"&light":"."+ma,"&dark":"."+ya};function Rs(n,e,t){return new ct(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const Rf=Rs("."+Ls,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ba),ri="￿";class Ef{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(F.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ri}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=q.get(s),a=q.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:po(s))||po(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=q.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(If(e,i.node,i.offset)?t:0))}}function If(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:Wf(e),a=new Ef(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Hf(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!ys(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!ys(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=b.single(h,a)}}}function wa(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,h=null;(r===8||M.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(M.mac||M.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:N.of([" "])}):M.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` - `&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:N.of([" "])}),t){if(M.ios&&n.inputState.flushIOSKey()||M.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Ft(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengths.head)&&Ft(n.contentDOM,"Backspace",8)||t.from==s.from&&t.to==s.to+1&&t.insert.length==0&&Ft(n.contentDOM,"Delete",46)))return!0;let o=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,a=()=>l||(l=Ff(n,t,i));return n.state.facet(Kl).some(h=>h(n,t.from,t.to,o,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function Ff(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=n.state.sliceDoc(e.from,e.to),c,f=t&&na(n,t.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=n.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let m=p.to-u,g=m-h.length;if(p.to-p.from!=d||n.state.sliceDoc(g,m)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let y=s.changes({from:g,to:m,insert:e.insert}),v=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+v),Math.max(0,a.head+v)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Vf(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Wf(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new go(t,i)),(s!=t||r!=i)&&e.push(new go(s,r))),e}function Hf(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}const zf={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jn=M.ie&&M.ie_version<=11;class qf{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Cc,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(M.ie&&M.ie_version<=11||M.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),jn&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Tn)?i.root.activeElement!=this.dom:!Qi(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(M.ie&&M.ie_version<=11||M.android&&M.chrome)&&!i.state.selection.main.empty&&s.focusNode&&an(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=M.safari&&e.root.nodeType==11&&xc(this.dom.ownerDocument)==this.dom&&$f(this.view)||ln(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=Qi(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ft(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&Qi(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Nf(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,s=wa(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=mo(t,e.previousSibling||e.target.previousSibling,-1),s=mo(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function mo(n,e,t){for(;e;){let i=q.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function $f(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return an(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class T{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(s=>t(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Ac(e.parent)||document,this.viewState=new fo(e.state||F.create(e)),this.plugins=this.state.facet(ii).map(i=>new zn(i));for(let i of this.plugins)i.update(this);this.observer=new qf(this),this.inputState=new sf(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Gr(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof Z?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(ua))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=da(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(F.phrases)!=this.state.facet(F.phrases))return this.setState(r);s=cn.create(this,r,e),s.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new hn(d.empty?d:b.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(jr)&&(f=d.value)}this.viewState.update(s,f),this.bidiCache=fn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(ni)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Wi)!=s.state.facet(Wi)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let u of this.state.facet(Cs))u(s);(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!wa(this,c)&&h.force&&Ft(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new fo(e),this.plugins=e.facet(ii).map(i=>new zn(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Gr(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(ii),i=e.state.facet(ii);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new zn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Bl(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(s);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Je(this.state,p),yo}}),f=cn.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d1||p<-1){s=s+p,i.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Cs))l(t)}get themeClasses(){return Ls+" "+(this.state.facet(Ps)?ya:ma)+" "+this.state.facet(Wi)}updateAttrs(){let e=bo(this,Jl,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Tn)?"true":"false",class:"cm-content",style:`${M.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),bo(this,ir,t);let i=this.observer.ignore(()=>{let s=ks(this.contentDOM,this.contentAttrs,t),r=ks(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(T.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(ni);let e=this.state.facet(T.cspNonce);ct.mount(this.root,this.styleModules.concat(Rf).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return $n(this,e,Zr(this,e,t,i))}moveByGroup(e,t){return $n(this,e,Zr(this,e,t,i=>tf(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return ef(this,e,t,i)}moveVertically(e,t,i){return $n(this,e,nf(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ra(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[ot.find(r,e-s.from,-1,t)];return Dn(i,o.dir==J.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Ul)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Kf)return ta(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||ea(r.isolates,i=Ur(this,e.from,e.to))))return r.order;i||(i=Ur(this,e.from,e.to));let s=Hc(e.text,t,i);return this.bidiCache.push(new fn(e.from,e.to,t,i,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||M.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Ol(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return jr.of(new hn(typeof e=="number"?b.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return ue.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return ue.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ct.newName(),s=[Wi.of(i),ni.of(Rs(`.${i}`,e))];return t&&t.dark&&s.push(Ps.of(!0)),s}static baseTheme(e){return Mt.lowest(ni.of(Rs("."+Ls,e,ba)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&q.get(i)||q.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}T.styleModule=ni;T.inputHandler=Kl;T.focusChangeEffect=jl;T.perLineTextDirection=Ul;T.exceptionSink=$l;T.updateListener=Cs;T.editable=Tn;T.mouseSelectionStyle=ql;T.dragMovesSelection=zl;T.clickAddsSelectionRange=Hl;T.decorations=pi;T.atomicRanges=nr;T.bidiIsolatedRanges=Yl;T.scrollMargins=Xl;T.darkTheme=Ps;T.cspNonce=D.define({combine:n=>n.length?n[0]:""});T.contentAttributes=ir;T.editorAttributes=Jl;T.lineWrapping=T.contentAttributes.of({class:"cm-lineWrapping"});T.announce=I.define();const Kf=4096,yo={};class fn{constructor(e,t,i,s,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],s=e.length?e[e.length-1].dir:J.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&vs(o,t)}return t}const jf=M.mac?"mac":M.windows?"win":M.linux?"linux":"key";function Uf(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;ai.concat(s),[]))),t}function Jf(n,e,t){return va(xa(n.state),e,n,t)}let st=null;const Yf=4e3;function Xf(n,e=jf){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>Uf(y,e));for(let y=1;y{let w=st={view:C,prefix:v,scope:o};return setTimeout(()=>{st==w&&(st=null)},Yf),!0}]})}let m=p.join(" ");s(m,!1);let g=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&g.run.push(a),h&&(g.preventDefault=!0),c&&(g.stopPropagation=!0)};for(let o of n){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}function va(n,e,t,i){let s=wc(e),r=ie(s,0),o=Oe(r)==s.length&&s!=" ",l="",a=!1,h=!1,c=!1;st&&st.view==t&&st.scope==i&&(l=st.prefix+" ",la.indexOf(e.keyCode)<0&&(h=!0,st=null));let f=new Set,u=g=>{if(g){for(let y of g.run)if(!f.has(y)&&(f.add(y),y(t,e)))return g.stopPropagation&&(c=!0),!0;g.preventDefault&&(g.stopPropagation&&(c=!0),h=!0)}return!1},d=n[i],p,m;return d&&(u(d[l+Hi(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(M.windows&&e.ctrlKey&&e.altKey)&&(p=ft[e.keyCode])&&p!=s?(u(d[l+Hi(p,e,!0)])||e.shiftKey&&(m=ui[e.keyCode])!=s&&m!=p&&u(d[l+Hi(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Hi(s,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),a}class Mi{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=ka(e);return[new Mi(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return _f(e,t,i)}}function ka(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==J.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function xo(n,e,t){let i=b.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:De.Text}}function _f(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==J.LTR,o=n.contentDOM,l=o.getBoundingClientRect(),a=ka(n),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Ts(n,i),p=Ts(n,s),m=d.type==De.Text?d:null,g=p.type==De.Text?p:null;if(m&&(n.lineWrapping||d.widgetLineBreaks)&&(m=xo(n,i,m)),g&&(n.lineWrapping||p.widgetLineBreaks)&&(g=xo(n,s,g)),m&&g&&m.from==g.from)return v(C(t.from,t.to,m));{let x=m?C(t.from,null,m):w(d,!1),k=g?C(null,t.to,g):w(p,!0),O=[];return(m||d).to<(g||p).from-(m&&g?1:0)||d.widgetLineBreaks>1&&x.bottom+n.defaultLineHeight/2Y&&we.from=re)break;X>ee&&H(Math.max(U,ee),x==null&&U<=Y,Math.min(X,re),k==null&&X>=se,xe.dir)}if(ee=Ne.to+1,ee>=re)break}return L.length==0&&H(Y,x==null,se,k==null,n.textDirection),{top:E,bottom:P,horizontal:L}}function w(x,k){let O=l.top+(k?x.top:x.bottom);return{top:O,bottom:O,horizontal:[]}}}function Qf(n,e){return n.constructor==e.constructor&&n.eq(e)}class Zf{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(tn)!=e.state.facet(tn)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,i=e.facet(tn);for(;t!Qf(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const tn=D.define();function Sa(n){return[ue.define(e=>new Zf(e,n)),tn.of(n)]}const Ca=!M.ios,mi=D.define({combine(n){return Dt(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Yg(n={}){return[mi.of(n),eu,tu,iu,Gl.of(!0)]}function Aa(n){return n.startState.facet(mi)!=n.state.facet(mi)}const eu=Sa({above:!0,markers(n){let{state:e}=n,t=e.facet(mi),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||Ca:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:b.cursor(s.head,s.head>s.anchor?-1:1);for(let a of Mi.forRange(n,o,l))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=Aa(n);return t&&vo(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){vo(e.state,n)},class:"cm-cursorLayer"});function vo(n,e){e.style.animationDuration=n.facet(mi).cursorBlinkRate+"ms"}const tu=Sa({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Mi.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||Aa(n)},class:"cm-selectionLayer"}),Ma={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Ca&&(Ma[".cm-line"].caretColor="transparent !important");const iu=Mt.highest(T.theme(Ma)),Da=I.define({map(n,e){return n==null?null:e.mapPos(n)}}),oi=be.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Da)?i.value:t,n)}}),nu=ue.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(oi);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(oi)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(oi),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(oi)!=n&&this.view.dispatch({effects:Da.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Xg(){return[oi,nu]}function ko(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function su(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class ru{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,h,c)=>s(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new kt,i=t.add.bind(t);for(let{from:s,to:r}of su(e,this.maxLength))ko(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),h=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;lu.push(y.range(m,g));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.indexthis.addMatch(g,e,m,p));t=t.update({filterFrom:c,filterTo:f,filter:(m,g)=>mf,add:u})}}return t}}const Es=/x/.unicode!=null?"gu":"g",ou=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Es),lu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Un=null;function au(){var n;if(Un==null&&typeof document<"u"&&document.body){let e=document.body.style;Un=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Un||!1}const nn=D.define({combine(n){let e=Dt(n,{render:null,specialChars:ou,addSpecialChars:null});return(e.replaceTabs=!au())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Es)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Es)),e}});function _g(n={}){return[nn.of(n),hu()]}let So=null;function hu(){return So||(So=ue.fromClass(class{constructor(n){this.view=n,this.decorations=B.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(nn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new ru({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ie(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=Ut(o.text,l,i-o.from);return B.replace({widget:new du((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=B.replace({widget:new uu(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(nn);n.startState.facet(nn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const cu="•";function fu(n){return n>=32?cu:n==10?"␤":String.fromCharCode(9216+n)}class uu extends Ot{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=fu(this.code),i=e.state.phrase("Control character")+" "+(lu[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class du extends Ot{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class pu extends Ot{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?Ht(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=Dn(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Qg(n){return ue.fromClass(class{constructor(e){this.view=e,this.placeholder=n?B.set([B.widget({widget:new pu(n),side:1}).range(0)]):B.none}get decorations(){return this.view.state.doc.length?B.none:this.placeholder}},{decorations:e=>e.decorations})}const Is=2e3;function gu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Is||t.off>Is||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let h=n.doc.line(a);h.length<=l&&r.push(b.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let h=n.doc.line(a),c=ps(h.text,o,n.tabSize,!0);if(c<0)r.push(b.cursor(h.to));else{let f=ps(h.text,l,n.tabSize);r.push(b.range(h.from+c,h.from+f))}}}return r}function mu(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Co(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Is?-1:s==i.length?mu(n,e.clientX):Ut(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function yu(n,e){let t=Co(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=Co(n,s);if(!l)return i;let a=gu(n.state,t,l);return a.length?o?b.create(a.concat(i.ranges)):b.create(a):i}}:null}function Zg(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return T.mouseSelectionStyle.of((t,i)=>e(i)?yu(t,i):null)}const Qt="-10000px";class bu{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e,t){var i;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[h]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function wu(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Gn=D.define({combine:n=>{var e,t,i;return{position:M.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||wu}}}),Ao=new WeakMap,Oa=ue.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Gn);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new bu(n,Ta,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Gn);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Qt,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(M.gecko)i=s.offsetParent!=this.container.ownerDocument.body;else if(this.view.scaleX!=1||this.view.scaleY!=1)i=!0;else if(s.style.top==Qt&&s.style.left=="0px"){let r=s.getBoundingClientRect();i=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(e=s.width/this.parent.offsetWidth,t=s.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((s,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Gn).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:t,space:i,scaleX:s,scaleY:r}=n,o=[];for(let l=0;l=Math.min(t.bottom,i.bottom)||f.rightMath.min(t.right,i.right)+.1){c.style.top=Qt;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=u.right-u.left,g=(e=Ao.get(h))!==null&&e!==void 0?e:u.bottom-u.top,y=h.offset||vu,v=this.view.textDirection==J.LTR,C=u.width>i.right-i.left?v?i.left:i.right-u.width:v?Math.min(f.left-(d?14:0)+y.x,i.right-m):Math.max(i.left,f.left-m+(d?14:0)-y.x),w=this.above[l];!a.strictSide&&(w?f.top-(u.bottom-u.top)-y.yi.bottom)&&w==i.bottom-f.bottom>f.top-i.top&&(w=this.above[l]=!w);let x=(w?f.top-i.top:i.bottom-f.bottom)-p;if(xC&&E.topk&&(k=w?E.top-g-2-p:E.bottom+p+2);if(this.position=="absolute"?(c.style.top=(k-n.parent.top)/r+"px",c.style.left=(C-n.parent.left)/s+"px"):(c.style.top=k/r+"px",c.style.left=C/s+"px"),d){let E=f.left+(v?y.x:-y.x)-(C+14-7);d.style.left=E/s+"px"}h.overlap!==!0&&o.push({left:C,top:k,right:O,bottom:k+g}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Qt}},{eventObservers:{scroll(){this.maybeMeasure()}}}),xu=T.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),vu={x:0,y:0},Ta=D.define({enables:[Oa,xu]});function Ba(n,e){let t=n.plugin(Oa);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Mo=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function un(n,e){let t=n.plugin(Pa),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Pa=ue.fromClass(class{constructor(n){this.input=n.state.facet(dn),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Mo);this.top=new zi(n,!0,e.topContainer),this.bottom=new zi(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Mo);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new zi(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new zi(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(dn);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(n.view),l.push(c)):(c=this.panels[h],c.update&&c.update(n)),s.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>T.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class zi{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Do(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Do(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Do(n){let e=n.nextSibling;return n.remove(),e}const dn=D.define({enables:Pa});class Ct extends vt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ct.prototype.elementClass="";Ct.prototype.toDOM=void 0;Ct.prototype.mapMode=ae.TrackBefore;Ct.prototype.startSide=Ct.prototype.endSide=-1;Ct.prototype.point=!0;const ku=D.define(),Su=new class extends Ct{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},Cu=ku.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(Su.range(s)))}return $.of(e)});function em(){return Cu}const Au=1024;let Mu=0;class Te{constructor(e,t){this.from=e,this.to=t}}class R{constructor(e={}){this.id=Mu++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=me.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}R.closedBy=new R({deserialize:n=>n.split(" ")});R.openedBy=new R({deserialize:n=>n.split(" ")});R.group=new R({deserialize:n=>n.split(" ")});R.contextHash=new R({perNode:!0});R.lookAhead=new R({perNode:!0});R.mounted=new R({perNode:!0});class yi{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[R.mounted.id]}}const Du=Object.create(null);class me{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):Du,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new me(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(R.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(R.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}me.none=new me("",Object.create(null),0,8);class or{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|j.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:hr(me.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new W(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new W(me.none,t,i,s)))}static build(e){return Pu(e)}}W.empty=new W(me.none,[],[],0);class lr{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new lr(this.buffer,this.index)}}class Tt{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return me.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function bi(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from;if(La(s,i,f,f+c.length)){if(c instanceof Tt){if(r&j.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,t,i-f,s);if(u>-1)return new Ke(new Ou(o,c,e,f),null,u)}else if(r&j.IncludeAnonymous||!c.type.isAnonymous||ar(c)){let u;if(!(r&j.IgnoreMounts)&&(u=yi.get(c))&&!u.overlay)return new ge(u.tree,f,e,o);let d=new ge(c,f,e,o);return r&j.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(t<0?c.children.length-1:0,t,i,s)}}}if(r&j.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&j.IgnoreOverlays)&&(s=yi.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new ge(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function To(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function Ns(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Ou{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class Ke extends Ra{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Ke(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&j.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Ke(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Ke(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Ke(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new W(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ea(n){if(!n.length)return null;if(n.length==1)return n[0];let e=0,t=n[0];for(let r=1;rt.from||o.to=e){let l=new ge(o.tree,o.overlay[0].from+r.from,0,null);(s||(s=[i])).push(bi(l,e,t,!1))}}return s?Ea(s):i}class pn{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ge)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof ge?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&j.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&j.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&j.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&j.IncludeAnonymous||l instanceof Tt||!l.type.isAnonymous||ar(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return Ns(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function ar(n){return n.children.some(e=>e instanceof Tt||!e.type.isAnonymous||ar(e))}function Pu(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=Au,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new lr(t,t.length):t,a=i.types,h=0,c=0;function f(w,x,k,O,E){let{id:P,start:L,end:H,size:Y}=l,se=c;for(;Y<0;)if(l.next(),Y==-1){let xe=r[P];k.push(xe),O.push(L-w);return}else if(Y==-3){h=P;return}else if(Y==-4){c=P;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let we=a[P],ee,re,Ne=L-w;if(H-L<=s&&(re=m(l.pos-x,E))){let xe=new Uint16Array(re.size-re.skip),U=l.pos-re.size,X=xe.length;for(;l.pos>U;)X=g(re.start,xe,X);ee=new Tt(xe,H-re.start,i),Ne=re.start-w}else{let xe=l.pos-Y;l.next();let U=[],X=[],pt=P>=o?P:-1,Bt=0,Bi=H;for(;l.pos>xe;)pt>=0&&l.id==pt&&l.size>=0?(l.end<=Bi-s&&(d(U,X,L,Bt,l.end,Bi,pt,se),Bt=U.length,Bi=l.end),l.next()):f(L,xe,U,X,pt);if(pt>=0&&Bt>0&&Bt-1&&Bt>0){let Ar=u(we);ee=hr(we,U,X,0,U.length,0,H-L,Ar,Ar)}else ee=p(we,U,X,H-L,se-H)}k.push(ee),O.push(Ne)}function u(w){return(x,k,O)=>{let E=0,P=x.length-1,L,H;if(P>=0&&(L=x[P])instanceof W){if(!P&&L.type==w&&L.length==O)return L;(H=L.prop(R.lookAhead))&&(E=k[P]+L.length+H)}return p(w,x,k,O,E)}}function d(w,x,k,O,E,P,L,H){let Y=[],se=[];for(;w.length>O;)Y.push(w.pop()),se.push(x.pop()+k-E);w.push(p(i.types[L],Y,se,P-E,H-P)),x.push(E-k)}function p(w,x,k,O,E=0,P){if(h){let L=[R.contextHash,h];P=P?[L].concat(P):[L]}if(E>25){let L=[R.lookAhead,E];P=P?[L].concat(P):[L]}return new W(w,x,k,O,P)}function m(w,x){let k=l.fork(),O=0,E=0,P=0,L=k.end-s,H={size:0,start:0,skip:0};e:for(let Y=k.pos-w;k.pos>Y;){let se=k.size;if(k.id==x&&se>=0){H.size=O,H.start=E,H.skip=P,P+=4,O+=4,k.next();continue}let we=k.pos-se;if(se<0||we=o?4:0,re=k.start;for(k.next();k.pos>we;){if(k.size<0)if(k.size==-3)ee+=4;else break e;else k.id>=o&&(ee+=4);k.next()}E=re,O+=se,P+=ee}return(x<0||O==w)&&(H.size=O,H.start=E,H.skip=P),H.size>4?H:void 0}function g(w,x,k){let{id:O,start:E,end:P,size:L}=l;if(l.next(),L>=0&&O4){let Y=l.pos-(L-4);for(;l.pos>Y;)k=g(w,x,k)}x[--k]=H,x[--k]=P-w,x[--k]=E-w,x[--k]=O}else L==-3?h=O:L==-4&&(c=O);return k}let y=[],v=[];for(;l.pos>0;)f(n.start||0,n.bufferStart||0,y,v,-1);let C=(e=n.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new W(a[n.topID],y.reverse(),v.reverse(),C)}const Bo=new WeakMap;function sn(n,e){if(!n.isAnonymous||e instanceof Tt||e.type!=n)return 1;let t=Bo.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof W)){t=1;break}t+=sn(n,i)}Bo.set(e,t)}return t}function hr(n,e,t,i,s,r,o,l,a){let h=0;for(let p=i;p=c)break;k+=O}if(C==w+1){if(k>c){let O=p[w];d(O.children,O.positions,0,O.children.length,m[w]+v);continue}f.push(p[w])}else{let O=m[C-1]+p[C-1].length-x;f.push(hr(n,p,m,w,C,x,O,null,a))}u.push(x+v-r)}}return d(e,t,i,s,0),(l||a)(f,u,o)}class tm{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Ke?this.setBuffer(e.context.buffer,e.index,t):e instanceof ge&&this.map.set(e.tree,t)}get(e){return e instanceof Ke?this.getBuffer(e.context.buffer,e.index):e instanceof ge?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class _e{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new _e(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new _e(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&s.push(u),o.to>f)break;o=rnew Te(s.from,s.to)):[new Te(0,0)]:[new Te(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class Lu{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function im(n){return(e,t,i,s)=>new Eu(e,n,t,i,s)}class Po{constructor(e,t,i,s,r){if(this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r,!r.length||r.some(o=>o.from>=o.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class Ru{constructor(e,t,i,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}}const Fs=new R({perNode:!0});class Eu{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new W(i.type,i.children,i.positions,i.length,i.propValues.concat([[Fs,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[R.mounted.id]=new yi(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tc.frag.from<=s.from&&c.frag.to>=s.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=s.from&&u<=s.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Iu(i.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&s.fromnew Te(f.from-s.from,f.to-s.from)):null,s.tree,c)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else t&&(a=t.predicate(s))&&(a===!0&&(a=new Te(s.from,s.to)),a.fromnew Te(c.from-t.start,c.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Iu(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Lo(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],l=o.buffer;function a(h,c,f,u,d){let p=h;for(;l[p+2]+r<=e.from;)p=l[p+3];let m=[],g=[];Lo(o,h,p,m,g,u);let y=l[p+1],v=l[p+2],C=y+r==e.from&&v+r==e.to&&l[p]==e.type.id;return m.push(C?e.toTree():a(p+4,l[p+3],o.set.types[l[p]],y,v-y)),g.push(y-u),Lo(o,l[p+3],c,m,g,u),new W(f,m,g,d)}s.children[i]=a(0,l.length,me.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class Ro{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(j.IncludeAnonymous|j.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,j.IgnoreOverlays|j.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof W)t=t.children[0];else break}return!1}}class Fu{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(Fs))!==null&&t!==void 0?t:i.to,this.inner=new Ro(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Fs))!==null&&e!==void 0?e:t.to,this.inner=new Ro(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(R.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}}function Eo(n,e){let t=null,i=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new Te(l,a.to))):a.to>l?t[r--]=new Te(l,a.to):t.splice(r--,1))}}return i}function Vu(n,e,t,i){let s=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew Te(u.from+i,u.to+i)),f=Vu(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,m=p?h:f[u].from;if(m>d&&t.push(new _e(d,m,s.tree,-o,r.from>=d||r.openStart,r.to<=m||r.openEnd)),p)break;d=f[u].to}}else t.push(new _e(a,h,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let Wu=0;class ze{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=Wu++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new ze([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new gn;return t=>t.modified.indexOf(e)>-1?t:gn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Hu=0;class gn{constructor(){this.instances=[],this.id=Hu++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&zu(t,l.modified));if(i)return i;let s=[],r=new ze(s,e,t);for(let l of t)l.instances.push(r);let o=qu(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(gn.get(l,a));return r}}function zu(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function qu(n){let e=[[]];for(let t=0;ti.length-t.length)}function $u(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let f=0;;){if(l=="..."&&f>0&&f+3==s.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+s);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==s.length)break;let d=s[f++];if(f==s.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+s);l=s.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+s);let c=new mn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return Na.add(e)}const Na=new R;class mn{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Ku(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function ju(n,e,t,i=0,s=n.length){let r=new Uu(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Uu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=s,c=Gu(e)||mn.empty,f=Ku(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(R.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(g=>!g.scope||g.scope(u.tree.type)),m=e.firstChild();for(let g=0,y=l;;g++){let v=g=C||!e.nextSibling())););if(!v||C>i)break;y=v.to+l,y>t&&(this.highlightRange(d.cursor(),Math.max(t,v.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),h))}m&&e.parent()}else if(e.firstChild()){u&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function Gu(n){let e=n.type.prop(Na);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const S=ze.define,$i=S(),it=S(),No=S(it),Fo=S(it),nt=S(),Ki=S(nt),Jn=S(nt),He=S(),gt=S(He),Ve=S(),We=S(),Vs=S(),Zt=S(Vs),ji=S(),A={comment:$i,lineComment:S($i),blockComment:S($i),docComment:S($i),name:it,variableName:S(it),typeName:No,tagName:S(No),propertyName:Fo,attributeName:S(Fo),className:S(it),labelName:S(it),namespace:S(it),macroName:S(it),literal:nt,string:Ki,docString:S(Ki),character:S(Ki),attributeValue:S(Ki),number:Jn,integer:S(Jn),float:S(Jn),bool:S(nt),regexp:S(nt),escape:S(nt),color:S(nt),url:S(nt),keyword:Ve,self:S(Ve),null:S(Ve),atom:S(Ve),unit:S(Ve),modifier:S(Ve),operatorKeyword:S(Ve),controlKeyword:S(Ve),definitionKeyword:S(Ve),moduleKeyword:S(Ve),operator:We,derefOperator:S(We),arithmeticOperator:S(We),logicOperator:S(We),bitwiseOperator:S(We),compareOperator:S(We),updateOperator:S(We),definitionOperator:S(We),typeOperator:S(We),controlOperator:S(We),punctuation:Vs,separator:S(Vs),bracket:Zt,angleBracket:S(Zt),squareBracket:S(Zt),paren:S(Zt),brace:S(Zt),content:He,heading:gt,heading1:S(gt),heading2:S(gt),heading3:S(gt),heading4:S(gt),heading5:S(gt),heading6:S(gt),contentSeparator:S(He),list:S(He),quote:S(He),emphasis:S(He),strong:S(He),link:S(He),monospace:S(He),strikethrough:S(He),inserted:S(),deleted:S(),changed:S(),invalid:S(),meta:ji,documentMeta:S(ji),annotation:S(ji),processingInstruction:S(ji),definition:ze.defineModifier(),constant:ze.defineModifier(),function:ze.defineModifier(),standard:ze.defineModifier(),local:ze.defineModifier(),special:ze.defineModifier()};Fa([{tag:A.link,class:"tok-link"},{tag:A.heading,class:"tok-heading"},{tag:A.emphasis,class:"tok-emphasis"},{tag:A.strong,class:"tok-strong"},{tag:A.keyword,class:"tok-keyword"},{tag:A.atom,class:"tok-atom"},{tag:A.bool,class:"tok-bool"},{tag:A.url,class:"tok-url"},{tag:A.labelName,class:"tok-labelName"},{tag:A.inserted,class:"tok-inserted"},{tag:A.deleted,class:"tok-deleted"},{tag:A.literal,class:"tok-literal"},{tag:A.string,class:"tok-string"},{tag:A.number,class:"tok-number"},{tag:[A.regexp,A.escape,A.special(A.string)],class:"tok-string2"},{tag:A.variableName,class:"tok-variableName"},{tag:A.local(A.variableName),class:"tok-variableName tok-local"},{tag:A.definition(A.variableName),class:"tok-variableName tok-definition"},{tag:A.special(A.variableName),class:"tok-variableName2"},{tag:A.definition(A.propertyName),class:"tok-propertyName tok-definition"},{tag:A.typeName,class:"tok-typeName"},{tag:A.namespace,class:"tok-namespace"},{tag:A.className,class:"tok-className"},{tag:A.macroName,class:"tok-macroName"},{tag:A.propertyName,class:"tok-propertyName"},{tag:A.operator,class:"tok-operator"},{tag:A.comment,class:"tok-comment"},{tag:A.meta,class:"tok-meta"},{tag:A.invalid,class:"tok-invalid"},{tag:A.punctuation,class:"tok-punctuation"}]);var Yn;const wt=new R;function Va(n){return D.define({combine:n?e=>e.concat(n):void 0})}const Ju=new R;class Be{constructor(e,t,i=[],s=""){this.data=e,this.name=s,F.prototype.hasOwnProperty("tree")||Object.defineProperty(F.prototype,"tree",{get(){return ye(this)}}),this.parser=t,this.extension=[Kt.of(this),F.languageData.of((r,o,l)=>{let a=Vo(r,o,l),h=a.type.prop(wt);if(!h)return[];let c=r.facet(h),f=a.type.prop(Ju);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return Vo(e,t,i).type.prop(wt)==this.data}findRegions(e){let t=e.facet(Kt);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(wt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(R.mounted);if(l){if(l.tree.prop(wt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ws(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ye(n){let e=n.field(Be.state,!1);return e?e.tree:W.empty}class Yu{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ei=null;class qt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new qt(e,t,[],W.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Yu(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=W.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(_e.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ei;ei=this;try{return e()}finally{ei=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Wo(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=_e.applyChanges(i,a),s=W.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=Wo(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ia{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=ei;if(a){for(let h of s)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new W(me.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ei}}function Wo(n,e,t){return _e.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class $t{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new $t(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=qt.create(e.facet(Kt).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new $t(i)}}Be.state=be.define({create:$t.init,update(n,e){for(let t of e.effects)if(t.is(Be.setState))return t.value;return e.startState.facet(Kt)!=e.state.facet(Kt)?$t.init(e.state):n.apply(e)}});let Wa=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Wa=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Xn=typeof navigator<"u"&&(!((Yn=navigator.scheduling)===null||Yn===void 0)&&Yn.isInputPending)?()=>navigator.scheduling.isInputPending():null,Xu=ue.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Be.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Be.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Wa(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>Xn&&Xn()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Be.setState.of(new $t(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Je(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Kt=D.define({combine(n){return n.length?n[0]:null},enables:n=>[Be.state,Xu,T.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class sm{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Ha=D.define(),Bn=D.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function At(n){let e=n.facet(Bn);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function yn(n,e){let t="",i=n.tabSize,s=n.facet(Bn)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=e?Qu(n,t,e):null}class Pn{constructor(e,t={}){this.state=e,this.options=t,this.unit=At(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Ut(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const _u=new R;function Qu(n,e,t){let i=e.resolveStack(t),s=i.node.enterUnfinishedNodesBefore(t);if(s!=i.node){let r=[];for(let o=s;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return qa(i,n,t)}function qa(n,e,t){for(let i=n;i;i=i.next){let s=ed(i.node);if(s)return s(cr.create(e,t,i))}return 0}function Zu(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function ed(n){let e=n.type.prop(_u);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(R.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>$a(o,!0,1,void 0,r&&!Zu(o)?s.from:void 0)}return n.parent==null?td:null}function td(){return 0}class cr extends Pn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new cr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(id(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return qa(this.context.next,this.base,this.pos)}}function id(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function nd(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from$a(i,e,t,n)}function $a(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?nd(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const om=n=>n.baseIndent;function lm({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const am=new R;function hm(n){let e=n.firstChild,t=n.lastChild;return e&&e.tol.prop(wt)==o.data:o?l=>l==o:void 0,this.style=Fa(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ct(i):null,this.themeType=t.themeType}static define(e,t){return new Ln(e,t||{})}}const Hs=D.define(),Ka=D.define({combine(n){return n.length?[n[0]]:null}});function _n(n){let e=n.facet(Hs);return e.length?e:n.facet(Ka)}function cm(n,e){let t=[rd],i;return n instanceof Ln&&(n.module&&t.push(T.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Ka.of(n)):i?t.push(Hs.computeN([T.darkTheme],s=>s.facet(T.darkTheme)==(i=="dark")?[n]:[])):t.push(Hs.of(n)),t}class sd{constructor(e){this.markCache=Object.create(null),this.tree=ye(e.state),this.decorations=this.buildDeco(e,_n(e.state))}update(e){let t=ye(e.state),i=_n(e.state),s=i!=_n(e.startState);t.length{i.add(o,l,this.markCache[a]||(this.markCache[a]=B.mark({class:a})))},s,r);return i.finish()}}const rd=Mt.high(ue.fromClass(sd,{decorations:n=>n.decorations})),fm=Ln.define([{tag:A.meta,color:"#404740"},{tag:A.link,textDecoration:"underline"},{tag:A.heading,textDecoration:"underline",fontWeight:"bold"},{tag:A.emphasis,fontStyle:"italic"},{tag:A.strong,fontWeight:"bold"},{tag:A.strikethrough,textDecoration:"line-through"},{tag:A.keyword,color:"#708"},{tag:[A.atom,A.bool,A.url,A.contentSeparator,A.labelName],color:"#219"},{tag:[A.literal,A.inserted],color:"#164"},{tag:[A.string,A.deleted],color:"#a11"},{tag:[A.regexp,A.escape,A.special(A.string)],color:"#e40"},{tag:A.definition(A.variableName),color:"#00f"},{tag:A.local(A.variableName),color:"#30a"},{tag:[A.typeName,A.namespace],color:"#085"},{tag:A.className,color:"#167"},{tag:[A.special(A.variableName),A.macroName],color:"#256"},{tag:A.definition(A.propertyName),color:"#00c"},{tag:A.comment,color:"#940"},{tag:A.invalid,color:"#f00"}]),od=T.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ja=1e4,Ua="()[]{}",Ga=D.define({combine(n){return Dt(n,{afterCursor:!0,brackets:Ua,maxScanDistance:ja,renderMatch:hd})}}),ld=B.mark({class:"cm-matchingBracket"}),ad=B.mark({class:"cm-nonmatchingBracket"});function hd(n){let e=[],t=n.matched?ld:ad;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const cd=be.define({create(){return B.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Ga);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=je(e.state,s.head,-1,i)||s.head>0&&je(e.state,s.head-1,1,i)||i.afterCursor&&(je(e.state,s.head,1,i)||s.headT.decorations.from(n)}),fd=[cd,od];function um(n={}){return[Ga.of(n),fd]}const ud=new R;function zs(n,e,t){let i=n.prop(e<0?R.openedBy:R.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function qs(n){let e=n.type.prop(ud);return e?e(n.node):n}function je(n,e,t,i={}){let s=i.maxScanDistance||ja,r=i.brackets||Ua,o=ye(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=zs(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return dd(n,e,t,a,c,h,r)}}return pd(n,e,t,o,l.type,s,r)}function dd(n,e,t,i,s,r,o){let l=i.parent,a={from:s.from,to:s.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let m=t>0?0:d.length-1,g=t>0?d.length:-1;m!=g;m+=t){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=s))if(y%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function Ho(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function gd(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||md,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||ur}}function md(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const zo=new WeakMap;class Ya extends Be{constructor(e){let t=Va(e.languageData),i=gd(e),s,r=new class extends Ia{createParse(o,l,a){return new bd(s,o,l,a)}};super(t,r,[Ha.of((o,l)=>this.getIndent(o,l))],e.name),this.topNode=vd(t),s=this,this.streamParser=i,this.stateAfter=new R({perNode:!0}),this.tokenTable=e.tokenTable?new Za(i.tokenTable):xd}static define(e){return new Ya(e)}getIndent(e,t){let i=ye(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r,{overrideIndentation:o}=e.options;o&&(r=zo.get(e.state),r!=null&&r1e4)return null;for(;a=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof W&&a=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&fr(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Xa(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?At(i):4),tree:W.empty}}class bd{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=qt.get(),o=s[0].from,{state:l,tree:a}=yd(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;h=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` -`&&(t="");else{let i=t.indexOf(` -`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Ja(t,e?e.state.tabSize:4,e?At(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=_a(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return s}throw new Error("Stream parser failed to advance stream.")}const ur=Object.create(null),wi=[me.none],wd=new or(wi),qo=[],Qa=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Qa[n]=eh(ur,e);class Za{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Qa)}resolve(e){return e?this.table[e]||(this.table[e]=eh(this.extra,e)):0}}const xd=new Za(ur);function Qn(n,e){qo.indexOf(n)>-1||(qo.push(n),console.warn(e))}function eh(n,e){let t=[];for(let r of e.split(" ")){let o=[];for(let l of r.split(".")){let a=n[l]||A[l];a?typeof a=="function"?o.length?o=o.map(a):Qn(l,`Modifier ${l} used at start of tag`):o.length?Qn(l,`Tag ${l} used as modifier`):o=Array.isArray(a)?a:[a]:Qn(l,`Unknown highlighting tag ${l}`)}for(let l of o)t.push(l)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=me.define({id:wi.length,name:i,props:[$u({[i]:t})]});return wi.push(s),s.id}function vd(n){let e=me.define({id:wi.length,name:"Document",props:[wt.add(()=>n)],top:!0});return wi.push(e),e}const kd=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=pr(n.state,t.from);return i.line?Sd(n):i.block?Ad(n):!1};function dr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const Sd=dr(Od,0),Cd=dr(th,0),Ad=dr((n,e)=>th(n,e,Dd(e)),0);function pr(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const ti=50;function Md(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-ti,i),o=n.sliceDoc(s,s+ti),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let c,f;s-i<=2*ti?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+ti),f=n.sliceDoc(s-ti,s));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:s-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Dd(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function th(n,e,t=e.selection.ranges){let i=t.map(r=>pr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Md(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>f.from)){s=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const $s=tt.define(),Td=tt.define(),Bd=D.define(),ih=D.define({combine(n){return Dt(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function Pd(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const nh=be.define({create(){return Ue.empty},update(n,e){let t=e.state.facet(ih),i=e.annotation($s);if(i){let a=e.docChanged?b.single(Pd(e.changes)):void 0,h=ke.fromTransaction(e,a),c=i.side,f=c==0?n.undone:n.done;return h?f=bn(f,f.length,t.minDepth,h):f=oh(f,e.startState.selection),new Ue(c==0?i.rest:f,c==0?f:i.rest)}let s=e.annotation(Td);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(Z.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=ke.fromTransaction(e),o=e.annotation(Z.time),l=e.annotation(Z.userEvent);return r?n=n.addChanges(r,o,l,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ue(n.done.map(ke.fromJSON),n.undone.map(ke.fromJSON))}});function dm(n={}){return[nh,ih.of(n),T.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?sh:e.inputType=="historyRedo"?Ks:null;return i?(e.preventDefault(),i(t)):!1}})]}function Rn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(nh,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const sh=Rn(0,!1),Ks=Rn(1,!1),Ld=Rn(0,!0),Rd=Rn(1,!0);class ke{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new ke(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new ke(e.changes&&Q.fromJSON(e.changes),[],e.mapped&&Ge.fromJSON(e.mapped),e.startSelection&&b.fromJSON(e.startSelection),e.selectionsAfter.map(b.fromJSON))}static fromTransaction(e,t){let i=Pe;for(let s of e.startState.facet(Bd)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new ke(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Pe)}static selection(e){return new ke(void 0,Pe,void 0,void 0,e)}}function bn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function Ed(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Id(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function rh(n,e){return n.length?e.length?n.concat(e):n:e}const Pe=[],Nd=200;function oh(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Nd));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),bn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[ke.selection([e])]}function Fd(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Zn(n,e){if(!n.length)return n;let t=n.length,i=Pe;for(;t;){let s=Vd(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[ke.selection(i)]:Pe}function Vd(n,e,t){let i=rh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):Pe,t);if(!n.changes)return ke.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new ke(s,I.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const Wd=/^(input\.type|delete)($|\.)/;class Ue{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ue(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Wd.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):En(t,e))}function de(n){return n.textDirectionAt(n.state.selection.main.head)==J.LTR}const ah=n=>lh(n,!de(n)),hh=n=>lh(n,de(n));function ch(n,e){return Ie(n,t=>t.empty?n.moveByGroup(t,e):En(t,e))}const Hd=n=>ch(n,!de(n)),zd=n=>ch(n,de(n));function qd(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function In(n,e,t){let i=ye(n).resolveInner(e.head),s=t?R.closedBy:R.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;qd(n,h,s)?i=h:a=t?h.to:h.from}let r=i.type.prop(s),o,l;return r&&(o=t?je(n,i.from,1):je(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,b.cursor(l,t?-1:1)}const $d=n=>Ie(n,e=>In(n.state,e,!de(n))),Kd=n=>Ie(n,e=>In(n.state,e,de(n)));function fh(n,e){return Ie(n,t=>{if(!t.empty)return En(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const uh=n=>fh(n,!1),dh=n=>fh(n,!0);function ph(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):En(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),l=n.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomgh(n,!1),js=n=>gh(n,!0);function dt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=b.cursor(i.from+r))}return s}const jd=n=>Ie(n,e=>dt(n,e,!0)),Ud=n=>Ie(n,e=>dt(n,e,!1)),Gd=n=>Ie(n,e=>dt(n,e,!de(n))),Jd=n=>Ie(n,e=>dt(n,e,de(n))),Yd=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).from,1)),Xd=n=>Ie(n,e=>b.cursor(n.lineBlockAt(e.head).to,-1));function _d(n,e,t){let i=!1,s=Gt(n.selection,r=>{let o=je(n,r.head,-1)||je(n,r.head,1)||r.head>0&&je(n,r.head-1,1)||r.head_d(n,e,!1);function Re(n,e){let t=Gt(n.state.selection,i=>{let s=e(i);return b.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Xe(n.state,t)),!0)}function mh(n,e){return Re(n,t=>n.moveByChar(t,e))}const yh=n=>mh(n,!de(n)),bh=n=>mh(n,de(n));function wh(n,e){return Re(n,t=>n.moveByGroup(t,e))}const Zd=n=>wh(n,!de(n)),ep=n=>wh(n,de(n)),tp=n=>Re(n,e=>In(n.state,e,!de(n))),ip=n=>Re(n,e=>In(n.state,e,de(n)));function xh(n,e){return Re(n,t=>n.moveVertically(t,e))}const vh=n=>xh(n,!1),kh=n=>xh(n,!0);function Sh(n,e){return Re(n,t=>n.moveVertically(t,e,ph(n).height))}const Ko=n=>Sh(n,!1),jo=n=>Sh(n,!0),np=n=>Re(n,e=>dt(n,e,!0)),sp=n=>Re(n,e=>dt(n,e,!1)),rp=n=>Re(n,e=>dt(n,e,!de(n))),op=n=>Re(n,e=>dt(n,e,de(n))),lp=n=>Re(n,e=>b.cursor(n.lineBlockAt(e.head).from)),ap=n=>Re(n,e=>b.cursor(n.lineBlockAt(e.head).to)),Uo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:0})),!0),Go=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.doc.length})),!0),Jo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:0})),!0),Yo=({state:n,dispatch:e})=>(e(Xe(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),hp=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),cp=({state:n,dispatch:e})=>{let t=Nn(n).map(({from:i,to:s})=>b.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:b.create(t),userEvent:"select"})),!0},fp=({state:n,dispatch:e})=>{let t=Gt(n.selection,i=>{var s;let r=ye(n).resolveStack(i.from,1);for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&(!((s=l.parent)===null||s===void 0)&&s.parent))return b.range(l.to,l.from)}return i});return e(Xe(n,t)),!0},up=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=b.create([t.main]):t.main.empty||(i=b.create([b.cursor(t.main.head)])),i?(e(Xe(n,i)),!0):!1};function Di(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=Ui(n,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Ui(n,o,!1),l=Ui(n,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:b.cursor(o,os(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const Ch=(n,e)=>Di(n,t=>{let i=t.from,{state:s}=n,r=s.doc.lineAt(i),o,l;if(!e&&i>r.from&&iCh(n,!1),Ah=n=>Ch(n,!0),Mh=(n,e)=>Di(n,t=>{let i=t.head,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=fe(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),Dh=n=>Mh(n,!1),dp=n=>Mh(n,!0),pp=n=>Di(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headDi(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),mp=n=>Di(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:N.of(["",""])},range:b.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},bp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:fe(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:fe(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:b.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Nn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Oh(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Nn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(b.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(b.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:b.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const wp=({state:n,dispatch:e})=>Oh(n,e,!1),xp=({state:n,dispatch:e})=>Oh(n,e,!0);function Th(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Nn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const vp=({state:n,dispatch:e})=>Th(n,e,!1),kp=({state:n,dispatch:e})=>Th(n,e,!0),Sp=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Nn(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Cp(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ye(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(R.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from&&!/\S/.test(n.sliceDoc(i.to,s.from))?{from:i.to,to:s.from}:null}const Ap=Bh(!1),Mp=Bh(!0);function Bh(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Cp(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Pn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=za(h,r);for(c==null&&(c=Ut(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:b.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Dp=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Pn(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=gr(n,(r,o,l)=>{let a=za(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=yn(n,a);(h!=c||l.fromn.readOnly?!1:(e(n.update(gr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Bn)})}),{userEvent:"input.indent"})),!0),Tp=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(gr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=Ut(s,n.tabSize),o=0,l=yn(n,Math.max(0,r-At(n)));for(;o({mac:n.key,run:n.run,shift:n.shift}))),gm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$d,shift:tp},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Kd,shift:ip},{key:"Alt-ArrowUp",run:wp},{key:"Shift-Alt-ArrowUp",run:vp},{key:"Alt-ArrowDown",run:xp},{key:"Shift-Alt-ArrowDown",run:kp},{key:"Escape",run:up},{key:"Mod-Enter",run:Mp},{key:"Alt-l",mac:"Ctrl-l",run:cp},{key:"Mod-i",run:fp,preventDefault:!0},{key:"Mod-[",run:Tp},{key:"Mod-]",run:Op},{key:"Mod-Alt-\\",run:Dp},{key:"Shift-Mod-k",run:Sp},{key:"Shift-Mod-\\",run:Qd},{key:"Mod-/",run:kd},{key:"Alt-A",run:Cd}].concat(Pp);function oe(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class jt{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?l=>r(Xo(l)):Xo,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ie(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Xs(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Oe(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(r==s.length-1){if(a)return this.value=a,this;break}o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=wn(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let l=new Vt(t,e.sliceString(t,i));return es.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=wn(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Vt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Rh.prototype[Symbol.iterator]=Eh.prototype[Symbol.iterator]=function(){return this});function Lp(n){try{return new RegExp(n,mr),!0}catch{return!1}}function wn(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Gs(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=oe("input",{class:"cm-textfield",name:"line",value:e}),i=oe("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),n.dispatch({effects:xn.of(!1)}),n.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},oe("label",n.state.phrase("Go to line"),": ",t)," ",oe("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=n,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=r,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),m=b.cursor(p.from+Math.max(0,Math.min(u,p.length)));n.dispatch({effects:[xn.of(!1),T.scrollIntoView(m.from,{y:"center"})],selection:m}),n.focus()}return{dom:i}}const xn=I.define(),_o=be.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(xn)&&(n=t.value);return n},provide:n=>dn.from(n,e=>e?Gs:null)}),Rp=n=>{let e=un(n,Gs);if(!e){let t=[xn.of(!0)];n.state.field(_o,!1)==null&&t.push(I.appendConfig.of([_o,Ep])),n.dispatch({effects:t}),e=un(n,Gs)}return e&&e.dom.querySelector("input").select(),!0},Ep=T.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),Ip={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ih=D.define({combine(n){return Dt(n,Ip,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function mm(n){let e=[Hp,Wp];return n&&e.push(Ih.of(n)),e}const Np=B.mark({class:"cm-selectionMatch"}),Fp=B.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Qo(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=K.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=K.Word)}function Vp(n,e,t,i){return n(e.sliceDoc(t,t+1))==K.Word&&n(e.sliceDoc(i-1,i))==K.Word}const Wp=ue.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Ih),{state:t}=n,i=t.selection;if(i.ranges.length>1)return B.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return B.none;let a=t.wordAt(s.head);if(!a)return B.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return B.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Qo(o,t,s.from,s.to)&&Vp(o,t,s.from,s.to)))return B.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return B.none}let l=[];for(let a of n.visibleRanges){let h=new jt(t.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Qo(o,t,c,f))&&(s.empty&&c<=s.from&&f>=s.to?l.push(Fp.range(c,f)):(c>=s.to||f<=s.from)&&l.push(Np.range(c,f)),l.length>e.maxMatches))return B.none}}return B.set(l)}},{decorations:n=>n.decorations}),Hp=T.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zp=({state:n,dispatch:e})=>{let{selection:t}=n,i=b.create(t.ranges.map(s=>n.wordAt(s.head)||b.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function qp(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new jt(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new jt(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const $p=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return zp({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=qp(n,i);return s?(e(n.update({selection:n.selection.addRange(b.range(s.from,s.to),!1),effects:T.scrollIntoView(s.to)})),!0):!1},Jt=D.define({combine(n){return Dt(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new eg(e),scrollToMatch:e=>T.scrollIntoView(e)})}});class Nh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Lp(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Gp(this):new jp(this)}getCursor(e,t=0,i){let s=e.doc?e:F.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Rt(this,s,t,i):Lt(this,s,t,i)}}class Fh{constructor(e){this.spec=e}}function Lt(n,e,t,i){return new jt(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Kp(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Kp(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Lt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Rt(n,e,t,i){return new Rh(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Up(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function vn(n,e){return n.slice(fe(n,e,!1),e)}function kn(n,e){return n.slice(e,fe(n,e))}function Up(n){return(e,t,i)=>!i[0].length||(n(vn(i.input,i.index))!=K.Word||n(kn(i.input,i.index))!=K.Word)&&(n(kn(i.input,i.index+i[0].length))!=K.Word||n(vn(i.input,i.index+i[0].length))!=K.Word)}class Gp extends Fh{nextMatch(e,t,i){let s=Rt(this.spec,e,i,e.doc.length).next();return s.done&&(s=Rt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Rt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Rt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const xi=I.define(),yr=I.define(),at=be.define({create(n){return new ts(Js(n).create(),null)},update(n,e){for(let t of e.effects)t.is(xi)?n=new ts(t.value.create(),n.panel):t.is(yr)&&(n=new ts(n.query,t.value?br:null));return n},provide:n=>dn.from(n,e=>e.panel)});class ts{constructor(e,t){this.query=e,this.panel=t}}const Jp=B.mark({class:"cm-searchMatch"}),Yp=B.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Xp=ue.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(at))}update(n){let e=n.state.field(at);(e!=n.startState.field(at)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return B.none;let{view:t}=this,i=new kt;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Yp:Jp)})}return i.finish()}},{decorations:n=>n.decorations});function Oi(n){return e=>{let t=e.state.field(at,!1);return t&&t.query.spec.valid?n(e,t):Hh(e)}}const Sn=Oi((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=b.single(i.from,i.to),r=n.state.facet(Jt);return n.dispatch({selection:s,effects:[wr(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),Wh(n),!0}),Cn=Oi((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=b.single(s.from,s.to),o=n.state.facet(Jt);return n.dispatch({selection:r,effects:[wr(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),Wh(n),!0}),_p=Oi((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:b.create(t.map(i=>b.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Qp=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new jt(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(b.range(l.value.from,l.value.to))}return e(n.update({selection:b.create(r,o),userEvent:"select.search.matches"})),!0},Zo=Oi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t,r.from,r.to),h.push(T.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=b.single(r.from-c,r.to-c),h.push(wr(n,r)),h.push(t.facet(Jt).scrollToMatch(l.main,n))}return n.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),Zp=Oi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:T.announce.of(i),userEvent:"input.replace.all"}),!0});function br(n){return n.state.facet(Jt).createPanel(n)}function Js(n,e){var t,i,s,r,o;let l=n.selection.main,a=l.empty||l.to>l.from+100?"":n.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=n.facet(Jt);return new Nh({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Vh(n){let e=un(n,br);return e&&e.dom.querySelector("[main-field]")}function Wh(n){let e=Vh(n);e&&e==n.root.activeElement&&e.select()}const Hh=n=>{let e=n.state.field(at,!1);if(e&&e.panel){let t=Vh(n);if(t&&t!=n.root.activeElement){let i=Js(n.state,e.query.spec);i.valid&&n.dispatch({effects:xi.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[yr.of(!0),e?xi.of(Js(n.state,e.query.spec)):I.appendConfig.of(ig)]});return!0},zh=n=>{let e=n.state.field(at,!1);if(!e||!e.panel)return!1;let t=un(n,br);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:yr.of(!1)}),!0},ym=[{key:"Mod-f",run:Hh,scope:"editor search-panel"},{key:"F3",run:Sn,shift:Cn,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Sn,shift:Cn,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:zh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Qp},{key:"Alt-g",run:Rp},{key:"Mod-d",run:$p,preventDefault:!0}];class eg{constructor(e){this.view=e;let t=this.query=e.state.field(at).query.spec;this.commit=this.commit.bind(this),this.searchField=oe("input",{value:t.search,placeholder:Se(e,"Find"),"aria-label":Se(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=oe("input",{value:t.replace,placeholder:Se(e,"Replace"),"aria-label":Se(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=oe("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=oe("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=oe("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return oe("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=oe("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>Sn(e),[Se(e,"next")]),i("prev",()=>Cn(e),[Se(e,"previous")]),i("select",()=>_p(e),[Se(e,"all")]),oe("label",null,[this.caseField,Se(e,"match case")]),oe("label",null,[this.reField,Se(e,"regexp")]),oe("label",null,[this.wordField,Se(e,"by word")]),...e.state.readOnly?[]:[oe("br"),this.replaceField,i("replace",()=>Zo(e),[Se(e,"replace")]),i("replaceAll",()=>Zp(e),[Se(e,"replace all")])],oe("button",{name:"close",onclick:()=>zh(e),"aria-label":Se(e,"close"),type:"button"},["×"])])}commit(){let e=new Nh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:xi.of(e)}))}keydown(e){Jf(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Cn:Sn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Zo(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(xi)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Jt).top}}function Se(n,e){return n.state.phrase(e)}const Gi=30,Ji=/[\s\.,:;?!]/;function wr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Gi),o=Math.min(s,t+Gi),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-Gi;a--)if(!Ji.test(l[a-1])&&Ji.test(l[a])){l=l.slice(0,a);break}}return T.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const tg=T.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ig=[at,Mt.low(Xp),tg];class qh{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ye(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search($h(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function el(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function ng(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:ng(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function bm(n,e){return t=>{for(let i=ye(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class tl{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function ht(n){return n.selection.main.from}function $h(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Kh=tt.define();function rg(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(l=>l!=s&&t!=i&&n.sliceDoc(l.from+r,l.from+o)!=n.sliceDoc(t,i)?{range:l}:{changes:{from:l.from+r,to:i==s.from?l.to:l.from+o,insert:e},range:b.cursor(l.from+r+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const il=new WeakMap;function og(n){if(!Array.isArray(n))return n;let e=il.get(n);return e||il.set(n,e=sg(n)),e}const xr=I.define(),vi=I.define();class lg{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&x<=57||x>=97&&x<=122?2:x>=65&&x<=90?1:0:(k=Xs(x))!=k.toLowerCase()?1:k!=k.toUpperCase()?2:0;(!v||O==1&&g||w==0&&O!=0)&&(t[f]==x||i[f]==x&&(u=!0)?o[f++]=v:o.length&&(y=!1)),w=O,v+=Oe(x)}return f==a&&o[0]==0&&y?this.result(-100+(u?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,m]):f==a?this.result(-100+(u?-200:0)+-700+(y?0:-1100),o,e):t.length==2?!1:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[],r=0;for(let o of t){let l=o+(this.astral?Oe(ie(i,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-i.length,s)}}const ce=D.define({combine(n){return Dt(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:ag,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>nl(e(i),t(i)),optionClass:(e,t)=>i=>nl(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function nl(n,e){return n?e?n+" "+e:n:e}function ag(n,e,t,i,s,r){let o=n.textDirection==J.RTL,l=o,a=!1,h="top",c,f,u=e.left-s.left,d=s.right-e.right,p=i.right-i.left,m=i.bottom-i.top;if(l&&u=m||v>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,y=(e.right-e.left)/r.offsetWidth;return{style:`${h}: ${c/g}px; max-width: ${f/y}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function hg(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let o=t.displayLabel||t.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(o.slice(l,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,c))),f.className="cm-completionMatchedText",l=c}return lt.position-i.position).map(t=>t.render)}function is(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class cg{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(ce);this.optionContent=hg(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=is(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=e.state.field(t).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(ce).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:vi.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=s){let{options:r,selected:o,disabled:l}=i.open;(!s.open||s.open.options!=r)&&(this.range=is(r.length,o,e.state.facet(ce).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=is(t.options.length,t.selected,this.view.state.facet(ce).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,i)}).catch(o=>Je(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;i.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&ug(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=u,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let d=s.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=s.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,a);d&&c.appendChild(d)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew cg(t,n,e)}function ug(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),s=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/s)}function sl(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function dg(n,e){let t=[],i=null,s=a=>{t.push(a);let{section:h}=a.completion;if(h){i||(i=[]);let c=typeof h=="string"?h:h.name;i.some(f=>f.name==c)||i.push(typeof h=="string"?{name:c}:h)}};for(let a of n)if(a.hasResult()){let h=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)s(new tl(c,a.source,h?h(c):[],1e9-t.length));else{let c=new lg(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let u=f.displayLabel?h?h(f,c.matched):[]:c.matched;s(new tl(f,a.source,u,c.score+(f.boost||0)))}}}if(i){let a=Object.create(null),h=0,c=(f,u)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=u.rank)!==null&&p!==void 0?p:1e9)||(f.namec.score-h.score||l(h.completion,c.completion))){let h=a.completion;!o||o.label!=h.label||o.detail!=h.detail||o.type!=null&&h.type!=null&&o.type!=h.type||o.apply!=h.apply||o.boost!=h.boost?r.push(a):sl(a.completion)>sl(o)&&(r[r.length-1]=a),o=a.completion}return r}class Et{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Et(this.options,rl(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=dg(e,t);if(!o.length)return s&&e.some(a=>a.state==1)?new Et(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let l=t.facet(ce).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(a,h.from):a,1e8),create:bg,above:r.aboveCursor},s?s.timestamp:Date.now(),l,!1)}map(e){return new Et(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class An{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new An(mg,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(ce),r=(i.override||t.languageDataAt("autocomplete",ht(t)).map(og)).map(l=>(this.active.find(h=>h.source==l)||new ve(l,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!pg(r,this.active)?o=Et.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new ve(l.source,0):l));for(let l of e.effects)l.is(Uh)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new An(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:gg}}function pg(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const mg=[];function Ys(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class ve{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Ys(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new ve(s.source,0));for(let r of e.effects)if(r.is(xr))s=new ve(s.source,1,r.value?ht(e.state):-1);else if(r.is(vi))s=new ve(s.source,0);else if(r.is(jh))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new ve(this.source,1)}handleChange(e){return e.changes.touchesRange(ht(e.startState))?new ve(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ve(this.source,this.state,e.mapPos(this.explicitPos))}}class Wt extends ve{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ht(e.state);if((this.explicitPos<0?l<=r:lo||t=="delete"&&ht(e.startState)==this.from)return new ve(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return yg(this.result.validFor,e.state,r,o)?new Wt(this.source,a,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new qh(e.state,l,a>=0)))?new Wt(this.source,a,h,h.from,(s=h.to)!==null&&s!==void 0?s:ht(e.state)):new ve(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ve(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Wt(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function yg(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):$h(n,!0).test(s)}const jh=I.define({map(n,e){return n.map(t=>t.map(e))}}),Uh=I.define(),Ae=be.define({create(){return An.start()},update(n,e){return n.update(e)},provide:n=>[Ta.from(n,e=>e.tooltip),T.contentAttributes.from(n,e=>e.attrs)]});function Gh(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Ae).active.find(s=>s.source==e.source);return i instanceof Wt?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},rg(n.state,t,i.from,i.to)),{annotations:Kh.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const bg=fg(Ae,Gh);function Yi(n,e="option"){return t=>{let i=t.state.field(Ae,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Uh.of(l)}),!0}}const wg=n=>{let e=n.state.field(Ae,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(Ae,!1)?(n.dispatch({effects:xr.of(!0)}),!0):!1,vg=n=>{let e=n.state.field(Ae,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:vi.of(null)}),!0)};class kg{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Sg=50,Cg=1e3,Ag=ue.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Ae).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ae);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ae)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Ys(i));for(let i=0;iSg&&Date.now()-s.time>Cg){for(let r of s.context.abortListeners)try{r()}catch(o){Je(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),50):-1,this.composing!=0)for(let i of n.transactions)Ys(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Ae);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=ht(e),i=new qh(e,t,n.explicitPos==t),s=new kg(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:vi.of(null)}),Je(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ce).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(ce);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new ve(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:jh.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Ae,!1);if(e&&e.tooltip&&this.view.state.facet(ce).closeOnBlur){let t=e.open&&Ba(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:vi.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:xr.of(!1)}),20),this.composing=0}}}),Jh=T.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class Mg{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class vr{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ae.TrackDel),i=e.mapPos(this.to,1,ae.TrackDel);return t==null||i==null?null:new vr(this.field,t,i)}}class kr{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;fnew vr(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:i,ranges:l}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c=h&&f.field++}s.push(new Mg(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of s)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new kr(i,s)}}let Dg=B.widget({widget:new class extends Ot{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),Og=B.mark({class:"cm-snippetField"});class Yt{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(i=>(i.from==i.to?Dg:Og).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new Yt(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const Ti=I.define({map(n,e){return n&&n.map(e)}}),Tg=I.define(),ki=be.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(Ti))return t.value;if(t.is(Tg)&&n)return new Yt(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>T.decorations.from(n,e=>e?e.deco:B.none)});function Sr(n,e){return b.create(n.filter(t=>t.field==e).map(t=>b.range(t.from,t.to)))}function Bg(n){let e=kr.parse(n);return(t,i,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),a={changes:{from:s,to:r,insert:N.of(o)},scrollIntoView:!0,annotations:i?Kh.of(i):void 0};if(l.length&&(a.selection=Sr(l,0)),l.length>1){let h=new Yt(l,0),c=a.effects=[Ti.of(h)];t.state.field(ki,!1)===void 0&&c.push(I.appendConfig.of([ki,Ig,Ng,Jh]))}t.dispatch(t.state.update(a))}}function Yh(n){return({state:e,dispatch:t})=>{let i=e.field(ki,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:Sr(i.ranges,s),effects:Ti.of(r?null:new Yt(i.ranges,s)),scrollIntoView:!0})),!0}}const Pg=({state:n,dispatch:e})=>n.field(ki,!1)?(e(n.update({effects:Ti.of(null)})),!0):!1,Lg=Yh(1),Rg=Yh(-1),Eg=[{key:"Tab",run:Lg,shift:Rg},{key:"Escape",run:Pg}],ol=D.define({combine(n){return n.length?n[0]:Eg}}),Ig=Mt.highest(rr.compute([ol],n=>n.facet(ol)));function wm(n,e){return Object.assign(Object.assign({},e),{apply:Bg(n)})}const Ng=T.domEventHandlers({mousedown(n,e){let t=e.state.field(ki,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:Sr(t.ranges,s.field),effects:Ti.of(t.ranges.some(r=>r.field>s.field)?new Yt(t.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Si={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},xt=I.define({map(n,e){let t=e.mapPos(n,-1,ae.TrackAfter);return t??void 0}}),Cr=new class extends vt{};Cr.startSide=1;Cr.endSide=-1;const Xh=be.define({create(){return $.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=$.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(xt)&&(n=n.update({add:[Cr.range(t.value,t.value+1)]}));return n}});function xm(){return[Vg,Xh]}const ns="()[]{}<>";function _h(n){for(let e=0;e{if((Fg?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Oe(ie(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Hg(n.state,i);return r?(n.dispatch(r),!0):!1}),Wg=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=Qh(n,n.selection.main.head).brackets||Si.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=zg(n.doc,o.head);for(let a of i)if(a==l&&Fn(n.doc,o.head)==_h(ie(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:b.cursor(o.head-a.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},vm=[{key:"Backspace",run:Wg}];function Hg(n,e){let t=Qh(n,n.selection.main.head),i=t.brackets||Si.brackets;for(let s of i){let r=_h(ie(s,0));if(e==s)return r==s?Kg(n,s,i.indexOf(s+s+s)>-1,t):qg(n,s,r,t.before||Si.before);if(e==r&&Zh(n,n.selection.main.from))return $g(n,s,r)}return null}function Zh(n,e){let t=!1;return n.field(Xh).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Fn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Oe(ie(t,0)))}function zg(n,e){let t=n.sliceString(e-2,e);return Oe(ie(t,0))==t.length?t:t.slice(1)}function qg(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:xt.of(o.to+e.length),range:b.range(o.anchor+e.length,o.head+e.length)};let l=Fn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:xt.of(o.head+e.length),range:b.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function $g(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&Fn(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:b.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Kg(n,e,t,i){let s=i.stringPrefixes||Si.stringPrefixes,r=null,o=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:xt.of(l.to+e.length),range:b.range(l.anchor+e.length,l.head+e.length)};let a=l.head,h=Fn(n.doc,a),c;if(h==e){if(ll(n,a))return{changes:{insert:e+e,from:a},effects:xt.of(a+e.length),range:b.cursor(a+e.length)};if(Zh(n,a)){let u=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+u.length,insert:u},range:b.cursor(a+u.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(c=al(n,a-2*e.length,s))>-1&&ll(n,c))return{changes:{insert:e+e+e+e,from:a},effects:xt.of(a+e.length),range:b.cursor(a+e.length)};if(n.charCategorizer(a)(h)!=K.Word&&al(n,a,s)>-1&&!jg(n,a,e,s))return{changes:{insert:e+e,from:a},effects:xt.of(a+e.length),range:b.cursor(a+e.length)}}return{range:r=l}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function ll(n,e){let t=ye(n).resolveInner(e+1);return t.parent&&t.from==e}function jg(n,e,t,i){let s=ye(n).resolveInner(e,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=s.firstChild;for(;c&&c.from==s.from&&c.to-c.from>t.length+a;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function al(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=K.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=K.Word)return r}return-1}function km(n={}){return[Ae,ce.of(n),Ag,Gg,Jh]}const Ug=[{key:"Ctrl-Space",run:xg},{key:"Escape",run:vg},{key:"ArrowDown",run:Yi(!0)},{key:"ArrowUp",run:Yi(!1)},{key:"PageDown",run:Yi(!0,"page")},{key:"PageUp",run:Yi(!1,"page")},{key:"Enter",run:wg}],Gg=Mt.highest(rr.computeN([ce],n=>n.facet(ce).defaultKeymap?[Ug]:[]));export{lm as A,am as B,Mn as C,Au as D,T as E,hm as F,sm as G,ye as H,j as I,tm as J,bm as K,Ws as L,sg as M,or as N,b as O,Ia as P,wm as Q,om as R,Ya as S,W as T,rm as U,Ju as V,Va as W,ud as X,F as a,_g as b,dm as c,Yg as d,Xg as e,um as f,xm as g,em as h,mm as i,vm as j,rr as k,gm as l,ym as m,pm as n,Ug as o,km as p,Qg as q,Zg as r,cm as s,fm as t,me as u,R as v,$u as w,A as x,im as y,_u as z}; diff --git a/ui/dist/assets/index-6c8f1731.js b/ui/dist/assets/index-6c8f1731.js new file mode 100644 index 00000000..26485edb --- /dev/null +++ b/ui/dist/assets/index-6c8f1731.js @@ -0,0 +1,161 @@ +var p0=Object.defineProperty;var m0=(n,e,t)=>e in n?p0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ue=(n,e,t)=>(m0(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const ws=n=>n;function Pe(n,e){for(const t in e)n[t]=e[t];return n}function h0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function E_(n){return n()}function iu(){return Object.create(null)}function we(n){n.forEach(E_)}function $t(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ps;function nn(n,e){return n===e?!0:(Ps||(Ps=document.createElement("a")),Ps.href=e,n===Ps.href)}function g0(n){return Object.keys(n).length===0}function ma(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function _0(n){let e;return ma(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ma(e,t))}function vt(n,e,t,i){if(n){const l=A_(n,e,t,i);return n[0](l)}}function A_(n,e,t,i){return n[1]&&i?Pe(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),ha=I_?n=>requestAnimationFrame(n):Q;const yl=new Set;function L_(n){yl.forEach(e=>{e.c(n)||(yl.delete(e),e.f())}),yl.size!==0&&ha(L_)}function Vo(n){let e;return yl.size===0&&ha(L_),{promise:new Promise(t=>{yl.add(e={c:n,f:t})}),abort(){yl.delete(e)}}}function y(n,e){n.appendChild(e)}function P_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function b0(n){const e=b("style");return e.textContent="/* empty */",y0(P_(n),e),e.sheet}function y0(n,e){return y(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function at(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Ye(n){return function(e){return e.preventDefault(),n.call(this,e)}}function fn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const k0=["width","height"];function ni(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&k0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function v0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function ut(n){return n===""?null:+n}function w0(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function ce(n,e){n.value=e??""}function S0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function x(n,e,t){n.classList.toggle(e,!!t)}function F_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Dt(n,e){return new n(e)}const ko=new Map;let vo=0;function T0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function $0(n,e){const t={stylesheet:b0(e),rules:{}};return ko.set(n,t),t}function us(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{ +`;for(let _=0;_<=1;_+=a){const k=e+(t-e)*s(_);u+=_*100+`%{${o(k,1-k)}} +`}const f=u+`100% {${o(t,1-t)}} +}`,c=`__svelte_${T0(f)}_${r}`,d=P_(n),{stylesheet:m,rules:g}=ko.get(d)||$0(d,n);g[c]||(g[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${l}ms 1 both`,vo+=1,c}function fs(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),vo-=l,vo||C0())}function C0(){ha(()=>{vo||(ko.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),ko.clear())})}function M0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=ws,start:a=zo()+s,end:u=a+o,tick:f=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,g;function h(){c&&(g=us(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&fs(n,g),d=!1}return Vo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),h(),f(0,1),_}function O0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,N_(n,l)}}function N_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let cs;function di(n){cs=n}function Ss(){if(!cs)throw new Error("Function called outside component initialization");return cs}function Vt(n){Ss().$$.on_mount.push(n)}function D0(n){Ss().$$.after_update.push(n)}function Ts(n){Ss().$$.on_destroy.push(n)}function rt(){const n=Ss();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=F_(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ee(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bl=[],te=[];let kl=[];const Vr=[],R_=Promise.resolve();let Br=!1;function q_(){Br||(Br=!0,R_.then(ga))}function Qt(){return q_(),R_}function Ke(n){kl.push(n)}function ye(n){Vr.push(n)}const sr=new Set;let pl=0;function ga(){if(pl!==0)return;const n=cs;do{try{for(;pln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),kl=e}let jl;function _a(){return jl||(jl=Promise.resolve(),jl.then(()=>{jl=null})),jl}function Xi(n,e,t){n.dispatchEvent(F_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let ei;function re(){ei={r:0,c:[],p:ei}}function ae(){ei.r||we(ei.c),ei=ei.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),ei.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function j_(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&fs(n,o)}function f(){const{delay:d=0,duration:m=300,easing:g=ws,tick:h=Q,css:_}=l||ba;_&&(o=us(n,0,1,m,d,g,_,a++)),h(0,1);const k=zo()+d,S=k+m;r&&r.abort(),s=!0,Ke(()=>Xi(n,!0,"start")),r=Vo($=>{if(s){if($>=S)return h(1,0),Xi(n,!0,"end"),u(),s=!1;if($>=k){const T=g(($-k)/m);h(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,fs(n),$t(l)?(l=l(i),_a().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function ya(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=ei;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=ws,tick:m=Q,css:g}=l||ba;g&&(o=us(n,1,0,c,f,d,g));const h=zo()+f,_=h+c;Ke(()=>Xi(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Vo(k=>{if(s){if(k>=_)return m(0,1),Xi(n,!1,"end"),--r.r||we(r.c),!1;if(k>=h){const S=d((k-h)/c);m(1-S,S)}}return s})}return $t(l)?_a().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&fs(n,o),s=!1)}}}function Le(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&fs(n,u)}function d(g,h){const _=g.b-o;return h*=Math.abs(_),{a:o,b:g.b,d:_,duration:h,start:g.start,end:g.start+h,group:g.group}}function m(g){const{delay:h=0,duration:_=300,easing:k=ws,tick:S=Q,css:$}=s||ba,T={start:zo()+h,b:g};g||(T.group=ei,ei.r+=1),"inert"in n&&(g?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:($&&(c(),u=us(n,o,g,_,h,k,$)),g&&S(0,1),r=d(T,_),Ke(()=>Xi(n,g,"start")),Vo(C=>{if(a&&C>a.start&&(r=d(a,_),a=null,Xi(n,r.b,"start"),$&&(c(),u=us(n,o,r.b,r.duration,0,k,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Xi(n,r.b,"end"),a||(r.b?c():--r.group.r||we(r.group.c)),r=null;else if(C>=r.start){const D=C-r.start;o=r.a+r.d*k(D/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(g){$t(s)?_a().then(()=>{s=s({direction:g?"in":"out"}),m(g)}):m(g)},end(){c(),r=a=null}}}function su(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(re(),I(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&ga()}if(h0(n)){const l=Ss();if(n.then(s=>{di(l),i(e.then,1,e.value,s),di(null)},s=>{if(di(l),i(e.catch,2,e.error,s),di(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function I0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function pe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Pi(n,e){n.d(1),e.delete(n.key)}function Lt(n,e){I(n,1,1,()=>{e.delete(n.key)})}function L0(n,e){n.f(),Lt(n,e)}function dt(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,g=d;const h={};for(;g--;)h[n[g].key]=g;const _=[],k=new Map,S=new Map,$=[];for(g=m;g--;){const O=c(l,s,g),E=t(O);let L=o.get(E);L?i&&$.push(()=>L.p(O,e)):(L=u(E,O),L.c()),k.set(E,_[g]=L),E in h&&S.set(E,Math.abs(g-h[E]))}const T=new Set,C=new Set;function D(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,m--}for(;d&&m;){const O=_[m-1],E=n[d-1],L=O.key,R=E.key;O===E?(f=O.first,d--,m--):k.has(R)?!o.has(L)||T.has(L)?D(O):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),D(O)):(T.add(R),d--):(a(E,o),d--)}for(;d--;){const O=n[d];k.has(O.key)||a(O,o)}for(;m;)D(_[m-1]);return we($),_}function pt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Ct(n){return typeof n=="object"&&n!==null?n:{}}function ge(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function B(n){n&&n.c()}function z(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(E_).filter($t);n.$$.on_destroy?n.$$.on_destroy.push(...s):we(s),n.$$.on_mount=[]}),l.forEach(Ke)}function V(n,e){const t=n.$$;t.fragment!==null&&(A0(t.after_update),we(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function P0(n,e){n.$$.dirty[0]===-1&&(bl.push(n),q_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const g=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&P0(n,c)),d}):[],u.update(),f=!0,we(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=w0(e.target);u.fragment&&u.fragment.l(c),c.forEach(v)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),z(n,e.target,e.anchor),ga()}di(a)}class be{constructor(){Ue(this,"$$");Ue(this,"$$set")}$destroy(){V(this,1),this.$destroy=Q}$on(e,t){if(!$t(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!g0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const F0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(F0);function Nt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function z_(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return H_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=Q;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,o,r);s?o(g):c=$t(g)?g:Q},m=l.map((g,h)=>ma(g,_=>{u[h]=_,f&=~(1<{f|=1<{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[7]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a&4?pt(l,[Ct(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function R0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=pt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),e.$on("routeEvent",r[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a&6?pt(l,[a&2&&{params:r[1]},a&4&&Ct(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function q0(n){let e,t,i,l;const s=[R0,N0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ou(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Bo=H_(null,function(e){e(ou());const t=()=>{e(ou())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});z_(Bo,n=>n.location);const Uo=z_(Bo,n=>n.querystring),ru=Dn(void 0);async function il(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function ln(n,e){if(e=uu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return au(n,e),{update(t){t=uu(t),au(n,t)}}}function j0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function au(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||H0(i.currentTarget.getAttribute("href"))})}function uu(n){return n&&typeof n=="string"?{href:n}:n||{}}function H0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function z0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:E}=V_(C);this.path=C,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=O,this._keys=E}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const D=this._pattern.exec(C);if(D===null)return null;if(this._keys===!1)return D;const O={};let E=0;for(;E{r.push(new o(C,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=rt();async function d(T,C){await Qt(),c(T,C)}let m=null,g=null;s&&(g=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?m=T.state:m=null},window.addEventListener("popstate",g),D0(()=>{j0(m)}));let h=null,_=null;const k=Bo.subscribe(async T=>{h=T;let C=0;for(;C{ru.set(u)});return}t(0,a=null),_=null,ru.set(void 0)});Ts(()=>{k(),g&&window.removeEventListener("popstate",g)});function S(T){Ee.call(this,n,T)}function $(T){Ee.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,l=T.prefix),"restoreScrollState"in T&&t(5,s=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,$]}class V0 extends be{constructor(e){super(),_e(this,e,z0,q0,me,{routes:3,prefix:4,restoreScrollState:5})}}const ao=[];let B_;function U_(n){const e=n.pattern.test(B_);fu(n,n.className,e),fu(n,n.inactiveClassName,!e)}function fu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Bo.subscribe(n=>{B_=n.location+(n.querystring?"?"+n.querystring:""),ao.map(U_)});function Pn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?V_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ao.push(i),U_(i),{destroy(){ao.splice(ao.indexOf(i),1)}}}const B0="modulepreload",U0=function(n,e){return new URL(n,e).href},cu={},st=function(e,t,i){if(!t||t.length===0)return e();const l=document.getElementsByTagName("link");return Promise.all(t.map(s=>{if(s=U0(s,i),s in cu)return;cu[s]=!0;const o=s.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=l.length-1;f>=0;f--){const c=l[f];if(c.href===s&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":B0,o||(u.as="script",u.crossOrigin=""),u.href=s,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};class qn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,qn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof qn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Fs=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function W0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||Y0;let l=0;for(;l0&&(!t.exp||t.exp-e>Date.now()/1e3))}W_=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const pu="pb_auth";class J0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ka(this.token)}get isAdmin(){return uo(this.token).type==="admin"}get isAuthRecord(){return uo(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=pu){const i=W0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=pu){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=uo(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=du(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(u=s==null?void 0:s.model)==null?void 0:u.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(s.model[c]=this.model[c]);o=du(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Y_ extends J0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class ll{constructor(e){this.client=e}}class Z0 extends ll{getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class va extends ll{decode(e){return e}getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new qn({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function or(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class G0 extends va{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||or(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(u,f,c,d){or(u);const m=u.beforeSend,g=u.authStore.model,h=u.authStore.onChange((_,k)=>{(!_||(k==null?void 0:k.id)!=(g==null?void 0:g.id)||(k!=null&&k.collectionId||g!=null&&g.collectionId)&&(k==null?void 0:k.collectionId)!=(g==null?void 0:g.collectionId))&&or(u)});u._resetAutoRefresh=function(){h(),u.beforeSend=m,delete u._resetAutoRefresh},u.beforeSend=async(_,k)=>{var C;const S=u.authStore.token;if((C=k.query)!=null&&C.autoRefresh)return m?m(_,k):{url:_,sendOptions:k};let $=u.authStore.isValid;if($&&ka(u.authStore.token,f))try{await c()}catch{$=!1}$||await d();const T=k.headers||{};for(let D in T)if(D.toLowerCase()=="authorization"&&S==T[D]&&u.authStore.token){T[D]=u.authStore.token;break}return k.headers=T,m?m(_,k):{url:_,sendOptions:k}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const X0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function K_(n){if(n){n.query=n.query||{};for(let e in n)X0.includes(e)||(n.query[e]=n[e],delete n[e])}}class J_ extends ll{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){K_(i);const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new qn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class Q0 extends va{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}getList(e=1,t=30,i){return super.getList(e,t,i)}getFirstListItem(e,t){return super.getFirstListItem(e,t)}getOne(e,t){return super.getOne(e,t)}create(e,t){return super.create(e,t)}update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}async authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(await this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new qn(new Error(`Missing or invalid provider "${t.provider}".`));const l=this.client.buildUrl("/api/oauth2-redirect"),s=new J_(this.client);let o=null;function r(){o==null||o.close(),s.unsubscribe()}return t.urlCallback||(o=mu(void 0)),new Promise(async(a,u)=>{var f;try{await s.subscribe("@oauth2",async g=>{const h=s.clientId;try{if(!g.state||h!==g.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const k=await this.authWithOAuth2Code(i.name,g.code,i.codeVerifier,l,t.createData,_);a(k)}catch(_){u(new qn(_))}r()});const c={state:s.clientId};(f=t.scopes)!=null&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+l,c);await(t.urlCallback||function(g){o?o.location.href=g:o=mu(g)})(d)}catch(c){r(),u(new qn(c))}})}authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>!0)}requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>!0)}listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function mu(n){if(typeof window>"u"||!(window!=null&&window.open))throw new qn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class x0 extends va{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class ey extends ll{getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class ty extends ll{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class ny extends ll{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class iy extends ll{getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class Wo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Y_,this.admins=new G0(this),this.collections=new x0(this),this.files=new ny(this),this.logs=new ey(this),this.settings=new Z0(this),this.realtime=new J_(this),this.health=new ty(this),this.backups=new iy(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new Q0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new qn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new qn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),K_(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const l=Array.isArray(e[i])?e[i]:[e[i]];for(let s of l)t.append(i,s)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class sl extends Error{}class ly extends sl{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class sy extends sl{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class oy extends sl{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Gl extends sl{}class Z_ extends sl{constructor(e){super(`Invalid unit ${e}`)}}class Nn extends sl{}class vi extends sl{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Zn="short",Mn="long",Ur={year:Oe,month:Oe,day:Oe},G_={year:Oe,month:Zn,day:Oe},ry={year:Oe,month:Zn,day:Oe,weekday:Zn},X_={year:Oe,month:Mn,day:Oe},Q_={year:Oe,month:Mn,day:Oe,weekday:Mn},x_={hour:Oe,minute:Oe},e1={hour:Oe,minute:Oe,second:Oe},t1={hour:Oe,minute:Oe,second:Oe,timeZoneName:Zn},n1={hour:Oe,minute:Oe,second:Oe,timeZoneName:Mn},i1={hour:Oe,minute:Oe,hourCycle:"h23"},l1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},s1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Zn},o1={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Mn},r1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},a1={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},u1={year:Oe,month:Zn,day:Oe,hour:Oe,minute:Oe},f1={year:Oe,month:Zn,day:Oe,hour:Oe,minute:Oe,second:Oe},ay={year:Oe,month:Zn,day:Oe,weekday:Zn,hour:Oe,minute:Oe},c1={year:Oe,month:Mn,day:Oe,hour:Oe,minute:Oe,timeZoneName:Zn},d1={year:Oe,month:Mn,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Zn},p1={year:Oe,month:Mn,day:Oe,weekday:Mn,hour:Oe,minute:Oe,timeZoneName:Mn},m1={year:Oe,month:Mn,day:Oe,weekday:Mn,hour:Oe,minute:Oe,second:Oe,timeZoneName:Mn};function lt(n){return typeof n>"u"}function Qi(n){return typeof n=="number"}function Yo(n){return typeof n=="number"&&n%1===0}function uy(n){return typeof n=="string"}function fy(n){return Object.prototype.toString.call(n)==="[object Date]"}function h1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function cy(n){return Array.isArray(n)?n:[n]}function hu(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function dy(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Cl(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function pi(n,e,t){return Yo(n)&&n>=e&&n<=t}function py(n,e){return n-e*Math.floor(n/e)}function Ut(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function wi(n){if(!(lt(n)||n===null||n===""))return parseInt(n,10)}function qi(n){if(!(lt(n)||n===null||n===""))return parseFloat(n)}function wa(n){if(!(lt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Sa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function $s(n){return n%4===0&&(n%100!==0||n%400===0)}function ts(n){return $s(n)?366:365}function wo(n,e){const t=py(e-1,12)+1,i=n+(e-t)/12;return t===2?$s(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ta(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function So(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Wr(n){return n>99?n:n>60?1900+n:2e3+n}function g1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Ko(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function _1(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Nn(`Invalid unit value ${n}`);return e}function To(n,e){const t={};for(const i in n)if(Cl(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=_1(l)}return t}function ns(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Ut(t,2)}:${Ut(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Ut(t,2)}${Ut(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Jo(n){return dy(n,["hour","minute","second","millisecond"])}const b1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,my=["January","February","March","April","May","June","July","August","September","October","November","December"],y1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],hy=["J","F","M","A","M","J","J","A","S","O","N","D"];function k1(n){switch(n){case"narrow":return[...hy];case"short":return[...y1];case"long":return[...my];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const v1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],w1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],gy=["M","T","W","T","F","S","S"];function S1(n){switch(n){case"narrow":return[...gy];case"short":return[...w1];case"long":return[...v1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const T1=["AM","PM"],_y=["Before Christ","Anno Domini"],by=["BC","AD"],yy=["B","A"];function $1(n){switch(n){case"narrow":return[...yy];case"short":return[...by];case"long":return[..._y];default:return null}}function ky(n){return T1[n.hour<12?0:1]}function vy(n,e){return S1(e)[n.weekday-1]}function wy(n,e){return k1(e)[n.month-1]}function Sy(n,e){return $1(e)[n.year<0?0:1]}function Ty(n,e,t="always",i=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function gu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const $y={D:Ur,DD:G_,DDD:X_,DDDD:Q_,t:x_,tt:e1,ttt:t1,tttt:n1,T:i1,TT:l1,TTT:s1,TTTT:o1,f:r1,ff:u1,fff:c1,ffff:p1,F:a1,FF:f1,FFF:d1,FFFF:m1};class gn{static create(e,t={}){return new gn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o0&&s.push({literal:l,val:i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l,val:i}),s}static macroTokenToFormatOpts(e){return $y[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Ut(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,g)=>this.loc.extract(e,m,g),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?ky(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,g)=>i?wy(e,m):s(g?{month:m}:{month:m,day:"numeric"},"month"),u=(m,g)=>i?vy(e,m):s(g?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const g=gn.macroTokenToFormatOpts(m);return g?this.formatWithSystemDefault(e,g):m},c=m=>i?Sy(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return gu(gn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},s=gn.parseFormat(t),o=s.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return gu(s,l(r))}}class Yn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cs{get type(){throw new vi}get name(){throw new vi}get ianaName(){return this.name}get isUniversal(){throw new vi}offsetName(e,t){throw new vi}formatOffset(e,t){throw new vi}offset(e){throw new vi}equals(e){throw new vi}get isValid(){throw new vi}}let rr=null;class $a extends Cs{static get instance(){return rr===null&&(rr=new $a),rr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return g1(e,t,i)}formatOffset(e,t){return ns(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let fo={};function Cy(n){return fo[n]||(fo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),fo[n]}const My={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Oy(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function Dy(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l=0?g:1e3+g,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ar=null;class un extends Cs{static get utcInstance(){return ar===null&&(ar=new un(0)),ar}static instance(e){return e===0?un.utcInstance:new un(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new un(Ko(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ns(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ns(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return ns(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class Ey extends Cs{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ti(n,e){if(lt(n)||n===null)return e;if(n instanceof Cs)return n;if(uy(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?un.utcInstance:un.parseSpecifier(t)||mi.create(n)}else return Qi(n)?un.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new Ey(n)}let _u=()=>Date.now(),bu="system",yu=null,ku=null,vu=null,wu;class Zt{static get now(){return _u}static set now(e){_u=e}static set defaultZone(e){bu=e}static get defaultZone(){return Ti(bu,$a.instance)}static get defaultLocale(){return yu}static set defaultLocale(e){yu=e}static get defaultNumberingSystem(){return ku}static set defaultNumberingSystem(e){ku=e}static get defaultOutputCalendar(){return vu}static set defaultOutputCalendar(e){vu=e}static get throwOnInvalid(){return wu}static set throwOnInvalid(e){wu=e}static resetCaches(){At.resetCache(),mi.resetCache()}}let Su={};function Ay(n,e={}){const t=JSON.stringify([n,e]);let i=Su[t];return i||(i=new Intl.ListFormat(n,e),Su[t]=i),i}let Yr={};function Kr(n,e={}){const t=JSON.stringify([n,e]);let i=Yr[t];return i||(i=new Intl.DateTimeFormat(n,e),Yr[t]=i),i}let Jr={};function Iy(n,e={}){const t=JSON.stringify([n,e]);let i=Jr[t];return i||(i=new Intl.NumberFormat(n,e),Jr[t]=i),i}let Zr={};function Ly(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Zr[l];return s||(s=new Intl.RelativeTimeFormat(n,e),Zr[l]=s),s}let Xl=null;function Py(){return Xl||(Xl=new Intl.DateTimeFormat().resolvedOptions().locale,Xl)}function Fy(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Kr(n).resolvedOptions()}catch{t=Kr(i).resolvedOptions()}const{numberingSystem:l,calendar:s}=t;return[i,l,s]}}function Ny(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Ry(n){const e=[];for(let t=1;t<=12;t++){const i=He.utc(2016,t,1);e.push(n(i))}return e}function qy(n){const e=[];for(let t=1;t<=7;t++){const i=He.utc(2016,11,13+t);e.push(n(i))}return e}function Rs(n,e,t,i,l){const s=n.listingMode(t);return s==="error"?null:s==="en"?i(e):l(e)}function jy(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class Hy{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Iy(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):Sa(e,3);return Ut(t,this.padTo)}}}class zy{constructor(e,t,i){this.opts=i;let l;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&mi.create(r).valid?(l=r,this.dt=e):(l="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:He.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,l=e.zone.name);const s={...this.opts};l&&(s.timeZone=l),this.dtf=Kr(t,s)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Vy{constructor(e,t,i){this.opts={style:"long",...i},!t&&h1()&&(this.rtf=Ly(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Ty(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class At{static fromOpts(e){return At.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,l=!1){const s=e||Zt.defaultLocale,o=s||(l?"en-US":Py()),r=t||Zt.defaultNumberingSystem,a=i||Zt.defaultOutputCalendar;return new At(o,r,a,s)}static resetCache(){Xl=null,Yr={},Jr={},Zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return At.create(e,t,i)}constructor(e,t,i,l){const[s,o,r]=Fy(e);this.locale=s,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=Ny(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=l,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=jy(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:At.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Rs(this,e,i,k1,()=>{const l=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";return this.monthsCache[s][e]||(this.monthsCache[s][e]=Ry(o=>this.extract(o,l,"month"))),this.monthsCache[s][e]})}weekdays(e,t=!1,i=!0){return Rs(this,e,i,S1,()=>{const l=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},s=t?"format":"standalone";return this.weekdaysCache[s][e]||(this.weekdaysCache[s][e]=qy(o=>this.extract(o,l,"weekday"))),this.weekdaysCache[s][e]})}meridiems(e=!0){return Rs(this,void 0,e,()=>T1,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[He.utc(2016,11,13,9),He.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Rs(this,e,t,$1,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[He.utc(-40,1,1),He.utc(2017,1,1)].map(l=>this.extract(l,i,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Hy(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new zy(e,this.intl,t)}relFormatter(e={}){return new Vy(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Ay(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Il(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ll(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Pl(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function C1(...n){return(e,t)=>{const i={};let l;for(l=0;lm!==void 0&&(g||m&&f)?-m:m;return[{years:d(qi(t)),months:d(qi(i)),weeks:d(qi(l)),days:d(qi(s)),hours:d(qi(o)),minutes:d(qi(r)),seconds:d(qi(a),a==="-0"),milliseconds:d(wa(u),c)}]}const tk={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Oa(n,e,t,i,l,s,o){const r={year:e.length===2?Wr(wi(e)):wi(e),month:y1.indexOf(t)+1,day:wi(i),hour:wi(l),minute:wi(s)};return o&&(r.second=wi(o)),n&&(r.weekday=n.length>3?v1.indexOf(n)+1:w1.indexOf(n)+1),r}const nk=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ik(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Oa(e,l,i,t,s,o,r);let m;return a?m=tk[a]:u?m=0:m=Ko(f,c),[d,new un(m)]}function lk(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const sk=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,ok=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,rk=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Tu(n){const[,e,t,i,l,s,o,r]=n;return[Oa(e,l,i,t,s,o,r),un.utcInstance]}function ak(n){const[,e,t,i,l,s,o,r]=n;return[Oa(e,r,t,i,l,s,o),un.utcInstance]}const uk=Il(Uy,Ma),fk=Il(Wy,Ma),ck=Il(Yy,Ma),dk=Il(O1),E1=Ll(Xy,Fl,Ms,Os),pk=Ll(Ky,Fl,Ms,Os),mk=Ll(Jy,Fl,Ms,Os),hk=Ll(Fl,Ms,Os);function gk(n){return Pl(n,[uk,E1],[fk,pk],[ck,mk],[dk,hk])}function _k(n){return Pl(lk(n),[nk,ik])}function bk(n){return Pl(n,[sk,Tu],[ok,Tu],[rk,ak])}function yk(n){return Pl(n,[xy,ek])}const kk=Ll(Fl);function vk(n){return Pl(n,[Qy,kk])}const wk=Il(Zy,Gy),Sk=Il(D1),Tk=Ll(Fl,Ms,Os);function $k(n){return Pl(n,[wk,E1],[Sk,Tk])}const Ck="Invalid Duration",A1={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Mk={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...A1},An=146097/400,hl=146097/4800,Ok={years:{quarters:4,months:12,weeks:An/7,days:An,hours:An*24,minutes:An*24*60,seconds:An*24*60*60,milliseconds:An*24*60*60*1e3},quarters:{months:3,weeks:An/28,days:An/4,hours:An*24/4,minutes:An*24*60/4,seconds:An*24*60*60/4,milliseconds:An*24*60*60*1e3/4},months:{weeks:hl/7,days:hl,hours:hl*24,minutes:hl*24*60,seconds:hl*24*60*60,milliseconds:hl*24*60*60*1e3},...A1},Yi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Dk=Yi.slice(0).reverse();function ji(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new ot(i)}function Ek(n){return n<0?Math.floor(n):Math.ceil(n)}function I1(n,e,t,i,l){const s=n[l][t],o=e[t]/s,r=Math.sign(o)===Math.sign(i[l]),a=!r&&i[l]!==0&&Math.abs(o)<=1?Ek(o):Math.trunc(o);i[l]+=a,e[t]-=a*s}function Ak(n,e){Dk.reduce((t,i)=>lt(e[i])?t:(t&&I1(n,e,t,e,i),i),null)}class ot{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||At.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Ok:Mk,this.isLuxonDuration=!0}static fromMillis(e,t){return ot.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Nn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ot({values:To(e,ot.normalizeUnit),loc:At.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Qi(e))return ot.fromMillis(e);if(ot.isDuration(e))return e;if(typeof e=="object")return ot.fromObject(e);throw new Nn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=yk(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=vk(e);return i?ot.fromObject(i,t):ot.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the Duration is invalid");const i=e instanceof Yn?e:new Yn(e,t);if(Zt.throwOnInvalid)throw new oy(i);return new ot({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new Z_(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?gn.create(this.loc,i).formatDurationFromString(this,e):Ck}toHuman(e={}){const t=Yi.map(i=>{const l=this.values[i];return lt(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(l)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=Sa(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let l=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(l+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(l+=".SSS"));let s=i.toFormat(l);return e.includePrefix&&(s="T"+s),s}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e),i={};for(const l of Yi)(Cl(t.values,l)||Cl(this.values,l))&&(i[l]=t.get(l)+this.get(l));return ji(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=_1(e(this.values[i],i));return ji(this,{values:t},!0)}get(e){return this[ot.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...To(e,ot.normalizeUnit)};return ji(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t}),s={loc:l};return i&&(s.conversionAccuracy=i),ji(this,s)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ak(this.matrix,e),ji(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ot.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Yi)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;Qi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in l)Yi.indexOf(u)>Yi.indexOf(o)&&I1(this.matrix,l,u,t,o)}else Qi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return ji(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return ji(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Yi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Hl="Invalid Interval";function Ik(n,e){return!n||!n.isValid?Rt.invalid("missing or invalid start"):!e||!e.isValid?Rt.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Rt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Bl).filter(o=>this.contains(o)).sort(),i=[];let{s:l}=this,s=0;for(;l+this.e?this.e:o;i.push(Rt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=ot.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;ia*l));s=+r>+this.e?this.e:r,o.push(Rt.fromDateTimes(i,s)),i=s,l+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Rt.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Rt.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&l.push(Rt.fromDateTimes(t,a.time)),t=null);return Rt.merge(l)}difference(...e){return Rt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Hl}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Hl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Hl}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Hl}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Hl}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ot.invalid(this.invalidReason)}mapEndpoints(e){return Rt.fromDateTimes(e(this.s),e(this.e))}}class qs{static hasDST(e=Zt.defaultZone){const t=He.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return mi.isValidZone(e)}static normalizeZone(e){return Ti(e,Zt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||At.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||At.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||At.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||At.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return At.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return At.create(t,null,"gregory").eras(e)}static features(){return{relative:h1()}}}function $u(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ot.fromMillis(i).as("days"))}function Lk(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=$u(r,a);return(u-u%7)/7}],["days",$u]],l={};let s,o;for(const[r,a]of i)if(t.indexOf(r)>=0){s=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,l[r]=u}return[n,l,o,s]}function Pk(n,e,t,i){let[l,s,o,r]=Lk(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?ot.fromMillis(a,i).shiftTo(...u).plus(f):f}const Da={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Cu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Fk=Da.hanidec.replace(/[\[|\]]/g,"").split("");function Nk(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}function Un({numberingSystem:n},e=""){return new RegExp(`${Da[n||"latn"]}${e}`)}const Rk="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(Nk(t))}}const qk=String.fromCharCode(160),L1=`[ ${qk}]`,P1=new RegExp(L1,"g");function jk(n){return n.replace(/\./g,"\\.?").replace(P1,L1)}function Mu(n){return n.replace(/\./g,"").replace(P1," ").toLowerCase()}function Wn(n,e){return n===null?null:{regex:RegExp(n.map(jk).join("|")),deser:([t])=>n.findIndex(i=>Mu(t)===Mu(i))+e}}function Ou(n,e){return{regex:n,deser:([,t,i])=>Ko(t,i),groups:e}}function ur(n){return{regex:n,deser:([e])=>e}}function Hk(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function zk(n,e){const t=Un(e),i=Un(e,"{2}"),l=Un(e,"{3}"),s=Un(e,"{4}"),o=Un(e,"{6}"),r=Un(e,"{1,2}"),a=Un(e,"{1,3}"),u=Un(e,"{1,6}"),f=Un(e,"{1,9}"),c=Un(e,"{2,4}"),d=Un(e,"{4,6}"),m=_=>({regex:RegExp(Hk(_.val)),deser:([k])=>k,literal:!0}),h=(_=>{if(n.literal)return m(_);switch(_.val){case"G":return Wn(e.eras("short",!1),0);case"GG":return Wn(e.eras("long",!1),0);case"y":return ft(u);case"yy":return ft(c,Wr);case"yyyy":return ft(s);case"yyyyy":return ft(d);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Wn(e.months("short",!0,!1),1);case"MMMM":return Wn(e.months("long",!0,!1),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Wn(e.months("short",!1,!1),1);case"LLLL":return Wn(e.months("long",!1,!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(l);case"HH":return ft(i);case"H":return ft(r);case"hh":return ft(i);case"h":return ft(r);case"mm":return ft(i);case"m":return ft(r);case"q":return ft(r);case"qq":return ft(i);case"s":return ft(r);case"ss":return ft(i);case"S":return ft(a);case"SSS":return ft(l);case"u":return ur(f);case"uu":return ur(r);case"uuu":return ft(t);case"a":return Wn(e.meridiems(),0);case"kkkk":return ft(s);case"kk":return ft(c,Wr);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Wn(e.weekdays("short",!1,!1),1);case"EEEE":return Wn(e.weekdays("long",!1,!1),1);case"ccc":return Wn(e.weekdays("short",!0,!1),1);case"cccc":return Wn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ou(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ou(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ur(/[a-z_+-/]{1,256}?/i);default:return m(_)}})(n)||{invalidReason:Rk};return h.token=n,h}const Vk={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function Bk(n,e,t){const{type:i,value:l}=n;if(i==="literal")return{literal:!0,val:l};const s=t[i];let o=Vk[i];if(typeof o=="object"&&(o=o[s]),o)return{literal:!1,val:o}}function Uk(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Wk(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Cl(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Yk(n){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return lt(n.z)||(t=mi.create(n.z)),lt(n.Z)||(t||(t=new un(n.Z)),i=n.Z),lt(n.q)||(n.M=(n.q-1)*3+1),lt(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),lt(n.u)||(n.S=wa(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let fr=null;function Kk(){return fr||(fr=He.fromMillis(1555555555555)),fr}function Jk(n,e){if(n.literal)return n;const t=gn.macroTokenToFormatOpts(n.val);if(!t)return n;const s=gn.create(e,t).formatDateTimeParts(Kk()).map(o=>Bk(o,e,t));return s.includes(void 0)?n:s}function Zk(n,e){return Array.prototype.concat(...n.map(t=>Jk(t,e)))}function F1(n,e,t){const i=Zk(gn.parseFormat(t),n),l=i.map(o=>zk(o,n)),s=l.find(o=>o.invalidReason);if(s)return{input:e,tokens:i,invalidReason:s.invalidReason};{const[o,r]=Uk(l),a=RegExp(o,"i"),[u,f]=Wk(e,a,r),[c,d,m]=f?Yk(f):[null,null,void 0];if(Cl(f,"a")&&Cl(f,"H"))throw new Gl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:m}}}function Gk(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=F1(n,e,t);return[i,l,s,o]}const N1=[0,31,59,90,120,151,181,212,243,273,304,334],R1=[0,31,60,91,121,152,182,213,244,274,305,335];function Rn(n,e){return new Yn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function q1(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function j1(n,e,t){return t+($s(n)?R1:N1)[e-1]}function H1(n,e){const t=$s(n)?R1:N1,i=t.findIndex(s=>sSo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:s,...Jo(n)}}function Du(n){const{weekYear:e,weekNumber:t,weekday:i}=n,l=q1(e,1,4),s=ts(e);let o=t*7+i-l-3,r;o<1?(r=e-1,o+=ts(r)):o>s?(r=e+1,o-=ts(e)):r=e;const{month:a,day:u}=H1(r,o);return{year:r,month:a,day:u,...Jo(n)}}function cr(n){const{year:e,month:t,day:i}=n,l=j1(e,t,i);return{year:e,ordinal:l,...Jo(n)}}function Eu(n){const{year:e,ordinal:t}=n,{month:i,day:l}=H1(e,t);return{year:e,month:i,day:l,...Jo(n)}}function Xk(n){const e=Yo(n.weekYear),t=pi(n.weekNumber,1,So(n.weekYear)),i=pi(n.weekday,1,7);return e?t?i?!1:Rn("weekday",n.weekday):Rn("week",n.week):Rn("weekYear",n.weekYear)}function Qk(n){const e=Yo(n.year),t=pi(n.ordinal,1,ts(n.year));return e?t?!1:Rn("ordinal",n.ordinal):Rn("year",n.year)}function z1(n){const e=Yo(n.year),t=pi(n.month,1,12),i=pi(n.day,1,wo(n.year,n.month));return e?t?i?!1:Rn("day",n.day):Rn("month",n.month):Rn("year",n.year)}function V1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=pi(e,0,23)||e===24&&t===0&&i===0&&l===0,o=pi(t,0,59),r=pi(i,0,59),a=pi(l,0,999);return s?o?r?a?!1:Rn("millisecond",l):Rn("second",i):Rn("minute",t):Rn("hour",e)}const dr="Invalid DateTime",Au=864e13;function js(n){return new Yn("unsupported zone",`the zone "${n.name}" is not supported`)}function pr(n){return n.weekData===null&&(n.weekData=Gr(n.c)),n.weekData}function zl(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new He({...t,...e,old:t})}function B1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Iu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function co(n,e,t){return B1(Ta(n),e,t)}function Lu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,wo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ot.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Ta(s);let[a,u]=B1(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Vl(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=He.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return He.invalid(new Yn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function Hs(n,e,t=!0){return n.isValid?gn.create(At.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function mr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Ut(n.c.year,t?6:4),e?(i+="-",i+=Ut(n.c.month),i+="-",i+=Ut(n.c.day)):(i+=Ut(n.c.month),i+=Ut(n.c.day)),i}function Pu(n,e,t,i,l,s){let o=Ut(n.c.hour);return e?(o+=":",o+=Ut(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Ut(n.c.minute),(n.c.second!==0||!t)&&(o+=Ut(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Ut(n.c.millisecond,3))),l&&(n.isOffsetFixed&&n.offset===0&&!s?o+="Z":n.o<0?(o+="-",o+=Ut(Math.trunc(-n.o/60)),o+=":",o+=Ut(Math.trunc(-n.o%60))):(o+="+",o+=Ut(Math.trunc(n.o/60)),o+=":",o+=Ut(Math.trunc(n.o%60)))),s&&(o+="["+n.zone.ianaName+"]"),o}const U1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},xk={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ev={ordinal:1,hour:0,minute:0,second:0,millisecond:0},W1=["year","month","day","hour","minute","second","millisecond"],tv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],nv=["year","ordinal","hour","minute","second","millisecond"];function Fu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new Z_(n);return e}function Nu(n,e){const t=Ti(e.zone,Zt.defaultZone),i=At.fromObject(e),l=Zt.now();let s,o;if(lt(n.year))s=l;else{for(const u of W1)lt(n[u])&&(n[u]=U1[u]);const r=z1(n)||V1(n);if(r)return He.invalid(r);const a=t.offset(l);[s,o]=co(n,a,t)}return new He({ts:s,zone:t,loc:i,o})}function Ru(n,e,t){const i=lt(t.round)?!0:t.round,l=(o,r)=>(o=Sa(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),s=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return l(s(t.unit),t.unit);for(const o of t.units){const r=s(o);if(Math.abs(r)>=1)return l(r,o)}return l(n>e?-0:0,t.units[t.units.length-1])}function qu(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class He{constructor(e){const t=e.zone||Zt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Yn("invalid input"):null)||(t.isValid?null:js(t));this.ts=lt(e.ts)?Zt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);l=Iu(this.ts,r),i=Number.isNaN(l.year)?new Yn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||At.create(),this.invalid=i,this.weekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new He({})}static local(){const[e,t]=qu(arguments),[i,l,s,o,r,a,u]=t;return Nu({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=qu(arguments),[i,l,s,o,r,a,u]=t;return e.zone=un.utcInstance,Nu({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=fy(e)?e.valueOf():NaN;if(Number.isNaN(i))return He.invalid("invalid input");const l=Ti(t.zone,Zt.defaultZone);return l.isValid?new He({ts:i,zone:l,loc:At.fromObject(t)}):He.invalid(js(l))}static fromMillis(e,t={}){if(Qi(e))return e<-Au||e>Au?He.invalid("Timestamp out of range"):new He({ts:e,zone:Ti(t.zone,Zt.defaultZone),loc:At.fromObject(t)});throw new Nn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Qi(e))return new He({ts:e*1e3,zone:Ti(t.zone,Zt.defaultZone),loc:At.fromObject(t)});throw new Nn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ti(t.zone,Zt.defaultZone);if(!i.isValid)return He.invalid(js(i));const l=Zt.now(),s=lt(t.specificOffset)?i.offset(l):t.specificOffset,o=To(e,Fu),r=!lt(o.ordinal),a=!lt(o.year),u=!lt(o.month)||!lt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=At.fromObject(t);if((f||r)&&c)throw new Gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Gl("Can't mix ordinal dates with month/day");const m=c||o.weekday&&!f;let g,h,_=Iu(l,s);m?(g=tv,h=xk,_=Gr(_)):r?(g=nv,h=ev,_=cr(_)):(g=W1,h=U1);let k=!1;for(const E of g){const L=o[E];lt(L)?k?o[E]=h[E]:o[E]=_[E]:k=!0}const S=m?Xk(o):r?Qk(o):z1(o),$=S||V1(o);if($)return He.invalid($);const T=m?Du(o):r?Eu(o):o,[C,D]=co(T,s,i),O=new He({ts:C,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?He.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,l]=gk(e);return Vl(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=_k(e);return Vl(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=bk(e);return Vl(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(lt(e)||lt(t))throw new Nn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=At.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=Gk(o,e,t);return f?He.invalid(f):Vl(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return He.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=$k(e);return Vl(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Nn("need to specify a reason the DateTime is invalid");const i=e instanceof Yn?e:new Yn(e,t);if(Zt.throwOnInvalid)throw new ly(i);return new He({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?pr(this).weekYear:NaN}get weekNumber(){return this.isValid?pr(this).weekNumber:NaN}get weekday(){return this.isValid?pr(this).weekday:NaN}get ordinal(){return this.isValid?cr(this.c).ordinal:NaN}get monthShort(){return this.isValid?qs.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qs.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qs.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qs.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return $s(this.year)}get daysInMonth(){return wo(this.year,this.month)}get daysInYear(){return this.isValid?ts(this.year):NaN}get weeksInWeekYear(){return this.isValid?So(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(un.instance(e),t)}toLocal(){return this.setZone(Zt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ti(e,Zt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=co(o,s,e)}return zl(this,{ts:l,zone:e})}else return He.invalid(js(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return zl(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=To(e,Fu),i=!lt(t.weekYear)||!lt(t.weekNumber)||!lt(t.weekday),l=!lt(t.ordinal),s=!lt(t.year),o=!lt(t.month)||!lt(t.day),r=s||o,a=t.weekYear||t.weekNumber;if((r||l)&&a)throw new Gl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&l)throw new Gl("Can't mix ordinal dates with month/day");let u;i?u=Du({...Gr(this.c),...t}):lt(t.ordinal)?(u={...this.toObject(),...t},lt(t.day)&&(u.day=Math.min(wo(u.year,u.month),u.day))):u=Eu({...cr(this.c),...t});const[f,c]=co(u,this.o,this.zone);return zl(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e);return zl(this,Lu(this,t))}minus(e){if(!this.isValid)return this;const t=ot.fromDurationLike(e).negate();return zl(this,Lu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ot.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const l=Math.ceil(this.month/3);t.month=(l-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?gn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):dr}toLocaleString(e=Ur,t={}){return this.isValid?gn.create(this.loc.clone(t),e).formatDateTime(this):dr}toLocaleParts(e={}){return this.isValid?gn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:l=!0,extendedZone:s=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=mr(this,o);return r+="T",r+=Pu(this,o,t,i,l,s),r}toISODate({format:e="extended"}={}){return this.isValid?mr(this,e==="extended"):null}toISOWeekDate(){return Hs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:l=!1,extendedZone:s=!1,format:o="extended"}={}){return this.isValid?(l?"T":"")+Pu(this,o==="extended",t,e,i,s):null}toRFC2822(){return Hs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Hs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?mr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let l="HH:mm:ss.SSS";return(t||e)&&(i&&(l+=" "),t?l+="z":e&&(l+="ZZ")),Hs(this,l,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():dr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return ot.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=cy(t).map(ot.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Pk(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(He.now(),e,t)}until(e){return this.isValid?Rt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),l=this.setZone(e.zone,{keepLocalTime:!0});return l.startOf(t)<=i&&i<=l.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||He.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(He.isDateTime))throw new Nn("max requires all arguments be DateTimes");return hu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=At.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return F1(o,e,t)}static fromStringExplain(e,t,i={}){return He.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ur}static get DATE_MED(){return G_}static get DATE_MED_WITH_WEEKDAY(){return ry}static get DATE_FULL(){return X_}static get DATE_HUGE(){return Q_}static get TIME_SIMPLE(){return x_}static get TIME_WITH_SECONDS(){return e1}static get TIME_WITH_SHORT_OFFSET(){return t1}static get TIME_WITH_LONG_OFFSET(){return n1}static get TIME_24_SIMPLE(){return i1}static get TIME_24_WITH_SECONDS(){return l1}static get TIME_24_WITH_SHORT_OFFSET(){return s1}static get TIME_24_WITH_LONG_OFFSET(){return o1}static get DATETIME_SHORT(){return r1}static get DATETIME_SHORT_WITH_SECONDS(){return a1}static get DATETIME_MED(){return u1}static get DATETIME_MED_WITH_SECONDS(){return f1}static get DATETIME_MED_WITH_WEEKDAY(){return ay}static get DATETIME_FULL(){return c1}static get DATETIME_FULL_WITH_SECONDS(){return d1}static get DATETIME_HUGE(){return p1}static get DATETIME_HUGE_WITH_SECONDS(){return m1}}function Bl(n){if(He.isDateTime(n))return n;if(n&&n.valueOf&&Qi(n.valueOf()))return He.fromJSDate(n);if(n&&typeof n=="object")return He.fromObject(n);throw new Nn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const iv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],lv=[".mp4",".avi",".mov",".3gp",".wmv"],sv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],ov=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],Y1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;ss.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return He.fromFormat(e,i,{zone:"UTC"})}return He.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!iv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!lv.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!sv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!ov.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,m,g;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const h of t){let _=null;h.type==="number"?_=123:h.type==="date"?_="2022-01-01 10:00:00.123Z":h.type==="bool"?_=!0:h.type==="email"?_="test@example.com":h.type==="url"?_="https://example.com":h.type==="json"?_="JSON":h.type==="file"?(_="filename.jpg",((f=h.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):h.type==="select"?(_=(d=(c=h.options)==null?void 0:c.values)==null?void 0:d[0],((m=h.options)==null?void 0:m.maxSelect)!==1&&(_=[_])):h.type==="relation"?(_="RELATION_RECORD_ID",((g=h.options)==null?void 0:g.maxSelect)!==1&&(_=[_])):_="test",s[h.name]=_}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=j.isObject(u)&&j.findByKey(l,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],g=d.create(c,u,m);d.add(g),l(g.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(j.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return j.truncate(JSON.stringify(e))||t}catch{return t}return""+e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const h=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((h==null?void 0:h.length)!=4)continue;const _=(c=(f=h[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");_&&t.columns.push({name:_,collate:h[2]||"",sort:((d=h[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=` + `),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`, + `),i.length>1&&(t+=` +`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Zo=Dn([]);function $o(n,e=4e3){return Go(n,"info",e)}function It(n,e=3e3){return Go(n,"success",e)}function hi(n,e=4500){return Go(n,"error",e)}function rv(n,e=4500){return Go(n,"warning",e)}function Go(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{K1(i)},t)};Zo.update(l=>(Aa(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function K1(n){Zo.update(e=>(Aa(e,n),e))}function Ea(){Zo.update(n=>{for(let e of n)Aa(n,e);return[]})}function Aa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const gi=Dn({});function Gt(n){gi.set(n||{})}function ii(n){gi.update(e=>(j.deleteByPath(e,n),e))}const Ia=Dn({});function Xr(n){Ia.set(n||{})}const zn=Dn([]),li=Dn({}),Co=Dn(!1),J1=Dn({});function av(n){zn.update(e=>{const t=j.findByKey(e,"id",n);return t?li.set(t):e.length&&li.set(e[0]),e})}function uv(n){li.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),zn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),La(),j.sortCollections(e)))}function fv(n){zn.update(e=>(j.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e[0]:t),La(),e))}async function cv(n=null){Co.set(!0);try{let e=await ue.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),zn.set(e);const t=n&&j.findByKey(e,"id",n);t?li.set(t):e.length&&li.set(e[0]),La()}catch(e){ue.error(e)}Co.set(!1)}function La(){J1.update(n=>(zn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const hr="pb_admin_file_token";Wo.prototype.logout=function(n=!0){this.authStore.clear(),n&&il("/login")};Wo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&hi(s),j.isEmpty(l.data)||Gt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),il("/")};Wo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=_0(J1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(hr)||"";return(!t||ka(t,10))&&(t&&localStorage.removeItem(hr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(hr,t),this._adminFileTokenRequest=null),t};class dv extends Y_{save(e,t){super.save(e,t),t&&!t.collectionId&&Xr(t)}clear(){super.clear(),Xr(null)}}const ue=new Wo("../",new dv("pb_admin_auth"));ue.authStore.model&&!ue.authStore.model.collectionId&&Xr(ue.authStore.model);const pv=n=>({}),ju=n=>({});function mv(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;const g=n[3].default,h=vt(g,n,n[2],null),_=n[3].footer,k=vt(_,n,n[2],ju);return{c(){e=b("div"),t=b("main"),h&&h.c(),i=M(),l=b("footer"),k&&k.c(),s=M(),o=b("a"),o.innerHTML=' Docs',r=M(),a=b("span"),a.textContent="|",u=M(),f=b("a"),c=b("span"),c.textContent="PocketBase v0.20.0-rc4",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,$){w(S,e,$),y(e,t),h&&h.m(t,null),y(e,i),y(e,l),k&&k.m(l,null),y(l,s),y(l,o),y(l,r),y(l,a),y(l,u),y(l,f),y(f,c),m=!0},p(S,[$]){h&&h.p&&(!m||$&4)&&St(h,g,S,S[2],m?wt(g,S[2],$,null):Tt(S[2]),null),k&&k.p&&(!m||$&4)&&St(k,_,S,S[2],m?wt(_,S[2],$,pv):Tt(S[2]),ju),(!m||$&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||$&3)&&x(e,"center-content",S[0])},i(S){m||(A(h,S),A(k,S),m=!0)},o(S){I(h,S),I(k,S),m=!1},d(S){S&&v(e),h&&h.d(S),k&&k.d(S)}}}function hv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class _n extends be{constructor(e){super(),_e(this,e,hv,mv,me,{center:0,class:1})}}function Hu(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',t=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function gv(n){let e,t,i,l=!n[0]&&Hu();const s=n[1].default,o=vt(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),y(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Hu(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&St(o,s,r,r[2],i?wt(s,r[2],a,null):Tt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function _v(n){let e,t;return e=new _n({props:{class:"full-page",center:!0,$$slots:{default:[gv]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function bv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class Z1 extends be{constructor(e){super(),_e(this,e,bv,_v,me,{nobranding:0})}}function Xo(n){const e=n-1;return e*e*e+1}function ds(n,{delay:e=0,duration:t=400,easing:i=ws}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function jn(n,{delay:e=0,duration:t=400,easing:i=Xo,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=lu(l),[m,g]=lu(s);return{delay:e,duration:t,easing:i,css:(h,_)=>` + transform: ${u} translate(${(1-h)*c}${d}, ${(1-h)*m}${g}); + opacity: ${a-f*_}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Xo,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),g=parseFloat(s[`margin${f[1]}`]),h=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*g}px;border-${u[0]}-width: ${k*h}px;border-${u[1]}-width: ${k*_}px;`}}function Yt(n,{delay:e=0,duration:t=400,easing:i=Xo,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>` + transform: ${a} scale(${1-u*d}); + opacity: ${r-f*d} + `}}let Qr,Hi;const xr="app-tooltip";function zu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ai(){return Hi=Hi||document.querySelector("."+xr),Hi||(Hi=document.createElement("div"),Hi.classList.add(xr),document.body.appendChild(Hi)),Hi}function G1(n,e){let t=Ai();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ea(){clearTimeout(Qr),Ai().classList.remove("active"),Ai().activeNode=void 0}function yv(n,e){Ai().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Ai().classList.add("active"),G1(n,e)},isNaN(e.delay)?0:e.delay)}function Fe(n,e){let t=zu(e);function i(){yv(n,t)}function l(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Ai(),{update(s){var o,r;t=zu(s),(r=(o=Ai())==null?void 0:o.activeNode)!=null&&r.contains(n)&&G1(n,t)},destroy(){var s,o;(o=(s=Ai())==null?void 0:s.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Vu(n,e,t){const i=n.slice();return i[12]=e[t],i}const kv=n=>({}),Bu=n=>({uniqueId:n[4]});function vv(n){let e,t,i=pe(n[3]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{s&&(l||(l=Le(t,Yt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Le(t,Yt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Uu(n){let e,t,i=Mo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=Y(i),s=M(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),y(e,t),y(t,l),y(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=Mo(a[12])+"")&&se(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Le(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Le(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function Sv(n){let e,t,i,l,s,o,r;const a=n[9].default,u=vt(a,n,n[8],Bu),f=[wv,vv],c=[];function d(m,g){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,g){w(m,e,g),u&&u.m(e,null),y(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[g]){u&&u.p&&(!s||g&256)&&St(u,a,m,m[8],s?wt(a,m[8],g,kv):Tt(m[8]),Bu);let h=i;i=d(m),i===h?c[i].p(m,g):(re(),I(c[h],1,1,()=>{c[h]=null}),ae(),l=c[i],l?l.p(m,g):(l=c[i]=f[i](m),l.c()),A(l,1),l.m(e,null)),(!s||g&2)&&p(e,"class",m[1]),(!s||g&10)&&x(e,"error",m[3].length)},i(m){s||(A(u,m),A(l),s=!0)},o(m){I(u,m),I(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Wu="Invalid value";function Mo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Wu:n||Wu}function Tv(n,e,t){let i;We(n,gi,h=>t(7,i=h));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ii(r)}Vt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(h){Ee.call(this,n,h)}function g(h){te[h?"unshift":"push"](()=>{f=h,t(2,f)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,u=h.class),"$$scope"in h&&t(8,s=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,g]}class he extends be{constructor(e){super(),_e(this,e,Tv,Sv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function $v(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0]),s.focus(),r||(a=K(s,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(s,"id",o),f&1&&s.value!==u[0]&&ce(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Cv(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[1]),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(s,"id",o),d&2&&s.value!==c[1]&&ce(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Mv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[2]),r||(a=K(s,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Ov(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return l=new he({props:{class:"form-field required",name:"email",$$slots:{default:[$v,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"password",$$slots:{default:[Cv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new he({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Mv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

Create your first admin account in order to continue

",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("button"),f.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,h){w(g,e,h),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),z(a,e,null),y(e,u),y(e,f),c=!0,d||(m=K(e,"submit",Ye(n[4])),d=!0)},p(g,[h]){const _={};h&1537&&(_.$$scope={dirty:h,ctx:g}),l.$set(_);const k={};h&1538&&(k.$$scope={dirty:h,ctx:g}),o.$set(k);const S={};h&1540&&(S.$$scope={dirty:h,ctx:g}),a.$set(S),(!c||h&8)&&x(f,"btn-disabled",g[3]),(!c||h&8)&&x(f,"btn-loading",g[3])},i(g){c||(A(l.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){I(l.$$.fragment,g),I(o.$$.fragment,g),I(a.$$.fragment,g),c=!1},d(g){g&&v(e),V(l),V(o),V(a),d=!1,m()}}}function Dv(n,e,t){const i=rt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ue.admins.create({email:l,password:s,passwordConfirm:o}),await ue.admins.authWithPassword(l,s),i("submit")}catch(d){ue.error(d)}t(3,r=!1)}}function u(){l=this.value,t(0,l)}function f(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,u,f,c]}class Ev extends be{constructor(e){super(),_e(this,e,Dv,Ov,me,{})}}function Yu(n){let e,t;return e=new Z1({props:{$$slots:{default:[Av]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Av(n){let e,t;return e=new Ev({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p:Q,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Iv(n){let e,t,i=n[0]&&Yu(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&A(i,1)):(i=Yu(l),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Lv(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ue.logout(!1),t(0,i=!0);return}ue.authStore.isValid?il("/collections"):ue.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Pv extends be{constructor(e){super(),_e(this,e,Lv,Iv,me,{})}}const Et=Dn(""),Oo=Dn(""),Ml=Dn(!1);function Fv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),ce(e,n[7]),i||(l=K(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&ce(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function Nv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>ge(e,"value",s)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function Ku(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,jn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function Ju(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,jn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Rv(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[Nv,Fv],m=[];function g(k,S){return k[4]&&!k[5]?0:1}s=g(n),o=m[s]=d[s](n);let h=(n[0].length||n[7].length)&&n[7]!=n[0]&&Ku(),_=(n[0].length||n[7].length)&&Ju(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),h&&h.c(),a=M(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(k,S){w(k,e,S),y(e,t),y(t,i),y(e,l),m[s].m(e,null),y(e,r),h&&h.m(e,null),y(e,a),_&&_.m(e,null),u=!0,f||(c=[K(e,"click",fn(n[11])),K(e,"submit",Ye(n[10]))],f=!0)},p(k,[S]){let $=s;s=g(k),s===$?m[s].p(k,S):(re(),I(m[$],1,1,()=>{m[$]=null}),ae(),o=m[s],o?o.p(k,S):(o=m[s]=d[s](k),o.c()),A(o,1),o.m(e,r)),(k[0].length||k[7].length)&&k[7]!=k[0]?h?S&129&&A(h,1):(h=Ku(),h.c(),A(h,1),h.m(e,a)):h&&(re(),I(h,1,1,()=>{h=null}),ae()),k[0].length||k[7].length?_?(_.p(k,S),S&129&&A(_,1)):(_=Ju(k),_.c(),A(_,1),_.m(e,null)):_&&(re(),I(_,1,1,()=>{_=null}),ae())},i(k){u||(A(o),A(h),A(_),u=!0)},o(k){I(o),I(h),I(_),u=!1},d(k){k&&v(e),m[s].d(),h&&h.d(),_&&_.d(),f=!1,we(c)}}}function qv(n,e,t){const i=rt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function g(){t(0,s=d),i("submit",s)}async function h(){u||f||(t(5,f=!0),t(4,u=(await st(()=>import("./FilterAutocompleteInput-c936572d.js"),["./FilterAutocompleteInput-c936572d.js","./index-102ce751.js"],import.meta.url)).default),t(5,f=!1))}Vt(()=>{h()});function _(C){Ee.call(this,n,C)}function k(C){d=C,t(7,d),t(0,s)}function S(C){te[C?"unshift":"push"](()=>{c=C,t(6,c)})}function $(){d=this.value,t(7,d),t(0,s)}const T=()=>{m(!1),g()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,g,_,k,S,$,T]}class Ds extends be{constructor(e){super(),_e(this,e,qv,Rv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function jv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),y(e,t),s||(o=[ve(l=Fe.call(null,e,n[0])),K(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&$t(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,we(o)}}}function Hv(n,e,t){const i=rt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Vt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Qo extends be{constructor(e){super(),_e(this,e,Hv,jv,me,{tooltip:0,class:1})}}function zv(n){let e,t,i,l,s;const o=n[6].default,r=vt(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"click",n[7]),K(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&St(r,o,a,a[5],i?wt(o,a[5],u,null):Tt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,we(s)}}}function Vv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,s=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class Tn extends be{constructor(e){super(),_e(this,e,Vv,zv,me,{class:1,name:2,sort:0,disable:3})}}const Bv=n=>({}),Zu=n=>({}),Uv=n=>({}),Gu=n=>({});function Wv(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=vt(u,n,n[10],Gu),c=n[11].default,d=vt(c,n,n[10],null),m=n[11].after,g=vt(m,n,n[10],Zu);return{c(){e=b("div"),f&&f.c(),t=M(),i=b("div"),d&&d.c(),s=M(),g&&g.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(h,_){w(h,e,_),f&&f.m(e,null),y(e,t),y(e,i),d&&d.m(i,null),n[12](i),y(e,s),g&&g.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(h,[_]){f&&f.p&&(!o||_&1024)&&St(f,u,h,h[10],o?wt(u,h[10],_,Uv):Tt(h[10]),Gu),d&&d.p&&(!o||_&1024)&&St(d,c,h,h[10],o?wt(c,h[10],_,null):Tt(h[10]),null),(!o||_&9&&l!==(l="scroller "+h[0]+" "+h[3]+" svelte-3a0gfs"))&&p(i,"class",l),g&&g.p&&(!o||_&1024)&&St(g,m,h,h[10],o?wt(m,h[10],_,Bv):Tt(h[10]),Zu)},i(h){o||(A(f,h),A(d,h),A(g,h),o=!0)},o(h){I(f,h),I(d,h),I(g,h),o=!1},d(h){h&&v(e),f&&f.d(h),d&&d.d(h),n[12](null),g&&g.d(h),r=!1,we(a)}}}function Yv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,g,h,_,k;function S(){f&&t(2,f.scrollTop=0,f)}function $(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),h=f.clientWidth+2,_=f.clientHeight+2,m=f.scrollWidth-h,g=f.scrollHeight-_,g>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=g&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=h&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{T(),d=null},150))}Vt(()=>(C(),k=new MutationObserver(C),k.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{k==null||k.disconnect(),clearTimeout(d)}));function D(O){te[O?"unshift":"push"](()=>{f=O,t(2,f)})}return n.$$set=O=>{"class"in O&&t(0,o=O.class),"vThreshold"in O&&t(4,r=O.vThreshold),"hThreshold"in O&&t(5,a=O.hThreshold),"dispatchOnNoScroll"in O&&t(6,u=O.dispatchOnNoScroll),"$$scope"in O&&t(10,l=O.$$scope)},[o,C,f,c,r,a,u,S,$,T,l,i,D]}class xo extends be{constructor(e){super(),_e(this,e,Yv,Wv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Kv(n){let e,t,i=(n[1]||"N/A")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=Y(i),s=Y(" ("),o=Y(n[0]),r=Y(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){w(u,e,f),y(e,t),y(t,l),y(t,s),y(t,o),y(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"N/A")+"")&&se(l,i),f&1&&se(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(u){u&&v(e)}}}function Jv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=Y1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class X1 extends be{constructor(e){super(),_e(this,e,Jv,Kv,me,{level:0})}}function Zv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),y(e,i),l||(s=ve(Fe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function Gv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class Q1 extends be{constructor(e){super(),_e(this,e,Gv,Zv,me,{date:0})}}function Xu(n,e,t){const i=n.slice();i[31]=e[t];const l=i[31].data&&j.isObject(i[31].data);return i[32]=l,i}function Xv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),o||(r=K(t,"change",n[18]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function Qv(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xv(n){let e;return{c(){e=b("div"),e.innerHTML=' level',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function e2(n){let e;return{c(){e=b("div"),e.innerHTML=' data',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function t2(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qu(n){let e;function t(s,o){return s[7]?i2:n2}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function n2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&xu(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=xu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function i2(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function ef(n){let e,t=n[31].message+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt-ellipsis")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].message+"")&&se(i,t)},d(l){l&&v(e)}}}function tf(n){let e,t,i,l,s,o=n[31].data.status&&nf(n),r=n[31].data.execTime&&lf(n),a=n[31].data.auth&&sf(n),u=n[31].data.userIp&&of(n),f=n[31].data.error&&rf(n);return{c(){o&&o.c(),e=M(),r&&r.c(),t=M(),a&&a.c(),i=M(),u&&u.c(),l=M(),f&&f.c(),s=ke()},m(c,d){o&&o.m(c,d),w(c,e,d),r&&r.m(c,d),w(c,t,d),a&&a.m(c,d),w(c,i,d),u&&u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,s,d)},p(c,d){c[31].data.status?o?o.p(c,d):(o=nf(c),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[31].data.execTime?r?r.p(c,d):(r=lf(c),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),c[31].data.auth?a?a.p(c,d):(a=sf(c),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null),c[31].data.userIp?u?u.p(c,d):(u=of(c),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null),c[31].data.error?f?f.p(c,d):(f=rf(c),f.c(),f.m(s.parentNode,s)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(t),v(i),v(l),v(s)),o&&o.d(c),r&&r.d(c),a&&a.d(c),u&&u.d(c),f&&f.d(c)}}}function nf(n){let e,t=n[31].data.status+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.status+"")&&se(i,t)},d(l){l&&v(e)}}}function lf(n){let e,t=n[31].data.execTime+"",i,l;return{c(){e=b("span"),i=Y(t),l=Y("ms"),p(e,"class","label label-sm")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o[0]&8&&t!==(t=s[31].data.execTime+"")&&se(i,t)},d(s){s&&v(e)}}}function sf(n){let e,t=n[31].data.auth+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.auth+"")&&se(i,t)},d(l){l&&v(e)}}}function of(n){let e,t=n[31].data.userIp+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=l[31].data.userIp+"")&&se(i,t)},d(l){l&&v(e)}}}function rf(n){let e,t=j.truncate(typeof n[31].data.error=="string"?n[31].data.error:JSON.stringify(n[31].data.error),200)+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","label label-sm label-danger")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=j.truncate(typeof l[31].data.error=="string"?l[31].data.error:JSON.stringify(l[31].data.error),200)+"")&&se(i,t)},d(l){l&&v(e)}}}function af(n){let e,t=j.truncate(JSON.stringify(n[31].data),350)+"",i;return{c(){e=b("div"),i=Y(t),p(e,"class","block txt-mono txt-xs txt-hint txt-ellipsis m-t-5")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&8&&t!==(t=j.truncate(JSON.stringify(l[31].data),350)+"")&&se(i,t)},d(l){l&&v(e)}}}function uf(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;function F(){return e[22](e[31])}m=new X1({props:{level:e[31].level}});let N=e[31].message&&ef(e),q=e[32]&&tf(e),W=e[32]&&af(e);C=new Q1({props:{date:e[31].created}});function G(){return e[23](e[31])}function J(...H){return e[24](e[31],...H)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=M(),u=b("label"),c=M(),d=b("td"),B(m.$$.fragment),g=M(),h=b("td"),_=b("div"),N&&N.c(),k=M(),q&&q.c(),S=M(),W&&W.c(),$=M(),T=b("td"),B(C.$$.fragment),D=M(),O=b("td"),O.innerHTML='',E=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(u,"for",f="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width"),p(_,"class","flex flex-gap-10"),p(h,"class","col-type-text col-field-data"),p(T,"class","col-type-date col-field-created"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,U){w(H,t,U),y(t,i),y(i,l),y(l,s),y(l,a),y(l,u),y(t,c),y(t,d),z(m,d,null),y(t,g),y(t,h),y(h,_),N&&N.m(_,null),y(_,k),q&&q.m(_,null),y(h,S),W&&W.m(h,null),y(t,$),y(t,T),z(C,T,null),y(t,D),y(t,O),y(t,E),L=!0,R||(P=[K(s,"change",F),K(l,"click",fn(e[17])),K(t,"click",G),K(t,"keydown",J)],R=!0)},p(H,U){e=H,(!L||U[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!L||U[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!L||U[0]&8&&f!==(f="checkbox_"+e[31].id))&&p(u,"for",f);const le={};U[0]&8&&(le.level=e[31].level),m.$set(le),e[31].message?N?N.p(e,U):(N=ef(e),N.c(),N.m(_,k)):N&&(N.d(1),N=null),e[32]?q?q.p(e,U):(q=tf(e),q.c(),q.m(_,null)):q&&(q.d(1),q=null),e[32]?W?W.p(e,U):(W=af(e),W.c(),W.m(h,null)):W&&(W.d(1),W=null);const ee={};U[0]&8&&(ee.date=e[31].created),C.$set(ee)},i(H){L||(A(m.$$.fragment,H),A(C.$$.fragment,H),L=!0)},o(H){I(m.$$.fragment,H),I(C.$$.fragment,H),L=!1},d(H){H&&v(t),V(m),N&&N.d(),q&&q.d(),W&&W.d(),V(C),R=!1,we(P)}}}function l2(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S=[],$=new Map,T;function C(J,H){return J[7]?Qv:Xv}let D=C(n),O=D(n);function E(J){n[19](J)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[xv]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Tn({props:L}),te.push(()=>ge(o,"sort",E));function R(J){n[20](J)}let P={disable:!0,class:"col-type-text col-field-data",name:"data",$$slots:{default:[e2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),u=new Tn({props:P}),te.push(()=>ge(u,"sort",R));function F(J){n[21](J)}let N={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[t2]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),d=new Tn({props:N}),te.push(()=>ge(d,"sort",F));let q=pe(n[3]);const W=J=>J[31].id;for(let J=0;Jr=!1)),o.$set(U);const le={};H[1]&16&&(le.$$scope={dirty:H,ctx:J}),!f&&H[0]&2&&(f=!0,le.sort=J[1],ye(()=>f=!1)),u.$set(le);const ee={};H[1]&16&&(ee.$$scope={dirty:H,ctx:J}),!m&&H[0]&2&&(m=!0,ee.sort=J[1],ye(()=>m=!1)),d.$set(ee),H[0]&9369&&(q=pe(J[3]),re(),S=dt(S,H,W,1,J,q,$,k,Lt,uf,null,Xu),ae(),!q.length&&G?G.p(J,H):q.length?G&&(G.d(1),G=null):(G=Qu(J),G.c(),G.m(k,null))),(!T||H[0]&128)&&x(e,"table-loading",J[7])},i(J){if(!T){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J);for(let H=0;HLoad more',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function cf(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,g,h,_,k,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[5]),o=M(),a=Y(r),u=M(),f=b("button"),f.innerHTML='Reset',c=M(),d=b("div"),m=M(),g=b("button"),g.innerHTML='Download as JSON',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm"),p(e,"class","bulkbar svelte-pk7op9")},m($,T){w($,e,T),y(e,t),y(t,i),y(t,l),y(l,s),y(t,o),y(t,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),_=!0,k||(S=[K(f,"click",n[27]),K(g,"click",n[14])],k=!0)},p($,T){(!_||T[0]&32)&&se(s,$[5]),(!_||T[0]&32)&&r!==(r=$[5]===1?"log":"logs")&&se(a,r)},i($){_||($&&Ke(()=>{_&&(h||(h=Le(e,jn,{duration:150,y:5},!0)),h.run(1))}),_=!0)},o($){$&&(h||(h=Le(e,jn,{duration:150,y:5},!1)),h.run(0)),_=!1},d($){$&&v(e),$&&h&&h.end(),k=!1,we(S)}}}function s2(n){let e,t,i,l,s;e=new xo({props:{class:"table-wrapper",$$slots:{default:[l2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ff(n),r=n[5]&&cf(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ke()},m(a,u){z(e,a,u),w(a,t,u),o&&o.m(a,u),w(a,i,u),r&&r.m(a,u),w(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=ff(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=cf(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){s||(A(e.$$.fragment,a),A(r),s=!0)},o(a){I(e.$$.fragment,a),I(r),s=!1},d(a){a&&(v(t),v(i),v(l)),V(e,a),o&&o.d(a),r&&r.d(a)}}}const df=50,gr=/[-:\. ]/gi;function o2(n,e,t){let i,l,s;const o=rt();let{filter:r=""}=e,{presets:a=""}=e,{sort:u="-rowid"}=e,f=[],c=1,d=0,m=!1,g=0,h={};async function _(H=1,U=!0){return t(7,m=!0),ue.logs.getList(H,df,{sort:u,skipTotal:1,filter:[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&")}).then(async le=>{if(H<=1&&k(),t(7,m=!1),t(6,c=le.page),t(16,d=le.items.length),o("load",f.concat(le.items)),U){const ee=++g;for(;le.items.length&&g==ee;){const oe=le.items.splice(0,10);for(let Te of oe)j.pushOrReplaceByKey(f,Te);t(3,f),await j.yieldToMain()}}else{for(let ee of le.items)j.pushOrReplaceByKey(f,ee);t(3,f)}}).catch(le=>{le!=null&&le.isAbort||(t(7,m=!1),console.warn(le),k(),ue.error(le,(le==null?void 0:le.status)!=400))})}function k(){t(3,f=[]),t(4,h={}),t(6,c=1),t(16,d=0)}function S(){s?$():T()}function $(){t(4,h={})}function T(){for(const H of f)t(4,h[H.id]=H,h);t(4,h)}function C(H){h[H.id]?delete h[H.id]:t(4,h[H.id]=H,h),t(4,h)}function D(){const H=Object.values(h).sort((ee,oe)=>ee.createdoe.created?-1:0);if(!H.length)return;if(H.length==1)return j.downloadJson(H[0],"log_"+H[0].created.replaceAll(gr,"")+".json");const U=H[0].created.replaceAll(gr,""),le=H[H.length-1].created.replaceAll(gr,"");return j.downloadJson(H,`${H.length}_logs_${le}_to_${U}.json`)}function O(H){Ee.call(this,n,H)}const E=()=>S();function L(H){u=H,t(1,u)}function R(H){u=H,t(1,u)}function P(H){u=H,t(1,u)}const F=H=>C(H),N=H=>o("select",H),q=(H,U)=>{U.code==="Enter"&&(U.preventDefault(),o("select",H))},W=()=>t(0,r=""),G=()=>_(c+1),J=()=>$();return n.$$set=H=>{"filter"in H&&t(0,r=H.filter),"presets"in H&&t(15,a=H.presets),"sort"in H&&t(1,u=H.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof u<"u"||typeof r<"u"||typeof a<"u")&&(k(),_(1)),n.$$.dirty[0]&65536&&t(9,i=d>=df),n.$$.dirty[0]&16&&t(5,l=Object.keys(h).length),n.$$.dirty[0]&40&&t(8,s=f.length&&l===f.length)},[r,u,_,f,h,l,c,m,s,i,o,S,$,C,D,a,d,O,E,L,R,P,F,N,q,W,G,J]}class r2 extends be{constructor(e){super(),_e(this,e,o2,s2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */function Es(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Ql(n){return $i(Es(n*2.55),0,255)}function Ii(n){return $i(Es(n*255),0,255)}function fi(n){return $i(Es(n/2.55)/100,0,1)}function pf(n){return $i(Es(n*100),0,100)}const In={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ta=[..."0123456789ABCDEF"],a2=n=>ta[n&15],u2=n=>ta[(n&240)>>4]+ta[n&15],zs=n=>(n&240)>>4===(n&15),f2=n=>zs(n.r)&&zs(n.g)&&zs(n.b)&&zs(n.a);function c2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const d2=(n,e)=>n<255?e(n):"";function p2(n){var e=f2(n)?a2:u2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+d2(n.a,e):void 0}const m2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function x1(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function h2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function g2(n,e,t){const i=x1(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function _2(n,e,t,i,l){return n===l?(e-t)/i+(e.5?f/(2-s-o):f/(s+o),a=_2(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Fa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ii)}function Na(n,e,t){return Fa(x1,n,e,t)}function b2(n,e,t){return Fa(g2,n,e,t)}function y2(n,e,t){return Fa(h2,n,e,t)}function eb(n){return(n%360+360)%360}function k2(n){const e=m2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ql(+e[5]):Ii(+e[5]));const l=eb(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=b2(l,s,o):e[1]==="hsv"?i=y2(l,s,o):i=Na(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function v2(n,e){var t=Pa(n);t[0]=eb(t[0]+e),t=Na(t),n.r=t[0],n.g=t[1],n.b=t[2]}function w2(n){if(!n)return;const e=Pa(n),t=e[0],i=pf(e[1]),l=pf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${fi(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const mf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},hf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function S2(){const n={},e=Object.keys(hf),t=Object.keys(mf);let i,l,s,o,r;for(i=0;i>16&255,s>>8&255,s&255]}return n}let Vs;function T2(n){Vs||(Vs=S2(),Vs.transparent=[0,0,0,0]);const e=Vs[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const $2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function C2(n){const e=$2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Ql(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Ql(i):$i(i,0,255)),l=255&(e[4]?Ql(l):$i(l,0,255)),s=255&(e[6]?Ql(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function M2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${fi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const _r=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,gl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function O2(n,e,t){const i=gl(fi(n.r)),l=gl(fi(n.g)),s=gl(fi(n.b));return{r:Ii(_r(i+t*(gl(fi(e.r))-i))),g:Ii(_r(l+t*(gl(fi(e.g))-l))),b:Ii(_r(s+t*(gl(fi(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Bs(n,e,t){if(n){let i=Pa(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Na(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function tb(n,e){return n&&Object.assign(e||{},n)}function gf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Ii(n[3]))):(e=tb(n,{r:0,g:0,b:0,a:1}),e.a=Ii(e.a)),e}function D2(n){return n.charAt(0)==="r"?C2(n):k2(n)}class ps{constructor(e){if(e instanceof ps)return e;const t=typeof e;let i;t==="object"?i=gf(e):t==="string"&&(i=c2(e)||T2(e)||D2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=tb(this._rgb);return e&&(e.a=fi(e.a)),e}set rgb(e){this._rgb=gf(e)}rgbString(){return this._valid?M2(this._rgb):void 0}hexString(){return this._valid?p2(this._rgb):void 0}hslString(){return this._valid?w2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=O2(this._rgb,e._rgb,t)),this}clone(){return new ps(this.rgb)}alpha(e){return this._rgb.a=Ii(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Es(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Bs(this._rgb,2,e),this}darken(e){return Bs(this._rgb,2,-e),this}saturate(e){return Bs(this._rgb,1,e),this}desaturate(e){return Bs(this._rgb,1,-e),this}rotate(e){return v2(this._rgb,e),this}}/*! + * Chart.js v4.4.0 + * https://www.chartjs.org + * (c) 2023 Chart.js Contributors + * Released under the MIT License + */function ri(){}const E2=(()=>{let n=0;return()=>n++})();function yt(n){return n===null||typeof n>"u"}function Ot(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function jt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function vn(n,e){return jt(n)?n:e}function ht(n,e){return typeof n>"u"?e:n}const A2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let l,s,o;if(Ot(n))if(s=n.length,i)for(l=s-1;l>=0;l--)e.call(t,n[l],l);else for(l=0;ln,x:n=>n.x,y:n=>n.y};function P2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function F2(n){const e=P2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ol(n,e){return(_f[e]||(_f[e]=F2(e)))(n)}function Ra(n){return n.charAt(0).toUpperCase()+n.slice(1)}const hs=n=>typeof n<"u",Li=n=>typeof n=="function",bf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function N2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const xt=Math.PI,On=2*xt,R2=On+xt,Ao=Number.POSITIVE_INFINITY,q2=xt/180,$n=xt/2,zi=xt/4,yf=xt*2/3,Ci=Math.log10,ti=Math.sign;function ls(n,e,t){return Math.abs(n-e)l-s).pop(),e}function Io(n){return!isNaN(parseFloat(n))&&isFinite(n)}function H2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function ib(n,e,t){let i,l,s;for(i=0,l=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ja(n,e,t){t=t||(o=>n[o]1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const ia=(n,e,t,i)=>ja(n,t,i?l=>{const s=n[l][e];return sn[l][e]ja(n,t,i=>n[i][e]>=t);function W2(n,e,t){let i=0,l=n.length;for(;ii&&n[l-1]>t;)l--;return i>0||l{const i="_onData"+Ra(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function wf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(sb.forEach(s=>{delete n[s]}),delete n._chartjs)}function ob(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const rb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ab(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,rb.call(window,()=>{i=!1,n.apply(e,t)}))}}function K2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const J2=n=>n==="start"?"left":n==="end"?"right":"center",Sf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,Us=n=>n===0||n===1,Tf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*On/t)),$f=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*On/t)+1,ss={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*$n)+1,easeOutSine:n=>Math.sin(n*$n),easeInOutSine:n=>-.5*(Math.cos(xt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Us(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Us(n)?n:Tf(n,.075,.3),easeOutElastic:n=>Us(n)?n:$f(n,.075,.3),easeInOutElastic(n){return Us(n)?n:n<.5?.5*Tf(n*2,.1125,.45):.5+.5*$f(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-ss.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?ss.easeInBounce(n*2)*.5:ss.easeOutBounce(n*2-1)*.5+.5};function Ha(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Cf(n){return Ha(n)?n:new ps(n)}function br(n){return Ha(n)?n:new ps(n).saturate(.5).darken(.1).hexString()}const Z2=["x","y","borderWidth","radius","tension"],G2=["color","borderColor","backgroundColor"];function X2(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:G2},numbers:{type:"number",properties:Z2}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function Q2(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Mf=new Map;function x2(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Mf.get(t);return i||(i=new Intl.NumberFormat(n,e),Mf.set(t,i)),i}function za(n,e,t){return x2(e,t).format(n)}const ub={values(n){return Ot(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(l="scientific"),s=ew(n,t)}const o=Ci(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),za(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=t[e].significand||n/Math.pow(10,Math.floor(Ci(n)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?ub.numeric.call(this,n,e,t):""}};function ew(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var er={formatters:ub};function tw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:er.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const tl=Object.create(null),la=Object.create(null);function os(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;ii.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,l)=>br(l.backgroundColor),this.hoverBorderColor=(i,l)=>br(l.borderColor),this.hoverColor=(i,l)=>br(l.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return yr(this,e,t)}get(e){return os(this,e)}describe(e,t){return yr(la,e,t)}override(e,t){return yr(tl,e,t)}route(e,t,i,l){const s=os(this,e),o=os(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return it(a)?Object.assign({},u,a):ht(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var zt=new nw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[X2,Q2,tw]);function iw(n){return!n||yt(n.size)||yt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Po(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function lw(n,e,t,i){i=i||{};let l=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(l=i.data={},s=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function Oi(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,aw(n,s),a=0;a+n||0;function fb(n,e){const t={},i=it(e),l=i?Object.keys(e):e,s=it(n)?i?o=>ht(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=mw(s(o));return t}function cb(n){return fb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function wl(n){return fb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Hn(n){const e=cb(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Cn(n,e){n=n||{},e=e||zt.font;let t=ht(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=ht(n.style,e.style);i&&!(""+i).match(dw)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:ht(n.family,e.family),lineHeight:pw(ht(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:ht(n.weight,e.weight),string:""};return l.string=iw(l),l}function Ws(n,e,t,i){let l=!0,s,o,r;for(s=0,o=n.length;st&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function Fi(n,e){return Object.assign(Object.create(n),e)}function Ua(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=hb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Ua([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return pb(r,a,()=>Sw(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Af(r).includes(a)},ownKeys(r){return Af(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function Dl(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:db(n,i),setContext:s=>Dl(n,s,t,i),override:s=>Dl(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return pb(s,o,()=>_w(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function db(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Li(t)?t:()=>t,isIndexable:Li(i)?i:()=>i}}const gw=(n,e)=>n?n+Ra(e):e,Wa=(n,e)=>it(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function pb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function _w(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Li(r)&&o.isScriptable(e)&&(r=bw(e,r,n,t)),Ot(r)&&r.length&&(r=yw(e,r,n,o.isIndexable)),Wa(e,r)&&(r=Dl(r,l,s&&s[e],o)),r}function bw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Wa(n,a)&&(a=Ya(l._scopes,l,n,a)),a}function yw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(it(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ya(u,l,n,f);e.push(Dl(c,s,o&&o[n],r))}}return e}function mb(n,e,t){return Li(n)?n(e,t):n}const kw=(n,e)=>n===!0?e:typeof n=="string"?Ol(e,n):void 0;function vw(n,e,t,i,l){for(const s of e){const o=kw(t,s);if(o){n.add(o);const r=mb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Ya(n,e,t,i){const l=e._rootScopes,s=mb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Ef(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Ef(r,o,s,a,i),a===null)?!1:Ua(Array.from(r),[""],l,s,()=>ww(e,t,i))}function Ef(n,e,t,i,l){for(;t;)t=vw(n,e,t,i,l);return t}function ww(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Ot(l)&&it(t)?t:l||{}}function Sw(n,e,t,i){let l;for(const s of e)if(l=hb(gw(s,n),t),typeof l<"u")return Wa(n,l)?Ya(t,i,n,l):l}function hb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Af(n){let e=n._keys;return e||(e=n._keys=Tw(n._scopes)),e}function Tw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const $w=Number.EPSILON||1e-14,El=(n,e)=>en==="x"?"y":"x";function Cw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=na(s,l),a=na(o,s);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Mw(n,e,t){const i=n.length;let l,s,o,r,a,u=El(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")Dw(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;sn.ownerDocument.defaultView.getComputedStyle(n,null);function Iw(n,e){return tr(n).getPropertyValue(e)}const Lw=["top","right","bottom","left"];function xi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Lw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Pw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Fw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(Pw(l,s,n.target))r=l,a=s;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Ki(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=tr(t),s=l.boxSizing==="border-box",o=xi(l,"padding"),r=xi(l,"border","width"),{x:a,y:u,box:f}=Fw(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:g}=e;return s&&(m-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Nw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=Ka(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=tr(s),a=xi(r,"border","width"),u=xi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Ro(r.maxWidth,s,"clientWidth"),l=Ro(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Ao,maxHeight:l||Ao}}const Ks=n=>Math.round(n*10)/10;function Rw(n,e,t,i){const l=tr(n),s=xi(l,"margin"),o=Ro(l.maxWidth,n,"clientWidth")||Ao,r=Ro(l.maxHeight,n,"clientHeight")||Ao,a=Nw(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=xi(l,"border","width"),m=xi(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=Ks(Math.min(u,o,a.maxWidth)),f=Ks(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Ks(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Ks(Math.floor(f*i))),{width:u,height:f}}function If(n,e,t){const i=e||1,l=Math.floor(n.height*i),s=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const qw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function Lf(n,e){const t=Iw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ji(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function jw(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Hw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Ji(n,l,t),r=Ji(l,s,t),a=Ji(s,e,t),u=Ji(o,r,t),f=Ji(r,a,t);return Ji(u,f,t)}const zw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},Vw=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function kr(n,e,t){return n?zw(e,t):Vw()}function Bw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Uw(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function bb(n){return n==="angle"?{between:lb,compare:V2,normalize:Sn}:{between:Lo,compare:(e,t)=>e-t,normalize:e=>e}}function Pf({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function Ww(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=bb(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;da(l,$,k)&&r(l,$)!==0,C=()=>r(s,k)===0||a(s,$,k),D=()=>h||T(),O=()=>!h||C();for(let E=f,L=f;E<=c;++E)S=e[E%o],!S.skip&&(k=u(S[i]),k!==$&&(h=a(k,l,s),_===null&&D()&&(_=r(k,l)===0?E:L),_!==null&&O()&&(g.push(Pf({start:_,end:E,loop:d,count:o,style:m})),_=null),L=E,$=k));return _!==null&&g.push(Pf({start:_,end:c,loop:d,count:o,style:m})),g}function kb(n,e){const t=[],i=n.segments;for(let l=0;ll&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function Kw(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function Jw(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=Yw(t,l,s,i);if(i===!0)return Ff(n,[{start:o,end:r,loop:s}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=rb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,l)=>Math.max(i,l._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new Xw;const Rf="transparent",Qw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Cf(n||Rf),l=i.valid&&Cf(e||Rf);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class xw{constructor(e,t,i,l){const s=t[i];l=Ws([e.to,l,s,e.from]);const o=Ws([e.from,s,l]);this._active=!0,this._fn=e.fn||Qw[e.type||typeof o],this._easing=ss[e.easing]||ss.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Ws([e.to,t,l,e.from]),this._from=Ws([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let l=0;l{const s=e[l];if(!it(s))return;const o={};for(const r of t)o[r]=s[r];(Ot(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=t3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&e3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}s[u]=c=new xw(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ai.add(this._chart,i),!0}}function e3(n,e){const t=[],i=Object.keys(e);for(let l=0;l0||!t&&s<0)return l.index}return null}function Vf(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=s3(s,o,i),c=e.length;let d;for(let m=0;mt[i].axis===e).shift()}function a3(n,e){return Fi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function u3(n,e,t){return Fi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ul(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const wr=n=>n==="reset"||n==="none",Bf=(n,e)=>e?n:Object.assign({},n),f3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:wb(t,!0),values:null};class rs{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Hf(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Ul(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,g)=>c==="x"?d:c==="r"?g:m,s=t.xAxisID=ht(i.xAxisID,vr(e,"x")),o=t.yAxisID=ht(i.yAxisID,vr(e,"y")),r=t.rAxisID=ht(i.rAxisID,vr(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&wf(this._data,this),e._stacked&&Ul(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(it(t))this._data=l3(t);else if(i!==t){if(i){wf(i,this);const l=this._cachedMeta;Ul(l),l._parsed=[]}t&&Object.isExtensible(t)&&Y2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let l=!1;this._dataCheck();const s=t._stacked;t._stacked=Hf(t.vScale,t),t.stack!==i.stack&&(l=!0,Ul(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&Vf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Ot(l[e])?d=this.parseArrayData(i,l,e,t):it(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]h||c=0;--d)if(!g()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l=0&&ethis.getContext(i,l,t),h=u.resolveNamedOptions(d,m,g,c);return h.$shared&&(h.$shared=a,s[o]=Object.freeze(Bf(h,a))),h}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new vb(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||wr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){wr(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!wr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(s),r=e;rl-s))}return n._cache.$bar}function d3(n){const e=n.iScale,t=c3(e,n.type);let i=e._length,l,s,o,r;const a=()=>{o===32767||o===-32768||(hs(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(l=0,s=t.length;l0?l[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:l,end:s,min:o,max:r}}function Sb(n,e,t,i){return Ot(n)?h3(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Uf(n,e,t,i){const l=n.iScale,s=n.vScale,o=l.getLabels(),r=l===s,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function _3(n){let e,t,i,l,s;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),s=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(yt(f)||isNaN(f))return!0};for(const a of l)if(!(t!==void 0&&r(a))&&((s===!1||o.indexOf(a.stack)===-1||s===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const l=this._getStacks(e,i),s=t!==void 0?l.indexOf(t):-1;return s===-1?l.length-1:s}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,l=[];let s,o;for(s=0,o=t.data.length;s{a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var $3={evaluateInteractionItems:As,modes:{index(n,e,t,i){const l=Ki(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?Tr(n,l,s,i,o):$r(n,l,s,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const l=Ki(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?Tr(n,l,s,i,o):$r(n,l,s,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Jf(n,e){return n.filter(t=>$b.indexOf(t.pos)===-1&&t.box.axis===e)}function Yl(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function C3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Yl(Wl(e,"left"),!0),l=Yl(Wl(e,"right")),s=Yl(Wl(e,"top"),!0),o=Yl(Wl(e,"bottom")),r=Jf(e,"x"),a=Jf(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:Wl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Zf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Cb(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function E3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!it(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Cb(o,s.getPadding());const r=Math.max(0,e.outerWidth-Zf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Zf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function A3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function I3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function xl(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s{typeof h.beforeLayout=="function"&&h.beforeLayout()});const f=a.reduce((h,_)=>_.box.options&&_.box.options.display===!1?h:h+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Cb(d,Hn(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),g=O3(a.concat(u),c);xl(r.fullSize,m,c,g),xl(a,m,c,g),xl(u,m,c,g)&&xl(a,m,c,g),A3(m),Gf(r.leftAndTop,m,c,g),m.x+=m.w,m.y+=m.h,Gf(r.rightAndBottom,m,c,g),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},gt(r.chartArea,h=>{const _=h.box;Object.assign(_,n.chartArea),_.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Mb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class L3 extends Mb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const mo="$chartjs",P3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xf=n=>n===null||n==="";function F3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[mo]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Xf(l)){const s=Lf(n,"width");s!==void 0&&(n.width=s)}if(Xf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Lf(n,"height");s!==void 0&&(n.height=s)}return n}const Ob=qw?{passive:!0}:!1;function N3(n,e,t){n.addEventListener(e,t,Ob)}function R3(n,e,t){n.canvas.removeEventListener(e,t,Ob)}function q3(n,e){const t=P3[n.type]||n.type,{x:i,y:l}=Ki(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function qo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function j3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||qo(r.addedNodes,i),o=o&&!qo(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function H3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||qo(r.removedNodes,i),o=o&&!qo(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const gs=new Map;let Qf=0;function Db(){const n=window.devicePixelRatio;n!==Qf&&(Qf=n,gs.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function z3(n,e){gs.size||window.addEventListener("resize",Db),gs.set(n,e)}function V3(n){gs.delete(n),gs.size||window.removeEventListener("resize",Db)}function B3(n,e,t){const i=n.canvas,l=i&&Ka(i);if(!l)return;const s=ab((r,a)=>{const u=l.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),z3(n,s),o}function Cr(n,e,t){t&&t.disconnect(),e==="resize"&&V3(n)}function U3(n,e,t){const i=n.canvas,l=ab(s=>{n.ctx!==null&&t(q3(s,n))},n);return N3(i,e,l),l}class W3 extends Mb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(F3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[mo])return!1;const i=t[mo].initial;["height","width"].forEach(s=>{const o=i[s];yt(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[mo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:j3,detach:H3,resize:B3}[t]||U3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:Cr,detach:Cr,resize:Cr}[t]||R3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Rw(e,t,i,l)}isAttached(e){const t=Ka(e);return!!(t&&t.isConnected)}}function Y3(n){return!_b()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?L3:W3}var oo;let Is=(oo=class{constructor(){Ue(this,"x");Ue(this,"y");Ue(this,"active",!1);Ue(this,"options");Ue(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Io(this.x)&&Io(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}},Ue(oo,"defaults",{}),Ue(oo,"defaultRoutes"),oo);function K3(n,e){const t=n.options.ticks,i=J3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?G3(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return X3(e,u,s,o/l),u;const f=Z3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Gs(e,u,f,yt(m)?0:r-m,r),c=0,d=o-1;cl)return a}return Math.max(l,1)}function G3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,xf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,ec=(n,e)=>Math.min(e||n,n);function tc(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;so+r)))return a}function t4(n,e){gt(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;si?i:t,i=l&&t>i?t:i,{min:vn(t,vn(i,t)),max:vn(i,vn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){qt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hw(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=Kn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Kl(e.grid)-t.padding-nc(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=qa(Math.min(Math.asin(Kn((f.highest.height+6)/r,-1,1)),Math.asin(Kn(a/u,-1,1))-Math.asin(Kn(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){qt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){qt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=nc(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Kl(s)+a):(e.height=this.maxHeight,e.width=Kl(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,g=Mi(this.labelRotation),h=Math.cos(g),_=Math.sin(g);if(r){const k=i.mirror?0:_*c.width+h*d.height;e.height=Math.min(this.maxHeight,e.height+k+m)}else{const k=i.mirror?0:h*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+k+m)}this._calculatePadding(u,f,_,h)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;s==="start"?(f=0,c=e.height):s==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){qt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:o[L]||0,height:r[L]||0});return{first:E(0),last:E(t-1),widest:E(D),highest:E(O),widths:o,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return B2(this._alignToPixels?Vi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*l?r/i:a/l:a*l0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Kl(s),m=[],g=r.setContext(this.getContext()),h=g.display?g.width:0,_=h/2,k=function(G){return Vi(i,G,h)};let S,$,T,C,D,O,E,L,R,P,F,N;if(o==="top")S=k(this.bottom),O=this.bottom-d,L=S-_,P=k(e.top)+_,N=e.bottom;else if(o==="bottom")S=k(this.top),P=e.top,N=k(e.bottom)-_,O=S+_,L=this.top+d;else if(o==="left")S=k(this.right),D=this.right-d,E=S-_,R=k(e.left)+_,F=e.right;else if(o==="right")S=k(this.left),R=e.left,F=k(e.right)-_,D=S+_,E=this.left+d;else if(t==="x"){if(o==="center")S=k((e.top+e.bottom)/2+.5);else if(it(o)){const G=Object.keys(o)[0],J=o[G];S=k(this.chart.scales[G].getPixelForValue(J))}P=e.top,N=e.bottom,O=S+_,L=O+d}else if(t==="y"){if(o==="center")S=k((e.left+e.right)/2);else if(it(o)){const G=Object.keys(o)[0],J=o[G];S=k(this.chart.scales[G].getPixelForValue(J))}D=S-_,E=D-d,R=e.left,F=e.right}const q=ht(l.ticks.maxTicksLimit,c),W=Math.max(1,Math.ceil(c/q));for($=0;$s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(s=0,o=l.length;s{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");zt.route(s,l,a,r)})}function a4(n){return"id"in n&&"defaults"in n}class u4{constructor(){this.controllers=new Xs(rs,"datasets",!0),this.elements=new Xs(Is,"elements"),this.plugins=new Xs(Object,"plugins"),this.scales=new Xs(ol,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):gt(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Ra(e);qt(i["before"+l],[],i),t[e](i),qt(i["after"+l],[],i)}_getRegistryForType(e){for(let t=0;ts.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function c4(n){const e={},t=[],i=Object.keys(xn.plugins.items);for(let s=0;s1&&ic(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function lc(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function b4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return lc(n,"x",t[0])||lc(n,"y",t[0])}return{}}function y4(n,e){const t=tl[n.type]||{scales:{}},i=e.scales||{},l=sa(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!it(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=oa(o,r,b4(o,n),zt.scales[r.type]),u=g4(a,l),f=t.scales||{};s[o]=is(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||sa(r,e),f=(tl[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=h4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),is(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];is(r,[zt.scales[r.type],zt.scale])}),s}function Eb(n){const e=n.options||(n.options={});e.plugins=ht(e.plugins,{}),e.scales=y4(n,e)}function Ab(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function k4(n){return n=n||{},n.data=Ab(n.data),Eb(n),n}const sc=new Map,Ib=new Set;function Qs(n,e){let t=sc.get(n);return t||(t=e(),sc.set(n,t),Ib.add(t)),t}const Jl=(n,e,t)=>{const i=Ol(e,t);i!==void 0&&n.add(i)};class v4{constructor(e){this._config=k4(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ab(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Eb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Qs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Qs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Qs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Qs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Jl(a,e,c))),f.forEach(c=>Jl(a,l,c)),f.forEach(c=>Jl(a,tl[s]||{},c)),f.forEach(c=>Jl(a,zt,c)),f.forEach(c=>Jl(a,la,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Ib.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,tl[t]||{},zt.datasets[t]||{},{type:t},zt,la]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=oc(this._resolverCache,e,l);let a=o;if(S4(o,t)){s.$shared=!1,i=Li(i)?i():i;const u=this.createResolver(e,i,r);a=Dl(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=oc(this._resolverCache,e,i);return it(t)?Dl(s,t,void 0,l):s}}function oc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Ua(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const w4=n=>it(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Li(n[t]),!1);function S4(n,e){const{isScriptable:t,isIndexable:i}=db(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Li(r)||w4(r))||o&&Ot(r))return!0}return!1}var T4="4.4.0";const $4=["top","bottom","left","right","chartArea"];function rc(n,e){return n==="top"||n==="bottom"||$4.indexOf(n)===-1&&e==="x"}function ac(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function uc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),qt(t&&t.onComplete,[n],e)}function C4(n){const e=n.chart,t=e.options.animation;qt(t&&t.onProgress,[n],e)}function Lb(n){return _b()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ho={},fc=n=>{const e=Lb(n);return Object.values(ho).filter(t=>t.canvas===e).pop()};function M4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function O4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}function xs(n,e,t){return n.options.clip?n[t]:e[t]}function D4(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:xs(t,e,"left"),right:xs(t,e,"right"),top:xs(i,e,"top"),bottom:xs(i,e,"bottom")}:e}class ci{static register(...e){xn.add(...e),cc()}static unregister(...e){xn.remove(...e),cc()}constructor(e,t){const i=this.config=new v4(t),l=Lb(e),s=fc(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Y3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=E2(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new f4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=K2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],ho[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ai.listen(this,"complete",uc),ai.listen(this,"progress",C4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return yt(e)?t&&s?s:l?i/l:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():If(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Of(this.canvas,this.ctx),this}stop(){return ai.stop(this),this}resize(e,t){ai.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,If(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),qt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};gt(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=oa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),gt(s,o=>{const r=o.options,a=r.id,u=oa(a,r),f=ht(r.type,o.dtype);(r.position===void 0||rc(r.position,u)!==rc(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=xn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),gt(l,(o,r)=>{o||delete i[r]}),gt(i,o=>{Zs.configure(this,o,o.options),Zs.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;lt.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(ac("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){gt(this.scales,e=>{Zs.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!bf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;M4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;ss.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Zs.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],gt(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,l=!i.disabled,s=D4(e,this.chartArea),o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(l&&Va(t,{left:i.left===!1?0:s.left-i.left,right:i.right===!1?this.width:s.right+i.right,top:i.top===!1?0:s.top-i.top,bottom:i.bottom===!1?this.height:s.bottom+i.bottom}),e.controller.draw(),l&&Ba(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return Oi(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=$3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(l)),l}getContext(){return this.$context||(this.$context=Fi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);hs(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),ai.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};gt(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){gt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},gt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Do(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=N2(e),u=O4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,qt(s.onHover,[e,r,this],this),a&&qt(s.onClick,[e,r,this],this));const f=!Do(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ue(ci,"defaults",zt),Ue(ci,"instances",ho),Ue(ci,"overrides",tl),Ue(ci,"registry",xn),Ue(ci,"version",T4),Ue(ci,"getChart",fc);function cc(){return gt(ci.instances,n=>n._plugins.invalidate())}function Pb(n,e,t=e){n.lineCap=ht(t.borderCapStyle,e.borderCapStyle),n.setLineDash(ht(t.borderDash,e.borderDash)),n.lineDashOffset=ht(t.borderDashOffset,e.borderDashOffset),n.lineJoin=ht(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=ht(t.borderWidth,e.borderWidth),n.strokeStyle=ht(t.borderColor,e.borderColor)}function E4(n,e,t){n.lineTo(t.x,t.y)}function A4(n){return n.stepped?ow:n.tension||n.cubicInterpolationMode==="monotone"?rw:E4}function Fb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=lr&&s>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%s,$=()=>{h!==_&&(n.lineTo(f,_),n.lineTo(f,h),n.lineTo(f,k))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const T=m.x,C=m.y,D=T|0;D===g?(C_&&(_=C),f=(c*f+T)/++c):($(),n.lineTo(T,C),g=D,c=0,h=_=C),k=C}$()}function ra(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?L4:I4}function P4(n){return n.stepped?jw:n.tension||n.cubicInterpolationMode==="monotone"?Hw:Ji}function F4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),Pb(n,e.options),n.stroke(l)}function N4(n,e,t,i){const{segments:l,options:s}=e,o=ra(e);for(const r of l)Pb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const R4=typeof Path2D=="function";function q4(n,e,t,i){R4&&!e.options.segment?F4(n,e,t,i):N4(n,e,t,i)}class Gi extends Is{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const l=i.spanGaps?this._loop:this._fullLoop;Aw(this._points,i,e,l,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Jw(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,l=e[t],s=this.points,o=kb(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=P4(i);let u,f;for(u=0,f=o.length;ue!=="borderDash"&&e!=="fill"});function Nb(n,e){const{x:t,y:i,base:l,width:s,height:o}=n.getProps(["x","y","base","width","height"],e);let r,a,u,f,c;return n.horizontal?(c=o/2,r=Math.min(t,l),a=Math.max(t,l),u=i-c,f=i+c):(c=s/2,r=t-c,a=t+c,u=Math.min(i,l),f=Math.max(i,l)),{left:r,top:u,right:a,bottom:f}}function Di(n,e,t,i){return n?0:Kn(e,t,i)}function j4(n,e,t){const i=n.options.borderWidth,l=n.borderSkipped,s=cb(i);return{t:Di(l.top,s.top,0,t),r:Di(l.right,s.right,0,e),b:Di(l.bottom,s.bottom,0,t),l:Di(l.left,s.left,0,e)}}function H4(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),l=n.options.borderRadius,s=wl(l),o=Math.min(e,t),r=n.borderSkipped,a=i||it(l);return{topLeft:Di(!a||r.top||r.left,s.topLeft,0,o),topRight:Di(!a||r.top||r.right,s.topRight,0,o),bottomLeft:Di(!a||r.bottom||r.left,s.bottomLeft,0,o),bottomRight:Di(!a||r.bottom||r.right,s.bottomRight,0,o)}}function z4(n){const e=Nb(n),t=e.right-e.left,i=e.bottom-e.top,l=j4(n,t/2,i/2),s=H4(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:s},inner:{x:e.left+l.l,y:e.top+l.t,w:t-l.l-l.r,h:i-l.t-l.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(l.t,l.l)),topRight:Math.max(0,s.topRight-Math.max(l.t,l.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(l.b,l.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(l.b,l.r))}}}}function Mr(n,e,t,i){const l=e===null,s=t===null,r=n&&!(l&&s)&&Nb(n,i);return r&&(l||Lo(e,r.left,r.right))&&(s||Lo(t,r.top,r.bottom))}function V4(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function B4(n,e){n.rect(e.x,e.y,e.w,e.h)}function Or(n,e,t={}){const i=n.x!==t.x?-e:0,l=n.y!==t.y?-e:0,s=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-l;return{x:n.x+i,y:n.y+l,w:n.w+s,h:n.h+o,radius:n.radius}}class go extends Is{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:l}}=this,{inner:s,outer:o}=z4(this),r=V4(o.radius)?No:B4;e.save(),(o.w!==s.w||o.h!==s.h)&&(e.beginPath(),r(e,Or(o,t,s)),e.clip(),r(e,Or(s,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,Or(s,t)),e.fillStyle=l,e.fill(),e.restore()}inRange(e,t,i){return Mr(this,e,t,i)}inXRange(e,t){return Mr(this,e,null,t)}inYRange(e,t){return Mr(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:l,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(t+l)/2:t,y:s?i:(i+l)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Ue(go,"id","bar"),Ue(go,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ue(go,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function U4(n,e,t){const i=n.segments,l=n.points,s=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Za(a,u,l);const f=aa(t,l[a],l[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:l[a],end:l[u]});continue}const c=kb(e,f);for(const d of c){const m=aa(t,s[d.start],s[d.end],d.loop),g=yb(r,l,m);for(const h of g)o.push({source:h,target:d,start:{[t]:dc(f,m,"start",Math.max)},end:{[t]:dc(f,m,"end",Math.min)}})}}return o}function aa(n,e,t,i){if(i)return;let l=e[n],s=t[n];return n==="angle"&&(l=Sn(l),s=Sn(s)),{property:n,start:l,end:s}}function W4(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{r=Za(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Za(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function dc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Rb(n,e){let t=[],i=!1;return Ot(n)?(i=!0,t=n):t=W4(n,e),t.length?new Gi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function pc(n){return n&&n.fill!==!1}function Y4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!jt(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function K4(n,e,t){const i=X4(n);if(it(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return jt(l)&&Math.floor(l)===l?J4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function J4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function Z4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:it(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function G4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:it(n)?i=n.value:i=e.getBaseValue(),i}function X4(n){const e=n.options,t=e.fill;let i=ht(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Q4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=x4(e,t);r.push(Rb({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&Dr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;pc(s)&&Dr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!pc(i)||t.drawTime!=="beforeDatasetDraw"||Dr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const es={average(n){if(!n.length)return!1;let e,t,i=0,l=0,s=0;for(e=0,t=n.length;e-1?n.split(` +`):n}function fS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function _c(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Cn(e.bodyFont),u=Cn(e.titleFont),f=Cn(e.footerFont),c=s.length,d=l.length,m=i.length,g=Hn(e.padding);let h=g.height,_=0,k=i.reduce((T,C)=>T+C.before.length+C.lines.length+C.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,gt(n.title,$),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,$),gt(T.lines,$),gt(T.after,$)}),S=0,t.font=f.string,gt(n.footer,$),t.restore(),_+=g.width,{width:_,height:h}}function cS(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function dS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function pS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),dS(u,n,e,t)&&(u="center"),u}function bc(n,e,t){const i=t.yAlign||e.yAlign||cS(n,t);return{xAlign:t.xAlign||e.xAlign||pS(n,e,t,i),yAlign:i}}function mS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function hS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function yc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=wl(o);let g=mS(e,r);const h=hS(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+l:r==="right"&&(g+=Math.max(c,m)+l),{x:Kn(g,0,i.width-e.width),y:Kn(h,0,i.height-e.height)}}function eo(n,e,t){const i=Hn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function kc(n){return Qn([],ui(n))}function gS(n,e,t){return Fi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function vc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const jb={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex"u"?jb[e].call(t,i):l}class ua extends Is{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),l=i.enabled&&t.options.animation&&i.animations,s=new vb(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=gS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=dn(i,"beforeTitle",this,e),s=dn(i,"title",this,e),o=dn(i,"afterTitle",this,e);let r=[];return r=Qn(r,ui(l)),r=Qn(r,ui(s)),r=Qn(r,ui(o)),r}getBeforeBody(e,t){return kc(dn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return gt(e,s=>{const o={before:[],lines:[],after:[]},r=vc(i,s);Qn(o.before,ui(dn(r,"beforeLabel",this,s))),Qn(o.lines,dn(r,"label",this,s)),Qn(o.after,ui(dn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return kc(dn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=dn(i,"beforeFooter",this,e),s=dn(i,"footer",this,e),o=dn(i,"afterFooter",this,e);let r=[];return r=Qn(r,ui(l)),r=Qn(r,ui(s)),r=Qn(r,ui(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),gt(r,f=>{const c=vc(e.callbacks,f);l.push(dn(c,"labelColor",this,f)),s.push(dn(c,"labelPointStyle",this,f)),o.push(dn(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=es[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=_c(this,i),u=Object.assign({},r,a),f=bc(this.chart,i,u),c=yc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=wl(r),{x:d,y:m}=e,{width:g,height:h}=t;let _,k,S,$,T,C;return s==="center"?(T=m+h/2,l==="left"?(_=d,k=_-o,$=T+o,C=T-o):(_=d+g,k=_+o,$=T-o,C=T+o),S=_):(l==="left"?k=d+Math.max(a,f)+o:l==="right"?k=d+g-Math.max(u,c)-o:k=this.caretX,s==="top"?($=m,T=$-o,_=k-o,S=k+o):($=m+h,T=$+o,_=k+o,S=k-o),C=$),{x1:_,x2:k,x3:S,y1:$,y2:T,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=kr(i.rtl,this.x,this.width);for(e.x=eo(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Cn(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aS!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,No(e,{x:h,y:g,w:u,h:a,radius:k}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),No(e,{x:_,y:g+1,w:u-2,h:a-2,radius:k}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(h,g,u,a),e.strokeRect(h,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(_,g+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=Cn(i.bodyFont);let d=c.lineHeight,m=0;const g=kr(i.rtl,this.x,this.width),h=function(E){t.fillText(E,g.x(e.x+m),e.y+d/2),e.y+=d+s},_=g.textAlign(o);let k,S,$,T,C,D,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=eo(this,_,i),t.fillStyle=i.bodyColor,gt(this.beforeBody,h),m=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,D=l.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=es[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=_c(this,e),a=Object.assign({},o,this._size),u=bc(t,e,a),f=yc(e,a,u,t);(l._to!==f.x||s._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Hn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(s,e,l,t),Bw(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Uw(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),s=!Do(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Do(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t;const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=es[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ue(ua,"positioners",es);var _S={id:"tooltip",_element:ua,positioners:es,afterInit(n,e,t){t&&(n.tooltip=new ua({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:jb},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const bS=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function yS(n,e,t,i){const l=n.indexOf(e);if(l===-1)return bS(n,e,t,i);const s=n.lastIndexOf(e);return l!==s?t:l}const kS=(n,e)=>n===null?null:Kn(Math.round(n),0,e);function wc(n){const e=this.getLabels();return n>=0&&nt.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}Ue(fa,"id","category"),Ue(fa,"defaults",{ticks:{callback:wc}});function vS(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,g=f-1,{min:h,max:_}=e,k=!yt(o),S=!yt(r),$=!yt(u),T=(_-h)/(c+1);let C=kf((_-h)/g/m)*m,D,O,E,L;if(C<1e-14&&!k&&!S)return[{value:h},{value:_}];L=Math.ceil(_/C)-Math.floor(h/C),L>g&&(C=kf(L*C/g/m)*m),yt(a)||(D=Math.pow(10,a),C=Math.ceil(C*D)/D),l==="ticks"?(O=Math.floor(h/C)*C,E=Math.ceil(_/C)*C):(O=h,E=_),k&&S&&s&&H2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,f)),C=(r-o)/L,O=o,E=r):$?(O=k?o:O,E=S?r:E,L=u-1,C=(E-O)/L):(L=(E-O)/C,ls(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(vf(C),vf(O));D=Math.pow(10,yt(a)?R:a),O=Math.round(O*D)/D,E=Math.round(E*D)/D;let P=0;for(k&&(d&&O!==o?(t.push({value:o}),Or)break;t.push({value:F})}return S&&d&&E!==r?t.length&&ls(t[t.length-1].value,r,Sc(r,T,n))?t[t.length-1].value=r:t.push({value:r}):(!S||E===r)&&t.push({value:E}),t}function Sc(n,e,{horizontal:t,minRotation:i}){const l=Mi(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class jo extends ol{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return yt(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=ti(l),u=ti(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,o=vS(l,s);return e.bounds==="ticks"&&ib(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return za(e,this.chart.options.locale,this.options.ticks.format)}}class ca extends jo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=jt(e)?e:0,this.max=jt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Mi(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ue(ca,"id","linear"),Ue(ca,"defaults",{ticks:{callback:er.formatters.numeric}});const _s=n=>Math.floor(Ci(n)),Ui=(n,e)=>Math.pow(10,_s(n)+e);function Tc(n){return n/Math.pow(10,_s(n))===1}function $c(n,e,t){const i=Math.pow(10,t),l=Math.floor(n/i);return Math.ceil(e/i)-l}function wS(n,e){const t=e-n;let i=_s(t);for(;$c(n,e,i)>10;)i++;for(;$c(n,e,i)<10;)i--;return Math.min(i,_s(n))}function SS(n,{min:e,max:t}){e=vn(n.min,e);const i=[],l=_s(e);let s=wS(e,t),o=s<0?Math.pow(10,Math.abs(s)):1;const r=Math.pow(10,s),a=l>s?Math.pow(10,l):0,u=Math.round((e-a)*o)/o,f=Math.floor((e-a)/r/10)*r*10;let c=Math.floor((u-f)/Math.pow(10,s)),d=vn(n.min,Math.round((a+f+c*Math.pow(10,s))*o)/o);for(;d=10?c=c<15?15:20:c++,c>=20&&(s++,c=2,o=s>=0?1:o),d=Math.round((a+f+c*Math.pow(10,s))*o)/o;const m=vn(n.max,d);return i.push({value:m,major:Tc(m),significand:c}),i}class Cc extends ol{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=jo.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return jt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=jt(e)?Math.max(0,e):null,this.max=jt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!jt(this._userMin)&&(this.min=e===Ui(this.min,0)?Ui(this.min,-1):Ui(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,l=this.max;const s=r=>i=e?i:r,o=r=>l=t?l:r;i===l&&(i<=0?(s(1),o(10)):(s(Ui(i,-1)),o(Ui(l,1)))),i<=0&&s(Ui(l,-1)),l<=0&&o(Ui(i,1)),this.min=i,this.max=l}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=SS(t,this);return e.bounds==="ticks"&&ib(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":za(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Ci(e),this._valueRange=Ci(this.max)-Ci(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ci(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}Ue(Cc,"id","logarithmic"),Ue(Cc,"defaults",{ticks:{callback:er.formatters.logarithmic,major:{enabled:!0}}});function da(n){const e=n.ticks;if(e.display&&n.display){const t=Hn(e.backdropPadding);return ht(e.font&&e.font.size,zt.font.size)+t.height}return 0}function TS(n,e,t){return t=Ot(t)?t:[t],{w:lw(n,e.string,t),h:t.length*e.lineHeight}}function Mc(n,e,t,i,l){return n===i||n===l?{start:e-t/2,end:e+t/2}:nl?{start:e-t,end:e}:{start:e,end:e+t}}function $S(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],l=[],s=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?xt/s:0;for(let a=0;ae.r&&(r=(i.end-e.r)/s,n.r=Math.max(n.r,e.r+r)),l.starte.b&&(a=(l.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function MS(n,e,t){const i=n.drawingArea,{extra:l,additionalAngle:s,padding:o,size:r}=t,a=n.getPointPosition(e,i+l+o,s),u=Math.round(qa(Sn(a.angle+$n))),f=IS(a.y,r.h,u),c=ES(u),d=AS(a.x,r.w,c);return{visible:!0,x:a.x,y:f,textAlign:c,left:d,top:f,right:d+r.w,bottom:f+r.h}}function OS(n,e){if(!e)return!0;const{left:t,top:i,right:l,bottom:s}=n;return!(Oi({x:t,y:i},e)||Oi({x:t,y:s},e)||Oi({x:l,y:i},e)||Oi({x:l,y:s},e))}function DS(n,e,t){const i=[],l=n._pointLabels.length,s=n.options,{centerPointLabels:o,display:r}=s.pointLabels,a={extra:da(s)/2,additionalAngle:o?xt/l:0};let u;for(let f=0;f270||t<90)&&(n-=e),n}function LS(n,e,t){const{left:i,top:l,right:s,bottom:o}=t,{backdropColor:r}=e;if(!yt(r)){const a=wl(e.borderRadius),u=Hn(e.backdropPadding);n.fillStyle=r;const f=i-u.left,c=l-u.top,d=s-i+u.width,m=o-l+u.height;Object.values(a).some(g=>g!==0)?(n.beginPath(),No(n,{x:f,y:c,w:d,h:m,radius:a}),n.fill()):n.fillRect(f,c,d,m)}}function PS(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let l=e-1;l>=0;l--){const s=n._pointLabelItems[l];if(!s.visible)continue;const o=i.setContext(n.getPointLabelContext(l));LS(t,o,s);const r=Cn(o.font),{x:a,y:u,textAlign:f}=s;Fo(t,n._pointLabels[l],a,u+r.lineHeight/2,r,{color:o.color,textAlign:f,textBaseline:"middle"})}}function Hb(n,e,t,i){const{ctx:l}=n;if(t)l.arc(n.xCenter,n.yCenter,e,0,On);else{let s=n.getPointPosition(0,e);l.moveTo(s.x,s.y);for(let o=1;o{const l=qt(this.options.pointLabels.callback,[t,i],this);return l||l===0?l:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?$S(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,l){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-l)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,l))}getIndexAngle(e){const t=On/(this._pointLabels.length||1),i=this.options.startAngle||0;return Sn(e*t+Mi(i))}getDistanceFromCenterForValue(e){if(yt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(yt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(c!==0){a=this.getDistanceFromCenterForValue(f.value);const d=this.getContext(c),m=l.setContext(d),g=s.setContext(d);FS(this,m,a,o,g)}}),i.display){for(e.save(),r=o-1;r>=0;r--){const f=i.setContext(this.getPointLabelContext(r)),{color:c,lineWidth:d}=f;!d||!c||(e.lineWidth=d,e.strokeStyle=c,e.setLineDash(f.borderDash),e.lineDashOffset=f.borderDashOffset,a=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),u=this.getPointPosition(r,a),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(u.x,u.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const l=this.getIndexAngle(0);let s,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(l),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=Cn(u.font);if(s=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Hn(u.backdropPadding);e.fillRect(-o/2-c.left,-s-f.size/2-c.top,o+c.width,f.size+c.height)}Fo(e,r.label,0,-s,f,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),e.restore()}drawTitle(){}}Ue(to,"id","radialLinear"),Ue(to,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:er.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),Ue(to,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ue(to,"descriptors",{angleLines:{_fallback:"grid"}});const nr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},hn=Object.keys(nr);function Oc(n,e){return n-e}function Dc(n,e){if(yt(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),jt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(Io(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function Ec(n,e,t,i){const l=hn.length;for(let s=hn.indexOf(n);s=hn.indexOf(t);s--){const o=hn[s];if(nr[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return hn[t?hn.indexOf(t):0]}function qS(n){for(let e=hn.indexOf(n)+1,t=hn.length;e=e?t[i]:t[l];n[s]=!0}}function jS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Ic(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Kn(t,0,o),i=Kn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,l=this.options,s=l.time,o=s.unit||Ec(s.minUnit,t,i,this._getLabelCapacity(t)),r=ht(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=Io(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const g=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d+h)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return qt(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=ia(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=ia(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Lc extends bs{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=no(t,this.min),this._tableRange=no(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;ol-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(no(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return no(this._table,i*this._tableRange+this._minPos,!0)}}Ue(Lc,"id","timeseries"),Ue(Lc,"defaults",bs.defaults);/*! + * chartjs-adapter-luxon v1.3.1 + * https://www.chartjs.org + * (c) 2023 chartjs-adapter-luxon Contributors + * Released under the MIT license + */const HS={datetime:He.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:He.TIME_WITH_SECONDS,minute:He.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Tb._date.override({_id:"luxon",_create:function(n){return He.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return HS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=He.fromFormat(n,e,t):n=He.fromISO(n,t):n instanceof Date?n=He.fromJSDate(n,t):i==="object"&&!(n instanceof He)&&(n=He.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Pc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,Yt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function zS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c=n[2]&&Pc();return{c(){e=b("div"),t=b("div"),i=Y("Found "),l=Y(n[1]),s=M(),r=Y(o),a=M(),c&&c.c(),u=M(),f=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),y(e,t),y(t,i),y(t,l),y(t,s),y(t,r),y(e,a),c&&c.m(e,null),y(e,u),y(e,f),n[8](f)},p(d,[m]){m&2&&se(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&se(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&A(c,1):(c=Pc(),c.c(),A(c,1),c.m(e,u)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),m&4&&x(e,"loading",d[2])},i(d){A(c)},o(d){I(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function VS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),ue.logs.getStats({filter:[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&")}).then(m=>{c();for(let g of m)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total)}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),ue.error(m,(m==null?void 0:m.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(7,r=[]),t(1,a=0)}Vt(()=>(ci.register(po,go,fa,ca,bs,uS,_S),t(6,o=new ci(s,{type:"bar",data:{datasets:[{label:"Total requests",data:r,backgroundColor:"#e34562",maxBarThickness:40,borderRadius:2,minBarLength:7,hoverBackgroundColor:"#e34562"}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var g;return(g=m.tick)!=null&&g.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var g;return(g=m.tick)!=null&&g.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,u,i,l,f,o,r,d]}class BS extends be{constructor(e){super(),_e(this,e,VS,zS,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Fc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function US(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var zb={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */var t=function(i){var l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(C){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==S)return $[T]}return null}},isActive:function(S,$,T){for(var C="no-"+$;S;){var D=S.classList;if(D.contains($))return!0;if(D.contains(C))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var T=r.util.clone(r.languages[S]);for(var C in $)T[C]=$[C];return T},insertBefore:function(S,$,T,C){C=C||r.languages;var D=C[S],O={};for(var E in D)if(D.hasOwnProperty(E)){if(E==$)for(var L in T)T.hasOwnProperty(L)&&(O[L]=T[L]);T.hasOwnProperty(E)||(O[E]=D[E])}var R=C[S];return C[S]=O,r.languages.DFS(r.languages,function(P,F){F===R&&P!=S&&(this[P]=O)}),O},DFS:function S($,T,C,D){D=D||{};var O=r.util.objId;for(var E in $)if($.hasOwnProperty(E)){T.call($,E,$[E],C||E);var L=$[E],R=r.util.type(L);R==="Object"&&!D[O(L)]?(D[O(L)]=!0,S(L,T,null,D)):R==="Array"&&!D[O(L)]&&(D[O(L)]=!0,S(L,T,E,D))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,T){var C={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var D=0,O;O=C.elements[D++];)r.highlightElement(O,$===!0,C.callback)},highlightElement:function(S,$,T){var C=r.util.getLanguage(S),D=r.languages[C];r.util.setLanguage(S,C);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,C);var E=S.textContent,L={element:S,language:C,grammar:D,code:E};function R(F){L.highlightedCode=F,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),T&&T.call(L.element)}if(r.hooks.run("before-sanity-check",L),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),T&&T.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){R(r.util.encode(L.code));return}if($&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(F){R(F.data)},P.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else R(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,$,T){var C={code:S,grammar:$,language:T};if(r.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),a.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(S,$){var T=$.rest;if(T){for(var C in T)$[C]=T[C];delete $.rest}var D=new c;return d(D,D.head,S),f(S,D,$,D.head,0),g(D)},hooks:{all:{},add:function(S,$){var T=r.hooks.all;T[S]=T[S]||[],T[S].push($)},run:function(S,$){var T=r.hooks.all[S];if(!(!T||!T.length))for(var C=0,D;D=T[C++];)D($)}},Token:a};i.Prism=r;function a(S,$,T,C){this.type=S,this.content=$,this.alias=T,this.length=(C||"").length|0}a.stringify=function S($,T){if(typeof $=="string")return $;if(Array.isArray($)){var C="";return $.forEach(function(R){C+=S(R,T)}),C}var D={type:$.type,content:S($.content,T),tag:"span",classes:["token",$.type],attributes:{},language:T},O=$.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(D.classes,O):D.classes.push(O)),r.hooks.run("wrap",D);var E="";for(var L in D.attributes)E+=" "+L+'="'+(D.attributes[L]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+E+">"+D.content+""};function u(S,$,T,C){S.lastIndex=$;var D=S.exec(T);if(D&&C&&D[1]){var O=D[1].length;D.index+=O,D[0]=D[0].slice(O)}return D}function f(S,$,T,C,D,O){for(var E in T)if(!(!T.hasOwnProperty(E)||!T[E])){var L=T[E];L=Array.isArray(L)?L:[L];for(var R=0;R=O.reach);U+=H.value.length,H=H.next){var le=H.value;if($.length>S.length)return;if(!(le instanceof a)){var ee=1,oe;if(q){if(oe=u(J,U,S,N),!oe||oe.index>=S.length)break;var Qe=oe.index,Te=oe.index+oe[0].length,je=U;for(je+=H.value.length;Qe>=je;)H=H.next,je+=H.value.length;if(je-=H.value.length,U=je,H.value instanceof a)continue;for(var Ve=H;Ve!==$.tail&&(jeO.reach&&(O.reach=Pt);var Ce=H.prev;Ge&&(Ce=d($,Ce,Ge),U+=Ge.length),m($,Ce,ee);var De=new a(E,F?r.tokenize(tt,F):tt,W,tt);if(H=d($,Ce,De),Mt&&d($,H,Mt),ee>1){var ze={cause:E+","+R,reach:Pt};f(S,$,T,H.prev,U,ze),O&&ze.reach>O.reach&&(O.reach=ze.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},$={value:null,prev:S,next:null};S.next=$,this.head=S,this.tail=$,this.length=0}function d(S,$,T){var C=$.next,D={value:T,prev:$,next:C};return $.next=D,C.prev=D,S.length++,D}function m(S,$,T){for(var C=$.next,D=0;D/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(l,s){var o={};o["language-"+s]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var a={};a[l]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,l){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[l,"language-"+l],inside:t.languages[l]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var l=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+l.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var s=i.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",l=function(h,_){return"✖ Error "+h+" while fetching file: "+_},s="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(h,_,k){var S=new XMLHttpRequest;S.open("GET",h,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?_(S.responseText):S.status>=400?k(l(S.status,S.statusText)):k(s))},S.send(null)}function m(h){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h||"");if(_){var k=Number(_[1]),S=_[2],$=_[3];return S?$?[k,Number($)]:[k,void 0]:[k,k]}}t.hooks.add("before-highlightall",function(h){h.selector+=", "+c}),t.hooks.add("before-sanity-check",function(h){var _=h.element;if(_.matches(c)){h.code="",_.setAttribute(r,a);var k=_.appendChild(document.createElement("CODE"));k.textContent=i;var S=_.getAttribute("data-src"),$=h.language;if($==="none"){var T=(/\.(\w+)$/.exec(S)||[,"none"])[1];$=o[T]||T}t.util.setLanguage(k,$),t.util.setLanguage(_,$);var C=t.plugins.autoloader;C&&C.loadLanguages($),d(S,function(D){_.setAttribute(r,u);var O=m(_.getAttribute("data-range"));if(O){var E=D.split(/\r\n?|\n/g),L=O[0],R=O[1]==null?E.length:O[1];L<0&&(L+=E.length),L=Math.max(0,Math.min(L-1,E.length)),R<0&&(R+=E.length),R=Math.max(0,Math.min(R,E.length)),D=E.slice(L,R).join(` +`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(L+1))}k.textContent=D,t.highlightElement(k)},function(D){_.setAttribute(r,f),k.textContent=D})}}),t.plugins.fileHighlight={highlight:function(_){for(var k=(_||document).querySelectorAll(c),S=0,$;$=k[S++];)t.highlightElement($)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(zb);var WS=zb.exports;const Zl=US(WS);var YS={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function l(o){for(var r=0,a=0;ar&&(f[d]=` +`+f[d],c=m)}a[u]=f.join("")}return a.join(` +`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in s)if(Object.hasOwnProperty.call(s,u)){var f=s[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",g="",h=!1,_=0;_>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function KS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(l,s){w(l,e,s),y(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function JS(n,e,t){let{class:i=""}=e,{content:l=""}=e,{language:s="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zl.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zl.highlight(a,Zl.languages[s]||Zl.languages.javascript,s)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,l=a.content),"language"in a&&t(3,s=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zl<"u"&&l&&t(1,o=r(l))},[i,o,l,s]}class Vb extends be{constructor(e){super(),_e(this,e,JS,KS,me,{class:0,content:2,language:3})}}const ZS=n=>({}),Nc=n=>({}),GS=n=>({}),Rc=n=>({});function qc(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$=n[4]&&!n[2]&&jc(n);const T=n[19].header,C=vt(T,n,n[18],Rc);let D=n[4]&&n[2]&&Hc(n);const O=n[19].default,E=vt(O,n,n[18],null),L=n[19].footer,R=vt(L,n,n[18],Nc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),$&&$.c(),r=M(),C&&C.c(),a=M(),D&&D.c(),u=M(),f=b("div"),E&&E.c(),c=M(),d=b("div"),R&&R.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(P,F){w(P,e,F),y(e,t),y(e,l),y(e,s),y(s,o),$&&$.m(o,null),y(o,r),C&&C.m(o,null),y(o,a),D&&D.m(o,null),y(s,u),y(s,f),E&&E.m(f,null),n[21](f),y(s,c),y(s,d),R&&R.m(d,null),_=!0,k||(S=[K(t,"click",Ye(n[20])),K(f,"scroll",n[22])],k=!0)},p(P,F){n=P,n[4]&&!n[2]?$?($.p(n,F),F[0]&20&&A($,1)):($=jc(n),$.c(),A($,1),$.m(o,r)):$&&(re(),I($,1,1,()=>{$=null}),ae()),C&&C.p&&(!_||F[0]&262144)&&St(C,T,n,n[18],_?wt(T,n[18],F,GS):Tt(n[18]),Rc),n[4]&&n[2]?D?D.p(n,F):(D=Hc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),E&&E.p&&(!_||F[0]&262144)&&St(E,O,n,n[18],_?wt(O,n[18],F,null):Tt(n[18]),null),R&&R.p&&(!_||F[0]&262144)&&St(R,L,n,n[18],_?wt(L,n[18],F,ZS):Tt(n[18]),Nc),(!_||F[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!_||F[0]&262)&&x(s,"popup",n[2]),(!_||F[0]&4)&&x(e,"padded",n[2]),(!_||F[0]&1)&&x(e,"active",n[0])},i(P){_||(P&&Ke(()=>{_&&(i||(i=Le(t,ds,{duration:Si,opacity:0},!0)),i.run(1))}),A($),A(C,P),A(E,P),A(R,P),P&&Ke(()=>{_&&(h&&h.end(1),g=j_(s,jn,n[2]?{duration:Si,y:-10}:{duration:Si,x:50}),g.start())}),_=!0)},o(P){P&&(i||(i=Le(t,ds,{duration:Si,opacity:0},!1)),i.run(0)),I($),I(C,P),I(E,P),I(R,P),g&&g.invalidate(),P&&(h=ya(s,jn,n[2]?{duration:Si,y:10}:{duration:Si,x:50})),_=!1},d(P){P&&v(e),P&&i&&i.end(),$&&$.d(),C&&C.d(P),D&&D.d(),E&&E.d(P),n[21](null),R&&R.d(P),P&&h&&h.end(),k=!1,we(S)}}}function jc(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",Ye(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,ds,{duration:Si},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,ds,{duration:Si},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Hc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function XS(n){let e,t,i,l,s=n[0]&&qc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&A(s,1)):(s=qc(o),s.c(),A(s,1),s.m(e,null)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){t||(A(s),t=!0)},o(o){I(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,we(l)}}}let Wi,Er=[];function Bb(){return Wi=Wi||document.querySelector(".overlays"),Wi||(Wi=document.createElement("div"),Wi.classList.add("overlays"),document.body.appendChild(Wi)),Wi}let Si=150;function zc(){return 1e3+Bb().querySelectorAll(".overlay-panel-container.active").length}function QS(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=rt(),g="op_"+j.randomString(10);let h,_,k,S,$="",T=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function D(){typeof d=="function"&&d()===!1||t(0,o=!1)}function O(){return o}async function E(U){t(17,T=U),U?(k=document.activeElement,m("show"),h==null||h.focus()):(clearTimeout(S),m("hide"),k==null||k.focus()),await Qt(),L()}function L(){h&&(o?t(6,h.style.zIndex=zc(),h):t(6,h.style="",h))}function R(){j.pushUnique(Er,g),document.body.classList.add("overlay-active")}function P(){j.removeByValue(Er,g),Er.length||document.body.classList.remove("overlay-active")}function F(U){o&&f&&U.code=="Escape"&&!j.isInput(U.target)&&h&&h.style.zIndex==zc()&&(U.preventDefault(),D())}function N(U){o&&q(_)}function q(U,le){le&&t(8,$=""),!(!U||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!U)return;if(U.scrollHeight-U.offsetHeight>0)t(8,$="scrollable");else{t(8,$="");return}U.scrollTop==0?t(8,$+=" scroll-top-reached"):U.scrollTop+U.offsetHeight==U.scrollHeight&&t(8,$+=" scroll-bottom-reached")},100))}Vt(()=>(Bb().appendChild(h),()=>{var U;clearTimeout(S),P(),(U=h==null?void 0:h.classList)==null||U.add("hidden"),setTimeout(()=>{h==null||h.remove()},0)}));const W=()=>a?D():!0;function G(U){te[U?"unshift":"push"](()=>{_=U,t(7,_)})}const J=U=>q(U.target);function H(U){te[U?"unshift":"push"](()=>{h=U,t(6,h)})}return n.$$set=U=>{"class"in U&&t(1,s=U.class),"active"in U&&t(0,o=U.active),"popup"in U&&t(2,r=U.popup),"overlayClose"in U&&t(3,a=U.overlayClose),"btnClose"in U&&t(4,u=U.btnClose),"escClose"in U&&t(12,f=U.escClose),"beforeOpen"in U&&t(13,c=U.beforeOpen),"beforeHide"in U&&t(14,d=U.beforeHide),"$$scope"in U&&t(18,l=U.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&E(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&h&&L(),n.$$.dirty[0]&1&&(o?R():P())},[o,s,r,a,u,D,h,_,$,F,N,q,f,c,d,C,O,T,l,i,W,G,J,H]}class Xt extends be{constructor(e){super(),_e(this,e,QS,XS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function xS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),l||(s=[ve(i=Fe.call(null,e,n[2]?"":"Copy")),K(e,"click",fn(n[3]))],l=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&$t(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function eT(n,e,t){let{value:i=""}=e,{idleClasses:l="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:s="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Vt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,l=u.idleClasses),"successClasses"in u&&t(1,s=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[l,s,r,a,i,o]}class rl extends be{constructor(e){super(),_e(this,e,eT,xS,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function Vc(n,e,t){const i=n.slice();i[13]=e[t];const l=i[1].data[i[13]];return i[14]=l,i}function Bc(n){let e,t,i,l;function s(a,u){return a[1].message?nT:tT}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),r.m(l,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function tT(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function nT(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&se(i,t)},d(l){l&&v(e)}}}function iT(n){let e,t=n[14]+"",i,l=n[13]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=Y(t),s=Y(l),p(e,"class","txt")},m(o,r){w(o,e,r),y(e,i),y(e,s)},p(o,r){r&2&&t!==(t=o[14]+"")&&se(i,t),r&2&&l!==(l=o[13]=="execTime"?"ms":"")&&se(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function lT(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function sT(n){let e,t;return e=new Vb({props:{content:JSON.stringify(n[14],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[14],null,2)),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Uc(n){let e,t,i,l=n[13]+"",s,o,r,a,u,f,c,d;const m=[sT,lT,iT],g=[];function h(_,k){return k&2&&(a=null),_[14]!==null&&typeof _[14]=="object"?0:(a==null&&(a=!!j.isEmpty(_[14])),a?1:2)}return u=h(n,-1),f=g[u]=m[u](n),{c(){e=b("tr"),t=b("td"),i=Y("data."),s=Y(l),o=M(),r=b("td"),f.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[3])},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,s),y(e,o),y(e,r),g[u].m(r,null),y(e,c),d=!0},p(_,k){(!d||k&2)&&l!==(l=_[13]+"")&&se(s,l),(!d||k&8)&&x(t,"v-align-top",_[3]);let S=u;u=h(_,k),u===S?g[u].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),f=g[u],f?f.p(_,k):(f=g[u]=m[u](_),f.c()),A(f,1),f.m(r,null))},i(_){d||(A(f),d=!0)},o(_){I(f),d=!1},d(_){_&&v(e),g[u].d()}}}function oT(n){var G;let e,t,i,l,s,o,r,a,u,f,c=n[1].id+"",d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;a=new rl({props:{value:n[1].id}}),S=new X1({props:{level:n[1].level}}),E=new Q1({props:{date:n[1].created}});let F=((G=n[1].data)==null?void 0:G.type)!="request"&&Bc(n),N=pe(n[4](n[1].data)),q=[];for(let J=0;JI(q[J],1,1,()=>{q[J]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),u=M(),f=b("div"),d=Y(c),m=M(),g=b("tr"),h=b("td"),h.textContent="level",_=M(),k=b("td"),B(S.$$.fragment),$=M(),T=b("tr"),C=b("td"),C.textContent="created",D=M(),O=b("td"),B(E.$$.fragment),L=M(),F&&F.c(),R=M();for(let J=0;JClose',t=M(),i=b("button"),i.innerHTML=' Download as JSON',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-primary")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[7]),K(i,"click",n[8])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function uT(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[aT],header:[rT],default:[oT]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[9](e),e.$on("hide",n[10]),e.$on("show",n[11]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&131082&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[9](null),V(e,l)}}}function fT(n,e,t){let i,l,s={};function o(_){if(!j.isEmpty(_))return t(1,s=_),l==null?void 0:l.show()}function r(){return l==null?void 0:l.hide()}const a=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","error","details"];function u(_){if(!_)return[];let k=[];for(let $ of a)typeof _[$]<"u"&&k.push($);const S=Object.keys(_);for(let $ of S)k.includes($)||k.push($);return k}function f(){j.downloadJson(s,"log_"+s.created.replaceAll(/[-:\. ]/gi,"")+".json")}const c=()=>r(),d=()=>f();function m(_){te[_?"unshift":"push"](()=>{l=_,t(2,l)})}function g(_){Ee.call(this,n,_)}function h(_){Ee.call(this,n,_)}return n.$$.update=()=>{n.$$.dirty&2&&t(3,i=!j.isEmpty(s.data))},[r,s,l,i,u,f,o,c,d,m,g,h]}class cT extends be{constructor(e){super(),_e(this,e,fT,uT,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function dT(n,e,t){const i=n.slice();return i[1]=e[t],i}function pT(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function mT(n){let e,t,i,l=pe(Y1),s=[];for(let o=0;o{"class"in l&&t(0,i=l.class)},[i]}class Ub extends be{constructor(e){super(),_e(this,e,hT,mT,me,{class:0})}}function gT(n){let e,t,i,l,s,o,r,a,u;return t=new he({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[bT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),l=new he({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[yT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[kT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(f,c){w(f,e,c),z(t,e,null),y(e,i),z(l,e,null),y(e,s),z(o,e,null),r=!0,a||(u=K(e,"submit",Ye(n[7])),a=!0)},p(f,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:f}),l.$set(m);const g={};c&12582914&&(g.$$scope={dirty:c,ctx:f}),o.$set(g)},i(f){r||(A(t.$$.fragment,f),A(l.$$.fragment,f),A(o.$$.fragment,f),r=!0)},o(f){I(t.$$.fragment,f),I(l.$$.fragment,f),I(o.$$.fragment,f),r=!1},d(f){f&&v(e),V(t),V(l),V(o),a=!1,u()}}}function _T(n){let e;return{c(){e=b("div"),e.innerHTML='
',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function bT(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to 0 to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&ut(s.value)!==c[1].logs.maxDays&&ce(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function yT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Ub({}),{c(){e=b("label"),t=Y("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=M(),B(f.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(g,h){w(g,e,h),y(e,t),w(g,l,h),w(g,s,h),ce(s,n[1].logs.minLevel),w(g,o,h),w(g,r,h),y(r,a),y(r,u),z(f,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(g,h){(!c||h&4194304&&i!==(i=g[22]))&&p(e,"for",i),h&2&&ut(s.value)!==g[1].logs.minLevel&&ce(s,g[1].logs.minLevel)},i(g){c||(A(f.$$.fragment,g),c=!0)},o(g){I(f.$$.fragment,g),c=!1},d(g){g&&(v(e),v(l),v(s),v(o),v(r)),V(f),d=!1,m()}}}function kT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIp,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIp),f&4194304&&o!==(o=u[22])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function vT(n){let e,t,i,l;const s=[_T,gT],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function wT(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ST(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function TT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[ST],header:[wT],default:[vT]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}function $T(n,e,t){let i,l;const s=rt(),o="logs_settings_"+j.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return g(),h(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function g(){Gt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function h(){t(4,u=!0);try{const L=await ue.settings.getAll()||{};k(L)}catch(L){ue.error(L)}t(4,u=!1)}async function _(){if(l){t(3,a=!0);try{const L=await ue.settings.update(j.filterRedactedProps(c));k(L),t(3,a=!1),m(),It("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),ue.error(L)}}}function k(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=ut(this.value),t(1,c)}function $(){c.logs.minLevel=ut(this.value),t(1,c)}function T(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function D(L){te[L?"unshift":"push"](()=>{r=L,t(2,r)})}function O(L){Ee.call(this,n,L)}function E(L){Ee.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,_,d,f,i,S,$,T,C,D,O,E]}class CT extends be{constructor(e){super(),_e(this,e,$T,TT,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function MT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1]),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Wc(n){let e,t;return e=new BS({props:{filter:n[0],presets:n[5]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.filter=i[0]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Yc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[0]!==void 0&&(s.filter=n[0]),e=new r2({props:s}),te.push(()=>ge(e,"filter",l)),e.$on("select",n[14]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&1&&(t=!0,a.filter=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function OT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T=n[4],C,D=n[4],O,E,L,R;u=new Qo({}),u.$on("refresh",n[10]),g=new he({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[MT,({uniqueId:N})=>({20:N}),({uniqueId:N})=>N?1048576:0]},$$scope:{ctx:n}}}),_=new Ds({props:{value:n[0],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),_.$on("submit",n[12]),S=new Ub({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let P=Wc(n),F=Yc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=Y(n[6]),o=M(),r=b("button"),r.innerHTML='',a=M(),B(u.$$.fragment),f=M(),c=b("div"),d=M(),m=b("div"),B(g.$$.fragment),h=M(),B(_.$$.fragment),k=M(),B(S.$$.fragment),$=M(),P.c(),C=M(),F.c(),O=ke(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(N,q){w(N,e,q),y(e,t),y(t,i),y(i,l),y(l,s),y(t,o),y(t,r),y(t,a),z(u,t,null),y(t,f),y(t,c),y(t,d),y(t,m),z(g,m,null),y(e,h),z(_,e,null),y(e,k),z(S,e,null),y(e,$),P.m(e,null),w(N,C,q),F.m(N,q),w(N,O,q),E=!0,L||(R=[ve(Fe.call(null,r,{text:"Logs settings",position:"right"})),K(r,"click",n[9])],L=!0)},p(N,q){(!E||q&64)&&se(s,N[6]);const W={};q&3145730&&(W.$$scope={dirty:q,ctx:N}),g.$set(W);const G={};q&1&&(G.value=N[0]),_.$set(G),q&16&&me(T,T=N[4])?(re(),I(P,1,1,Q),ae(),P=Wc(N),P.c(),A(P,1),P.m(e,null)):P.p(N,q),q&16&&me(D,D=N[4])?(re(),I(F,1,1,Q),ae(),F=Yc(N),F.c(),A(F,1),F.m(O.parentNode,O)):F.p(N,q)},i(N){E||(A(u.$$.fragment,N),A(g.$$.fragment,N),A(_.$$.fragment,N),A(S.$$.fragment,N),A(P),A(F),E=!0)},o(N){I(u.$$.fragment,N),I(g.$$.fragment,N),I(_.$$.fragment,N),I(S.$$.fragment,N),I(P),I(F),E=!1},d(N){N&&(v(e),v(C),v(O)),V(u),V(g),V(_),V(S),P.d(N),F.d(N),L=!1,we(R)}}}function DT(n){let e,t,i,l,s,o;e=new _n({props:{$$slots:{default:[OT]},$$scope:{ctx:n}}});let r={};i=new cT({props:r}),n[15](i);let a={};return s=new CT({props:a}),n[16](s),s.$on("save",n[7]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(u,f){z(e,u,f),w(u,t,f),z(i,u,f),w(u,l,f),z(s,u,f),o=!0},p(u,[f]){const c={};f&2097279&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(A(e.$$.fragment,u),A(i.$$.fragment,u),A(s.$$.fragment,u),o=!0)},o(u){I(e.$$.fragment,u),I(i.$$.fragment,u),I(s.$$.fragment,u),o=!1},d(u){u&&(v(t),v(l)),V(e,u),n[15](null),V(i,u),n[16](null),V(s,u)}}}const Kc="adminRequests",Jc="adminLogRequests";function ET(n,e,t){var O;let i,l,s;We(n,Uo,E=>t(17,l=E)),We(n,Et,E=>t(6,s=E)),tn(Et,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c=(o.get(Kc)||((O=window.localStorage)==null?void 0:O.getItem(Jc)))<<0,d=c;function m(){t(4,u++,u)}function g(E={}){let L={};L.filter=f||null,L[Kc]=c<<0||null,j.replaceHashQueryParams(Object.assign(L,E))}const h=()=>a==null?void 0:a.show(),_=()=>m();function k(){c=this.checked,t(1,c)}const S=E=>t(0,f=E.detail);function $(E){f=E,t(0,f)}const T=E=>r==null?void 0:r.show(E==null?void 0:E.detail);function C(E){te[E?"unshift":"push"](()=>{r=E,t(2,r)})}function D(E){te[E?"unshift":"push"](()=>{a=E,t(3,a)})}return n.$$.update=()=>{var E;n.$$.dirty&2&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&258&&d!=c&&(t(8,d=c),(E=window.localStorage)==null||E.setItem(Jc,c<<0),g()),n.$$.dirty&1&&typeof f<"u"&&g()},[f,c,r,a,u,i,s,m,d,h,_,k,S,$,T,C,D]}class AT extends be{constructor(e){super(),_e(this,e,ET,DT,me,{})}}function IT(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-1g2t3dj"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[K(e,"mousedown",n[5]),K(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,we(i)}}}function LT(n,e,t){const i=rt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-s.offsetLeft,u=_.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(_){let k=_.clientX-o,S=_.clientY-r,$=_.clientX-a,T=_.clientY-u;!f&&Math.abs($-s.offsetLeft){s=_,t(0,s)})}const h=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,l=_.tolerance)},[s,f,c,l,g,h]}class PT extends be{constructor(e){super(),_e(this,e,LT,IT,me,{tolerance:3})}}function FT(n){let e,t,i,l,s;const o=n[5].default,r=vt(o,n,n[4],null);return l=new PT({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),B(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),z(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&St(r,o,a,a[4],s?wt(o,a[4],u,null):Tt(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(A(r,a),A(l.$$.fragment,a),s=!0)},o(a){I(r,a),I(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),V(l,a)}}}const Zc="@adminSidebarWidth";function NT(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Zc)||null;function u(m){te[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Zc,a))},[s,o,a,r,l,i,u,f,c,d]}class Wb extends be{constructor(e){super(),_e(this,e,NT,FT,me,{class:0})}}const Ga=Dn({});function an(n,e,t){Ga.set({text:n,yesCallback:e,noCallback:t})}function Yb(){Ga.set({})}function Gc(n){let e,t,i;const l=n[17].default,s=vt(l,n,n[16],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[18](e),i=!0},p(o,r){s&&s.p&&(!i||r&65536)&&St(s,l,o,o[16],i?wt(l,o[16],r,null):Tt(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&x(e,"active",o[0])},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Le(e,jn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Le(e,jn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[18](null),o&&t&&t.end()}}}function RT(n){let e,t,i,l,s=n[0]&&Gc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),t=!0,i||(l=[K(window,"mousedown",n[5]),K(window,"click",n[6]),K(window,"keydown",n[4]),K(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?s?(s.p(o,r),r&1&&A(s,1)):(s=Gc(o),s.c(),A(s,1),s.m(e,null)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){t||(A(s),t=!0)},o(o){I(s),t=!1},d(o){o&&v(e),s&&s.d(),n[19](null),i=!1,we(l)}}}function qT(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,g,h=!1;const _=rt();function k(){t(0,o=!1),h=!1,clearTimeout(g)}function S(){t(0,o=!0),clearTimeout(g),g=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function $(){o?k():S()}function T(W){return!c||W.classList.contains(u)||(m==null?void 0:m.contains(W))&&!c.contains(W)||c.contains(W)&&W.closest&&W.closest("."+u)}function C(W){(!o||T(W.target))&&(W.preventDefault(),W.stopPropagation(),$())}function D(W){(W.code==="Enter"||W.code==="Space")&&(!o||T(W.target))&&(W.preventDefault(),W.stopPropagation(),$())}function O(W){o&&r&&W.code==="Escape"&&(W.preventDefault(),k())}function E(W){o&&!(c!=null&&c.contains(W.target))?h=!0:h&&(h=!1)}function L(W){var G;o&&h&&!(c!=null&&c.contains(W.target))&&!(m!=null&&m.contains(W.target))&&!((G=W.target)!=null&&G.closest(".flatpickr-calendar"))&&k()}function R(W){E(W),L(W)}function P(W){F(),c==null||c.addEventListener("click",C),t(15,m=W||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",C),m==null||m.addEventListener("keydown",D)}function F(){clearTimeout(g),c==null||c.removeEventListener("click",C),m==null||m.removeEventListener("click",C),m==null||m.removeEventListener("keydown",D)}Vt(()=>(P(),()=>F()));function N(W){te[W?"unshift":"push"](()=>{d=W,t(3,d)})}function q(W){te[W?"unshift":"push"](()=>{c=W,t(2,c)})}return n.$$set=W=>{"trigger"in W&&t(8,s=W.trigger),"active"in W&&t(0,o=W.active),"escClose"in W&&t(9,r=W.escClose),"autoScroll"in W&&t(10,a=W.autoScroll),"closableClass"in W&&t(11,u=W.closableClass),"class"in W&&t(1,f=W.class),"$$scope"in W&&t(16,l=W.$$scope)},n.$$.update=()=>{var W,G;n.$$.dirty&260&&c&&P(s),n.$$.dirty&32769&&(o?((W=m==null?void 0:m.classList)==null||W.add("active"),_("show")):((G=m==null?void 0:m.classList)==null||G.remove("active"),_("hide")))},[o,f,c,d,O,E,L,R,s,r,a,u,k,S,$,m,l,i,N,q]}class En extends be{constructor(e){super(),_e(this,e,qT,RT,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function Xc(n,e,t){const i=n.slice();return i[27]=e[t],i}function jT(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=M(),s=b("label"),o=Y("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){w(f,e,c),w(f,l,c),w(f,s,c),y(s,o),a||(u=K(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function HT(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>ge(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}o?(e=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],ye(()=>t=!1)),e.$set(c)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function zT(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function VT(n){let e,t,i,l;const s=[zT,HT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Qc(n){let e,t,i,l=pe(n[10]),s=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new he({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[VT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Qc(n);return{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),r&&r.c(),s=ke()},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),r&&r.m(a,u),w(a,s,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Qc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),V(e,a),V(i,a),r&&r.d(a)}}}function UT(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" index")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&se(i,t)},d(s){s&&v(e)}}}function ed(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[ve(Fe.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function WT(n){let e,t,i,l,s,o,r=n[5]!=""&&ed(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='Cancel',i=M(),l=b("button"),l.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),s||(o=[K(t,"click",n[17]),K(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=ed(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,we(o)}}}function YT(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[WT],header:[UT],default:[BT]},$$scope:{ctx:n}};for(let s=0;sH.name==W);J?j.removeByValue(G.columns,J):j.pushUnique(G.columns,{name:W}),t(2,d=j.buildIndex(G))}Vt(async()=>{t(8,h=!0);try{t(7,g=(await st(()=>import("./CodeEditor-c4a370cf.js"),["./CodeEditor-c4a370cf.js","./index-102ce751.js"],import.meta.url)).default)}catch(W){console.warn(W)}t(8,h=!1)});const D=()=>$(),O=()=>k(),E=()=>T(),L=W=>{t(3,l.unique=W.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=j.buildIndex(l))};function R(W){d=W,t(2,d)}const P=W=>C(W);function F(W){te[W?"unshift":"push"](()=>{f=W,t(4,f)})}function N(W){Ee.call(this,n,W)}function q(W){Ee.call(this,n,W)}return n.$$set=W=>{e=Pe(Pe({},e),Kt(W)),t(14,r=Ze(e,o)),"collection"in W&&t(0,u=W.collection)},n.$$.update=()=>{var W,G,J;n.$$.dirty[0]&1&&t(10,i=(((G=(W=u==null?void 0:u.schema)==null?void 0:W.filter(H=>!H.toDelete))==null?void 0:G.map(H=>H.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((J=l.columns)==null?void 0:J.map(H=>H.name))||[])},[u,k,d,l,f,c,m,g,h,s,i,$,T,C,r,_,D,O,E,L,R,P,F,N,q]}class JT extends be{constructor(e){super(),_e(this,e,KT,YT,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function td(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function nd(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function id(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(ld).join(", "))+"",s,o,r,a,u,f=n[11].unique&&nd();function c(){return n[4](n[10],n[13])}return{c(){var m,g;e=b("button"),f&&f.c(),t=M(),i=b("span"),s=Y(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((g=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&g.message?"label-danger":"")+" svelte-167lbwu")},m(m,g){var h,_;w(m,e,g),f&&f.m(e,null),y(e,t),y(e,i),y(i,s),a||(u=[ve(r=Fe.call(null,e,((_=(h=n[2].indexes)==null?void 0:h[n[13]])==null?void 0:_.message)||"")),K(e,"click",c)],a=!0)},p(m,g){var h,_,k,S,$;n=m,n[11].unique?f||(f=nd(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),g&1&&l!==(l=((h=n[11].columns)==null?void 0:h.map(ld).join(", "))+"")&&se(s,l),g&4&&o!==(o="label link-primary "+((k=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&k.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&$t(r.update)&&g&4&&r.update.call(null,(($=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:$.message)||"")},d(m){m&&v(e),f&&f.d(),a=!1,we(u)}}}function ZT(n){var T,C,D;let e,t,i=(((C=(T=n[0])==null?void 0:T.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,u,f,c,d,m,g,h,_=pe(((D=n[0])==null?void 0:D.indexes)||[]),k=[];for(let O=0;O<_.length;O+=1)k[O]=id(td(n,_,O));function S(O){n[7](O)}let $={};return n[0]!==void 0&&($.collection=n[0]),c=new JT({props:$}),n[6](c),te.push(()=>ge(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=Y("Unique constraints and indexes ("),l=Y(i),s=Y(")"),o=M(),r=b("div");for(let O=0;O+ New index',f=M(),B(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(O,E){w(O,e,E),y(e,t),y(e,l),y(e,s),w(O,o,E),w(O,r,E);for(let L=0;Ld=!1)),c.$set(L)},i(O){m||(A(c.$$.fragment,O),m=!0)},o(O){I(c.$$.fragment,O),m=!1},d(O){O&&(v(e),v(o),v(r),v(f)),at(k,O),n[6](null),V(c,O),g=!1,h()}}}const ld=n=>n.name;function GT(n,e,t){let i;We(n,gi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,g){for(let h=0;hs==null?void 0:s.show(m,g),a=()=>s==null?void 0:s.show();function u(m){te[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let g=0;g{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class XT extends be{constructor(e){super(),_e(this,e,GT,ZT,me,{collection:0})}}function sd(n,e,t){const i=n.slice();return i[6]=e[t],i}function od(n){let e,t,i,l,s,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[6].label}`,s=M(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),y(e,t),y(e,i),y(e,l),y(e,s),o||(r=[K(e,"click",fn(a)),K(e,"keydown",fn(u))],o=!0)},p(f,c){n=f},d(f){f&&v(e),o=!1,we(r)}}}function QT(n){let e,t=pe(n[2]),i=[];for(let l=0;l{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,l,s,o,r,a]}class t$ extends be{constructor(e){super(),_e(this,e,e$,xT,me,{class:0})}}const n$=n=>({interactive:n&64,hasErrors:n&32}),rd=n=>({interactive:n[6],hasErrors:n[5]}),i$=n=>({interactive:n&64,hasErrors:n&32}),ad=n=>({interactive:n[6],hasErrors:n[5]}),l$=n=>({interactive:n&64,hasErrors:n&32}),ud=n=>({interactive:n[6],hasErrors:n[5]});function fd(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function cd(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=Y(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),y(e,t),y(t,i)},p(l,s){s&16&&se(i,l[4])},d(l){l&&v(e)}}}function s$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[0].required&&cd(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,p(o,"placeholder","Field name"),o.value=f=n[0].name},m(g,h){m&&m.m(g,h),w(g,e,h),w(g,t,h),y(t,i),w(g,s,h),w(g,o,h),n[14](o),n[0].id||o.focus(),c||(d=K(o,"input",n[15]),c=!0)},p(g,h){g[0].required?m?m.p(g,h):(m=cd(g),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),h&1&&l!==(l=j.getFieldTypeIcon(g[0].type))&&p(i,"class",l),h&64&&x(t,"txt-disabled",!g[6]),h&64&&r!==(r=!g[6])&&(o.disabled=r),h&1&&a!==(a=g[0].id&&g[0].system)&&(o.readOnly=a),h&1&&u!==(u=!g[0].id)&&(o.autofocus=u),h&1&&f!==(f=g[0].name)&&o.value!==f&&(o.value=f)},d(g){g&&(v(e),v(t),v(s),v(o)),m&&m.d(g),n[14](null),c=!1,d()}}}function o$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function r$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),y(e,t),l||(s=K(e,"click",n[11]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function a$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[ve(Fe.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function dd(n){let e,t,i,l,s,o,r,a,u,f,c;const d=n[13].options,m=vt(d,n,n[18],ad);s=new he({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[u$,({uniqueId:k})=>({24:k}),({uniqueId:k})=>k?16777216:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[f$,({uniqueId:k})=>({24:k}),({uniqueId:k})=>k?16777216:0]},$$scope:{ctx:n}}});const g=n[13].optionsFooter,h=vt(g,n,n[18],rd);let _=!n[0].toDelete&&pd(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),B(r.$$.fragment),a=M(),h&&h.c(),u=M(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(k,S){w(k,e,S),y(e,t),m&&m.m(t,null),y(e,i),y(e,l),z(s,l,null),y(l,o),z(r,l,null),y(l,a),h&&h.m(l,null),y(l,u),_&&_.m(l,null),c=!0},p(k,S){m&&m.p&&(!c||S&262240)&&St(m,d,k,k[18],c?wt(d,k[18],S,i$):Tt(k[18]),ad);const $={};S&17039377&&($.$$scope={dirty:S,ctx:k}),s.$set($);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:k}),r.$set(T),h&&h.p&&(!c||S&262240)&&St(h,g,k,k[18],c?wt(g,k[18],S,n$):Tt(k[18]),rd),k[0].toDelete?_&&(re(),I(_,1,1,()=>{_=null}),ae()):_?(_.p(k,S),S&1&&A(_,1)):(_=pd(k),_.c(),A(_,1),_.m(l,null))},i(k){c||(A(m,k),A(s.$$.fragment,k),A(r.$$.fragment,k),A(h,k),A(_),k&&Ke(()=>{c&&(f||(f=Le(e,et,{duration:150},!0)),f.run(1))}),c=!0)},o(k){I(m,k),I(s.$$.fragment,k),I(r.$$.fragment,k),I(h,k),I(_),k&&(f||(f=Le(e,et,{duration:150},!1)),f.run(0)),c=!1},d(k){k&&v(e),m&&m.d(k),V(s),V(r),h&&h.d(k),_&&_.d(),k&&f&&f.end()}}}function u$(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=Y(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[24])},m(m,g){w(m,e,g),e.checked=n[0].required,w(m,i,g),w(m,l,g),y(l,s),y(s,o),y(l,r),y(l,a),c||(d=[K(e,"change",n[16]),ve(u=Fe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,g){g&16777216&&t!==(t=m[24])&&p(e,"id",t),g&1&&(e.checked=m[0].required),g&16&&se(o,m[4]),u&&$t(u.update)&&g&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),g&16777216&&f!==(f=m[24])&&p(l,"for",f)},d(m){m&&(v(e),v(i),v(l)),c=!1,we(d)}}}function f$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[17]),ve(Fe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],u=!0)},p(c,d){d&16777216&&t!==(t=c[24])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&16777216&&a!==(a=c[24])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function pd(n){let e,t,i,l,s,o,r,a,u;return a=new En({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[c$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=M(),l=b("div"),s=b("button"),o=b("i"),r=M(),B(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(s,"type","button"),p(s,"aria-label","More"),p(s,"class","btn btn-circle btn-sm btn-transparent"),p(l,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(f,c){w(f,e,c),y(e,t),y(e,i),y(e,l),y(l,s),y(s,o),y(s,r),z(a,s,null),u=!0},p(f,c){const d={};c&262144&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){I(a.$$.fragment,f),u=!1},d(f){f&&v(e),V(a)}}}function c$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function d$(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&fd();l=new he({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[s$]},$$scope:{ctx:n}}});const c=n[13].default,d=vt(c,n,n[18],ud),m=d||o$();function g(S,$){if(S[0].toDelete)return a$;if(S[6])return r$}let h=g(n),_=h&&h(n),k=n[6]&&n[3]&&dd(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=M(),B(l.$$.fragment),s=M(),m&&m.c(),o=M(),_&&_.c(),r=M(),k&&k.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,$){w(S,e,$),y(e,t),f&&f.m(t,null),y(t,i),z(l,t,null),y(t,s),m&&m.m(t,null),y(t,o),_&&_.m(t,null),y(e,r),k&&k.m(e,null),u=!0},p(S,[$]){S[6]?f||(f=fd(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};$&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),$&2&&(T.name="schema."+S[1]+".name"),$&262229&&(T.$$scope={dirty:$,ctx:S}),l.$set(T),d&&d.p&&(!u||$&262240)&&St(d,c,S,S[18],u?wt(c,S[18],$,l$):Tt(S[18]),ud),h===(h=g(S))&&_?_.p(S,$):(_&&_.d(1),_=h&&h(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?k?(k.p(S,$),$&72&&A(k,1)):(k=dd(S),k.c(),A(k,1),k.m(e,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae()),(!u||$&1)&&x(e,"required",S[0].required),(!u||$&72)&&x(e,"expanded",S[6]&&S[3]),(!u||$&1)&&x(e,"deleted",S[0].toDelete)},i(S){u||(A(l.$$.fragment,S),A(m,S),A(k),S&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(S){I(l.$$.fragment,S),I(m,S),I(k),S&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&v(e),f&&f.d(),V(l),m&&m.d(S),_&&_.d(),k&&k.d(),S&&a&&a.end()}}}let Ar=[];function p$(n,e,t){let i,l,s,o;We(n,gi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=rt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,g,h=!1;function _(){m.id?t(0,m.toDelete=!0,m):f("remove")}function k(){t(0,m.toDelete=!1,m),Gt({})}function S(P){return j.slugify(P)}function $(){t(3,h=!0),D()}function T(){t(3,h=!1)}function C(){h?T():$()}function D(){for(let P of Ar)P.id!=u&&P.collapse()}Vt(()=>(Ar.push({id:u,collapse:T}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),g==null||g.select()),()=>{j.removeByKey(Ar,"id",u)}));function O(P){te[P?"unshift":"push"](()=>{g=P,t(2,g)})}const E=P=>{const F=m.name;t(0,m.name=S(P.target.value),m),P.target.value=m.name,f("rename",{oldName:F,newName:m.name})};function L(){m.required=this.checked,t(0,m)}function R(){m.presentable=this.checked,t(0,m)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,m=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&4098&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,g,h,s,l,i,f,_,k,S,C,o,r,O,E,L,R,a]}class si extends be{constructor(e){super(),_e(this,e,p$,d$,me,{key:1,field:0})}}function m$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min length"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"step","1"),p(s,"min","0")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.min),r||(a=K(s,"input",n[3]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(s,"id",o),f&1&&ut(s.value)!==u[0].options.min&&ce(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function h$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max length"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[0].options.max),a||(u=K(s,"input",n[4]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(s,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.max&&ce(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function g$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","text"),p(s,"id",o=n[9]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.pattern),r||(a=K(s,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(s,"id",o),f&1&&s.value!==u[0].options.pattern&&ce(s,u[0].options.pattern)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function _$(n){let e,t,i,l,s,o,r,a,u,f;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[m$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[h$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[g$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),f=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&1537&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const h={};d&2&&(h.name="schema."+c[1]+".options.pattern"),d&1537&&(h.$$scope={dirty:d,ctx:c}),u.$set(h)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(o.$$.fragment,c),I(u.$$.fragment,c),f=!1},d(c){c&&v(e),V(i),V(o),V(u)}}}function b$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[_$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function y$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=ut(this.value),t(0,s)}function a(){s.options.max=ut(this.value),t(0,s)}function u(){s.options.pattern=this.value,t(0,s)}function f(m){s=m,t(0,s)}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(2,l=Ze(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class k$ extends be{constructor(e){super(),_e(this,e,y$,b$,me,{field:0,key:1})}}function v$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9])},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.min),r||(a=K(s,"input",n[4]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(s,"id",o),f&1&&ut(s.value)!==u[0].options.min&&ce(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function w$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","number"),p(s,"id",o=n[9]),p(s,"min",r=n[0].options.min)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[0].options.max),a||(u=K(s,"input",n[5]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(s,"id",o),c&1&&r!==(r=f[0].options.min)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.max&&ce(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function S$(n){let e,t,i,l,s,o,r;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[v$,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[w$,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function T$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[3]),ve(Fe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function $$(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[T$,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function C$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[$$],options:[S$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function M$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=ut(this.value),t(0,s)}function u(){s.options.max=ut(this.value),t(0,s)}function f(m){s=m,t(0,s)}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(2,l=Ze(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class O$ extends be{constructor(e){super(),_e(this,e,M$,C$,me,{field:0,key:1})}}function D$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function E$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ee.call(this,n,f)}function u(f){Ee.call(this,n,f)}return n.$$set=f=>{e=Pe(Pe({},e),Kt(f)),t(2,l=Ze(e,i)),"field"in f&&t(0,s=f.field),"key"in f&&t(1,o=f.key)},[s,o,l,r,a,u]}class A$ extends be{constructor(e){super(),_e(this,e,E$,D$,me,{field:0,key:1})}}function I$(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Pe(Pe({},e),Kt(c)),t(5,s=Ze(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class Nl extends be{constructor(e){super(),_e(this,e,L$,I$,me,{value:0,separator:1,readonly:2,disabled:3})}}function P$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[3](_)}let h={id:n[8],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(h.value=n[0].options.exceptDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[8]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`List of domains that are NOT allowed. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function F$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[4](_)}let h={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`List of domains that are ONLY allowed. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]+".options.onlyDomains"))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]+".options.onlyDomains"),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function N$(n){let e,t,i,l,s,o,r;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[P$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[F$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function R$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[N$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function q$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(d){n.$$.not_equal(s.options.exceptDomains,d)&&(s.options.exceptDomains=d,t(0,s))}function a(d){n.$$.not_equal(s.options.onlyDomains,d)&&(s.options.onlyDomains=d,t(0,s))}function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Pe(Pe({},e),Kt(d)),t(2,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,l,r,a,u,f,c]}class Kb extends be{constructor(e){super(),_e(this,e,q$,R$,me,{field:0,key:1})}}function j$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;rge(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function H$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ee.call(this,n,f)}function u(f){Ee.call(this,n,f)}return n.$$set=f=>{e=Pe(Pe({},e),Kt(f)),t(2,l=Ze(e,i)),"field"in f&&t(0,s=f.field),"key"in f&&t(1,o=f.key)},[s,o,l,r,a,u]}class z$ extends be{constructor(e){super(),_e(this,e,H$,j$,me,{field:0,key:1})}}function V$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[3]),ve(Fe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function B$(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[V$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&769&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[B$]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function W$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Pe(Pe({},e),Kt(d)),t(2,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,u,f,c]}class Y$ extends be{constructor(e){super(),_e(this,e,W$,U$,me,{field:0,key:1})}}var Ir=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Sl={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},ys={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Ln=function(n){return n===!0?1:0};function md(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Lr=function(n){return n instanceof Array?n:[n]};function rn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ct(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function io(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Jb(n,e){if(e(n))return n;if(n.parentNode)return Jb(n.parentNode,e)}function lo(n,e){var t=ct("div","numInputWrapper"),i=ct("input","numInput "+n),l=ct("span","arrowUp"),s=ct("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Pr=function(){},Ho=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},K$={D:Pr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Ln(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Pr,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Pr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Zi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},as={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[as.w(n,e,t)]},F:function(n,e,t){return Ho(as.n(n,e,t)-1,!1,e)},G:function(n,e,t){return pn(as.h(n,e,t))},H:function(n){return pn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Ln(n.getHours()>11)]},M:function(n,e){return Ho(n.getMonth(),!0,e)},S:function(n){return pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return pn(n.getFullYear(),4)},d:function(n){return pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return pn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},Zb=function(n){var e=n.config,t=e===void 0?Sl:e,i=n.l10n,l=i===void 0?ys:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return as[c]&&m[d-1]!=="\\"?as[c](r,f,t):c!=="\\"?c:""}).join("")}},pa=function(n){var e=n.config,t=e===void 0?Sl:e,i=n.l10n,l=i===void 0?ys:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||Sl).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var g=void 0,h=[],_=0,k=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ie=Nr(t.config);X.setHours(ie.hours,ie.minutes,ie.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}Z!==void 0&&Z.type!=="blur"&&oi(Z);var de=t._input.value;c(),en(),t._input.value!==de&&t._debouncedChange()}function u(Z,X){return Z%12+12*Ln(X===t.l10n.amPM[1])}function f(Z){switch(Z%24){case 0:case 12:return 12;default:return Z%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var Z=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(Z=u(Z,t.amPM.textContent));var de=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&kn(t.latestSelectedDateObj,t.config.minDate,!0)===0,$e=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&kn(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Ie=Fr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Je=Fr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Fr(Z,X,ie);if(qe>Je&&qe=12)]),t.secondElement!==void 0&&(t.secondElement.value=pn(ie)))}function g(Z){var X=yn(Z),ie=parseInt(X.value)+(Z.delta||0);(ie/1e3>1||Z.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&tt(ie)}function h(Z,X,ie,de){if(X instanceof Array)return X.forEach(function($e){return h(Z,$e,ie,de)});if(Z instanceof Array)return Z.forEach(function($e){return h($e,X,ie,de)});Z.addEventListener(X,ie,de),t._handlers.push({remove:function(){return Z.removeEventListener(X,ie,de)}})}function _(){bt("onChange")}function k(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(de){return h(de,"click",t[ie])})}),t.isMobile){fl();return}var Z=md(ze,50);if(t._debouncedChange=md(_,X$),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&h(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&De(yn(ie))}),h(t._input,"keydown",Ce),t.calendarContainer!==void 0&&h(t.calendarContainer,"keydown",Ce),!t.config.inline&&!t.config.static&&h(window,"resize",Z),window.ontouchstart!==void 0?h(window.document,"touchstart",Qe):h(window.document,"mousedown",Qe),h(window.document,"focus",Qe,{capture:!0}),t.config.clickOpens===!0&&(h(t._input,"focus",t.open),h(t._input,"click",t.open)),t.daysContainer!==void 0&&(h(t.monthNav,"click",Bn),h(t.monthNav,["keyup","increment"],g),h(t.daysContainer,"click",al)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ie){return yn(ie).select()};h(t.timeContainer,["increment"],a),h(t.timeContainer,"blur",a,{capture:!0}),h(t.timeContainer,"click",$),h([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&h(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&h(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&h(t._input,"blur",Pt)}function S(Z,X){var ie=Z!==void 0?t.parseDate(Z):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(Z);var $e=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!$e&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ie=ct("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ie,t.element),Ie.appendChild(t.element),t.altInput&&Ie.appendChild(t.altInput),Ie.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(Z,X,ie,de){var $e=Ge(X,!0),Ie=ct("span",Z,X.getDate().toString());return Ie.dateObj=X,Ie.$i=de,Ie.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),Z.indexOf("hidden")===-1&&kn(X,t.now)===0&&(t.todayDateElem=Ie,Ie.classList.add("today"),Ie.setAttribute("aria-current","date")),$e?(Ie.tabIndex=-1,Me(X)&&(Ie.classList.add("selected"),t.selectedDateElem=Ie,t.config.mode==="range"&&(rn(Ie,"startRange",t.selectedDates[0]&&kn(X,t.selectedDates[0],!0)===0),rn(Ie,"endRange",t.selectedDates[1]&&kn(X,t.selectedDates[1],!0)===0),Z==="nextMonthDay"&&Ie.classList.add("inRange")))):Ie.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(X)&&!Me(X)&&Ie.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&Z!=="prevMonthDay"&&de%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(X)+""),bt("onDayCreate",Ie),Ie}function O(Z){Z.focus(),t.config.mode==="range"&&De(Z)}function E(Z){for(var X=Z>0?0:t.config.showMonths-1,ie=Z>0?t.config.showMonths:-1,de=X;de!=ie;de+=Z)for(var $e=t.daysContainer.children[de],Ie=Z>0?0:$e.children.length-1,Je=Z>0?$e.children.length:-1,qe=Ie;qe!=Je;qe+=Z){var xe=$e.children[qe];if(xe.className.indexOf("hidden")===-1&&Ge(xe.dateObj))return xe}}function L(Z,X){for(var ie=Z.className.indexOf("Month")===-1?Z.dateObj.getMonth():t.currentMonth,de=X>0?t.config.showMonths:-1,$e=X>0?1:-1,Ie=ie-t.currentMonth;Ie!=de;Ie+=$e)for(var Je=t.daysContainer.children[Ie],qe=ie-t.currentMonth===Ie?Z.$i+X:X<0?Je.children.length-1:0,xe=Je.children.length,Re=qe;Re>=0&&Re0?xe:-1);Re+=$e){var Be=Je.children[Re];if(Be.className.indexOf("hidden")===-1&&Ge(Be.dateObj)&&Math.abs(Z.$i-Re)>=Math.abs(X))return O(Be)}t.changeMonth($e),R(E($e),0)}function R(Z,X){var ie=s(),de=Mt(ie||document.body),$e=Z!==void 0?Z:de?ie:t.selectedDateElem!==void 0&&Mt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Mt(t.todayDateElem)?t.todayDateElem:E(X>0?1:-1);$e===void 0?t._input.focus():de?L($e,X):O($e)}function P(Z,X){for(var ie=(new Date(Z,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,de=t.utils.getDaysInMonth((X-1+12)%12,Z),$e=t.utils.getDaysInMonth(X,Z),Ie=window.document.createDocumentFragment(),Je=t.config.showMonths>1,qe=Je?"prevMonthDay hidden":"prevMonthDay",xe=Je?"nextMonthDay hidden":"nextMonthDay",Re=de+1-ie,Be=0;Re<=de;Re++,Be++)Ie.appendChild(D("flatpickr-day "+qe,new Date(Z,X-1,Re),Re,Be));for(Re=1;Re<=$e;Re++,Be++)Ie.appendChild(D("flatpickr-day",new Date(Z,X,Re),Re,Be));for(var kt=$e+1;kt<=42-ie&&(t.config.showMonths===1||Be%7!==0);kt++,Be++)Ie.appendChild(D("flatpickr-day "+xe,new Date(Z,X+1,kt%$e),kt,Be));var Xn=ct("div","dayContainer");return Xn.appendChild(Ie),Xn}function F(){if(t.daysContainer!==void 0){io(t.daysContainer),t.weekNumbers&&io(t.weekNumbers);for(var Z=document.createDocumentFragment(),X=0;X1||t.config.monthSelectorType!=="dropdown")){var Z=function(de){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&det.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(Z(X)){var ie=ct("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,X).getMonth().toString(),ie.textContent=Ho(X,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===X&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function q(){var Z=ct("div","flatpickr-month"),X=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=ct("span","cur-month"):(t.monthsDropdownContainer=ct("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),h(t.monthsDropdownContainer,"change",function(Je){var qe=yn(Je),xe=parseInt(qe.value,10);t.changeMonth(xe-t.currentMonth),bt("onMonthChange")}),N(),ie=t.monthsDropdownContainer);var de=lo("cur-year",{tabindex:"-1"}),$e=de.getElementsByTagName("input")[0];$e.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&$e.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&($e.setAttribute("max",t.config.maxDate.getFullYear().toString()),$e.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ie=ct("div","flatpickr-current-month");return Ie.appendChild(ie),Ie.appendChild(de),X.appendChild(Ie),Z.appendChild(X),{container:Z,yearElement:$e,monthElement:ie}}function W(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var Z=t.config.showMonths;Z--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function G(){return t.monthNav=ct("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ct("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ct("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,W(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(Z){t.__hidePrevMonthArrow!==Z&&(rn(t.prevMonthNav,"flatpickr-disabled",Z),t.__hidePrevMonthArrow=Z)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(Z){t.__hideNextMonthArrow!==Z&&(rn(t.nextMonthNav,"flatpickr-disabled",Z),t.__hideNextMonthArrow=Z)}}),t.currentYearElement=t.yearElements[0],Jt(),t.monthNav}function J(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var Z=Nr(t.config);t.timeContainer=ct("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ct("span","flatpickr-time-separator",":"),ie=lo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var de=lo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=de.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?Z.hours:f(Z.hours)),t.minuteElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():Z.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ie),t.timeContainer.appendChild(X),t.timeContainer.appendChild(de),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var $e=lo("flatpickr-second");t.secondElement=$e.getElementsByTagName("input")[0],t.secondElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():Z.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ct("span","flatpickr-time-separator",":")),t.timeContainer.appendChild($e)}return t.config.time_24hr||(t.amPM=ct("span","flatpickr-am-pm",t.l10n.amPM[Ln((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function H(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=ct("div","flatpickr-weekdays");for(var Z=t.config.showMonths;Z--;){var X=ct("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return U(),t.weekdayContainer}function U(){if(t.weekdayContainer){var Z=t.l10n.firstDayOfWeek,X=hd(t.l10n.weekdays.shorthand);Z>0&&Z + `+X.join("")+` + + `}}function le(){t.calendarContainer.classList.add("hasWeeks");var Z=ct("div","flatpickr-weekwrapper");Z.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ct("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function ee(Z,X){X===void 0&&(X=!0);var ie=X?Z:Z-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,bt("onYearChange"),N()),F(),bt("onMonthChange"),Jt())}function oe(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Nr(t.config),de=ie.hours,$e=ie.minutes,Ie=ie.seconds;m(de,$e,Ie)}t.redraw(),Z&&bt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),bt("onClose")}function je(){t.config!==void 0&&bt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function Ve(Z){return t.calendarContainer.contains(Z)}function Qe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ie=Ve(X),de=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),$e=!de&&!ie&&!Ve(Z.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Je){return Je.contains(X)});$e&&Ie&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function tt(Z){if(!(!Z||t.config.minDate&&Zt.config.maxDate.getFullYear())){var X=Z,ie=t.currentYear!==X;t.currentYear=X||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),bt("onYearChange"),N())}}function Ge(Z,X){var ie;X===void 0&&(X=!0);var de=t.parseDate(Z,void 0,X);if(t.config.minDate&&de&&kn(de,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&de&&kn(de,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(de===void 0)return!1;for(var $e=!!t.config.enable,Ie=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,Je=0,qe=void 0;Je=qe.from.getTime()&&de.getTime()<=qe.to.getTime())return $e}return!$e}function Mt(Z){return t.daysContainer!==void 0?Z.className.indexOf("hidden")===-1&&Z.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(Z):!1}function Pt(Z){var X=Z.target===t._input,ie=t._input.value.trimEnd()!==nt();X&&ie&&!(Z.relatedTarget&&Ve(Z.relatedTarget))&&t.setDate(t._input.value,!0,Z.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ce(Z){var X=yn(Z),ie=t.config.wrap?n.contains(X):X===t._input,de=t.config.allowInput,$e=t.isOpen&&(!de||!ie),Ie=t.config.inline&&ie&&!de;if(Z.keyCode===13&&ie){if(de)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Ve(X)||$e||Ie){var Je=!!t.timeContainer&&t.timeContainer.contains(X);switch(Z.keyCode){case 13:Je?(Z.preventDefault(),a(),Ni()):al(Z);break;case 27:Z.preventDefault(),Ni();break;case 8:case 46:ie&&!t.config.allowInput&&(Z.preventDefault(),t.clear());break;case 37:case 39:if(!Je&&!ie){Z.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(de===!1||qe&&Mt(qe))){var xe=Z.keyCode===39?1:-1;Z.ctrlKey?(Z.stopPropagation(),ee(xe),R(E(1),0)):R(void 0,xe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:Z.preventDefault();var Re=Z.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?Z.ctrlKey?(Z.stopPropagation(),tt(t.currentYear-Re),R(E(1),0)):Je||R(void 0,Re*7):X===t.currentYearElement?tt(t.currentYear-Re):t.config.enableTime&&(!Je&&t.hourElement&&t.hourElement.focus(),a(Z),t._debouncedChange());break;case 9:if(Je){var Be=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(bn){return bn}),kt=Be.indexOf(X);if(kt!==-1){var Xn=Be[kt+(Z.shiftKey?-1:1)];Z.preventDefault(),(Xn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&Z.shiftKey&&(Z.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(Z.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),en();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),en();break}(ie||Ve(X))&&bt("onKeyDown",Z)}function De(Z,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||Z&&(!Z.classList.contains(X)||Z.classList.contains("flatpickr-disabled")))){for(var ie=Z?Z.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),de=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),$e=Math.min(ie,t.selectedDates[0].getTime()),Ie=Math.max(ie,t.selectedDates[0].getTime()),Je=!1,qe=0,xe=0,Re=$e;Re$e&&Reqe)?qe=Re:Re>de&&(!xe||Re ."+X));Be.forEach(function(kt){var Xn=kt.dateObj,bn=Xn.getTime(),ql=qe>0&&bn0&&bn>xe;if(ql){kt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(dl){kt.classList.remove(dl)});return}else if(Je&&!ql)return;["startRange","inRange","endRange","notAllowed"].forEach(function(dl){kt.classList.remove(dl)}),Z!==void 0&&(Z.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),deie&&bn===de&&kt.classList.add("endRange"),bn>=qe&&(xe===0||bn<=xe)&&J$(bn,de,ie)&&kt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&Bt()}function _t(Z,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(Z){Z.preventDefault();var ie=yn(Z);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),bt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var de=t.isOpen;t.isOpen=!0,de||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),bt("onOpen"),Bt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(Z===void 0||!t.timeContainer.contains(Z.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ne(Z){return function(X){var ie=t.config["_"+Z+"Date"]=t.parseDate(X,t.config.dateFormat),de=t.config["_"+(Z==="min"?"max":"min")+"Date"];ie!==void 0&&(t[Z==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function($e){return Ge($e)}),!t.selectedDates.length&&Z==="min"&&d(ie),en()),t.daysContainer&&(Vn(),ie!==void 0?t.currentYearElement[Z]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(Z),t.currentYearElement.disabled=!!de&&ie!==void 0&&de.getFullYear()===ie.getFullYear())}}function Ne(){var Z=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=sn(sn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Be){t.config._enable=Gn(Be)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Be){t.config._disable=Gn(Be)}});var de=X.mode==="time";if(!X.dateFormat&&(X.enableTime||de)){var $e=Wt.defaultConfig.dateFormat||Sl.dateFormat;ie.dateFormat=X.noCalendar||de?"H:i"+(X.enableSeconds?":S":""):$e+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||de)&&!X.altFormat){var Ie=Wt.defaultConfig.altFormat||Sl.altFormat;ie.altFormat=X.noCalendar||de?"h:i"+(X.enableSeconds?":S K":" K"):Ie+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ne("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ne("max")});var Je=function(Be){return function(kt){t.config[Be==="min"?"_minTime":"_maxTime"]=t.parseDate(kt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Je("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Je("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,X);for(var qe=0;qe-1?t.config[Re]=Lr(xe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=xe[Re])}X.altInputClass||(t.config.altInputClass=Se().className+" "+t.config.altInputClass),bt("onParseConfig")}function Se(){return t.config.wrap?n.querySelector("[data-input]"):n}function mt(){typeof t.config.locale!="object"&&typeof Wt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=sn(sn({},Wt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Wt.l10ns[t.config.locale]:void 0),Zi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Zi.l="("+t.l10n.weekdays.longhand.join("|")+")",Zi.M="("+t.l10n.months.shorthand.join("|")+")",Zi.F="("+t.l10n.months.longhand.join("|")+")",Zi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var Z=sn(sn({},e),JSON.parse(JSON.stringify(n.dataset||{})));Z.time_24hr===void 0&&Wt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Zb(t),t.parseDate=pa({config:t.config,l10n:t.l10n})}function Bt(Z){if(typeof t.config.position=="function")return void t.config.position(t,Z);if(t.calendarContainer!==void 0){bt("onPreCalendarPosition");var X=Z||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(c0,d0){return c0+d0.offsetHeight},0),de=t.calendarContainer.offsetWidth,$e=t.config.position.split(" "),Ie=$e[0],Je=$e.length>1?$e[1]:null,qe=X.getBoundingClientRect(),xe=window.innerHeight-qe.bottom,Re=Ie==="above"||Ie!=="below"&&xeie,Be=window.pageYOffset+qe.top+(Re?-ie-2:X.offsetHeight+2);if(rn(t.calendarContainer,"arrowTop",!Re),rn(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var kt=window.pageXOffset+qe.left,Xn=!1,bn=!1;Je==="center"?(kt-=(de-qe.width)/2,Xn=!0):Je==="right"&&(kt-=de-qe.width,bn=!0),rn(t.calendarContainer,"arrowLeft",!Xn&&!bn),rn(t.calendarContainer,"arrowCenter",Xn),rn(t.calendarContainer,"arrowRight",bn);var ql=window.document.body.offsetWidth-(window.pageXOffset+qe.right),dl=kt+de>window.document.body.offsetWidth,l0=ql+de>window.document.body.offsetWidth;if(rn(t.calendarContainer,"rightMost",dl),!t.config.static)if(t.calendarContainer.style.top=Be+"px",!dl)t.calendarContainer.style.left=kt+"px",t.calendarContainer.style.right="auto";else if(!l0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=ql+"px";else{var lr=cn();if(lr===void 0)return;var s0=window.document.body.offsetWidth,o0=Math.max(0,s0/2-de/2),r0=".flatpickr-calendar.centerMost:before",a0=".flatpickr-calendar.centerMost:after",u0=lr.cssRules.length,f0="{left:"+qe.left+"px;right:auto;}";rn(t.calendarContainer,"rightMost",!1),rn(t.calendarContainer,"centerMost",!0),lr.insertRule(r0+","+a0+f0,u0),t.calendarContainer.style.left=o0+"px",t.calendarContainer.style.right="auto"}}}}function cn(){for(var Z=null,X=0;Xt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=de,t.config.mode==="single")t.selectedDates=[$e];else if(t.config.mode==="multiple"){var Je=Me($e);Je?t.selectedDates.splice(parseInt(Je),1):t.selectedDates.push($e)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=$e,t.selectedDates.push($e),kn($e,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Be,kt){return Be.getTime()-kt.getTime()}));if(c(),Ie){var qe=t.currentYear!==$e.getFullYear();t.currentYear=$e.getFullYear(),t.currentMonth=$e.getMonth(),qe&&(bt("onYearChange"),N()),bt("onMonthChange")}if(Jt(),F(),en(),!Ie&&t.config.mode!=="range"&&t.config.showMonths===1?O(de):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var xe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(xe||Re)&&Ni()}_()}}var yi={locale:[mt,U],showMonths:[W,r,H],minDate:[S],maxDate:[S],positionElement:[ki],clickOpens:[function(){t.config.clickOpens===!0?(h(t._input,"focus",t.open),h(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ae(Z,X){if(Z!==null&&typeof Z=="object"){Object.assign(t.config,Z);for(var ie in Z)yi[ie]!==void 0&&yi[ie].forEach(function(de){return de()})}else t.config[Z]=X,yi[Z]!==void 0?yi[Z].forEach(function(de){return de()}):Ir.indexOf(Z)>-1&&(t.config[Z]=Lr(X));t.redraw(),en(!0)}function Ft(Z,X){var ie=[];if(Z instanceof Array)ie=Z.map(function(de){return t.parseDate(de,X)});else if(Z instanceof Date||typeof Z=="number")ie=[t.parseDate(Z,X)];else if(typeof Z=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(Z,X)];break;case"multiple":ie=Z.split(t.config.conjunction).map(function(de){return t.parseDate(de,X)});break;case"range":ie=Z.split(t.l10n.rangeSeparator).map(function(de){return t.parseDate(de,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(Z)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(de){return de instanceof Date&&Ge(de,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(de,$e){return de.getTime()-$e.getTime()})}function Ri(Z,X,ie){if(X===void 0&&(X=!1),ie===void 0&&(ie=t.config.dateFormat),Z!==0&&!Z||Z instanceof Array&&Z.length===0)return t.clear(X);Ft(Z,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),en(X),X&&bt("onChange")}function Gn(Z){return Z.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function ul(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var Z=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);Z&&Ft(Z,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Rl(){if(t.input=Se(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ct(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),ki()}function ki(){t._positionElement=t.config.positionElement||t._input}function fl(){var Z=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ct("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=Z,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=Z==="datetime-local"?"Y-m-d\\TH:i:S":Z==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}h(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),bt("onChange"),bt("onClose")})}function cl(Z){if(t.isOpen===!0)return t.close();t.open(Z)}function bt(Z,X){if(t.config!==void 0){var ie=t.config[Z];if(ie!==void 0&&ie.length>0)for(var de=0;ie[de]&&de=0&&kn(Z,t.selectedDates[1])<=0}function Jt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(Z,X){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=Ho(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),Z.value=ie.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function nt(Z){var X=Z||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,X)}).filter(function(ie,de,$e){return t.config.mode!=="range"||t.config.enableTime||$e.indexOf(ie)===de}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function en(Z){Z===void 0&&(Z=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=nt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=nt(t.config.altFormat)),Z!==!1&&bt("onValueUpdate")}function Bn(Z){var X=yn(Z),ie=t.prevMonthNav.contains(X),de=t.nextMonthNav.contains(X);ie||de?ee(ie?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(Z){Z.preventDefault();var X=Z.type==="keydown",ie=yn(Z),de=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]);var $e=parseFloat(de.getAttribute("min")),Ie=parseFloat(de.getAttribute("max")),Je=parseFloat(de.getAttribute("step")),qe=parseInt(de.value,10),xe=Z.delta||(X?Z.which===38?1:-1:0),Re=qe+Je*xe;if(typeof de.value<"u"&&de.value.length===2){var Be=de===t.hourElement,kt=de===t.minuteElement;Re<$e?(Re=Ie+Re+Ln(!Be)+(Ln(Be)&&Ln(!t.amPM)),kt&&T(void 0,-1,t.hourElement)):Re>Ie&&(Re=de===t.hourElement?Re-Ie-Ln(!t.amPM):$e,kt&&T(void 0,1,t.hourElement)),t.amPM&&Be&&(Je===1?Re+qe===23:Math.abs(Re-qe)>Je)&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]),de.value=pn(Re)}}return l(),t}function Tl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;lt===e[i]))}function nC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Ze(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:g=void 0,flatpickr:h=void 0}=e;Vt(()=>{const T=f??g,C=k(d);return C.onReady.push((D,O,E)=>{a===void 0&&S(D,O,E),Qt().then(()=>{t(8,m=!0)})}),t(3,h=Wt(T,Object.assign(C,f?{wrap:!0}:{}))),()=>{h.destroy()}});const _=rt();function k(T={}){T=Object.assign({},T);for(const C of r){const D=(O,E,L)=>{_(tC(C),[O,E,L])};C in T?(Array.isArray(T[C])||(T[C]=[T[C]]),T[C].push(D)):T[C]=[D]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,C,D){const O=gd(D,T);!_d(a,O)&&(a||O)&&t(2,a=O),t(4,u=C)}function $(T){te[T?"unshift":"push"](()=>{g=T,t(0,g)})}return n.$$set=T=>{e=Pe(Pe({},e),Kt(T)),t(1,l=Ze(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,g=T.input),"flatpickr"in T&&t(3,h=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&h&&m&&(_d(a,gd(h,h.selectedDates))||h.setDate(a,!0,c)),n.$$.dirty&392&&h&&m)for(const[T,C]of Object.entries(k(d)))h.set(T,C)},[g,l,a,h,u,f,c,d,m,o,s,$]}class Xa extends be{constructor(e){super(),_e(this,e,nC,eC,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function iC(n){let e,t,i,l,s,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new Xa({props:c}),te.push(()=>ge(s,"value",u)),te.push(()=>ge(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=Y("Min date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};m&32768&&(g.id=d[15]),!o&&m&4&&(o=!0,g.value=d[2],ye(()=>o=!1)),!r&&m&1&&(r=!0,g.formattedValue=d[0].options.min,ye(()=>r=!1)),s.$set(g)},i(d){a||(A(s.$$.fragment,d),a=!0)},o(d){I(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function lC(n){let e,t,i,l,s,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new Xa({props:c}),te.push(()=>ge(s,"value",u)),te.push(()=>ge(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=Y("Max date (UTC)"),l=M(),B(s.$$.fragment),p(e,"for",i=n[15])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),z(s,d,m),a=!0},p(d,m){(!a||m&32768&&i!==(i=d[15]))&&p(e,"for",i);const g={};m&32768&&(g.id=d[15]),!o&&m&8&&(o=!0,g.value=d[3],ye(()=>o=!1)),!r&&m&1&&(r=!0,g.formattedValue=d[0].options.max,ye(()=>r=!1)),s.$set(g)},i(d){a||(A(s.$$.fragment,d),a=!0)},o(d){I(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),V(s,d)}}}function sC(n){let e,t,i,l,s,o,r;return i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[iC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[lC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&98309&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&98313&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function oC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[sC]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function rC(n,e,t){var $,T;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(T=s==null?void 0:s.options)==null?void 0:T.max;function u(C,D){C.detail&&C.detail.length==3&&t(0,s.options[D]=C.detail[1],s)}function f(C){r=C,t(2,r),t(0,s)}function c(C){n.$$.not_equal(s.options.min,C)&&(s.options.min=C,t(0,s))}const d=C=>u(C,"min");function m(C){a=C,t(3,a),t(0,s)}function g(C){n.$$.not_equal(s.options.max,C)&&(s.options.max=C,t(0,s))}const h=C=>u(C,"max");function _(C){s=C,t(0,s)}function k(C){Ee.call(this,n,C)}function S(C){Ee.call(this,n,C)}return n.$$set=C=>{e=Pe(Pe({},e),Kt(C)),t(5,l=Ze(e,i)),"field"in C&&t(0,s=C.field),"key"in C&&t(1,o=C.key)},n.$$.update=()=>{var C,D,O,E;n.$$.dirty&5&&r!=((C=s==null?void 0:s.options)==null?void 0:C.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((O=s==null?void 0:s.options)==null?void 0:O.max)&&t(3,a=(E=s==null?void 0:s.options)==null?void 0:E.max)},[s,o,r,a,u,l,f,c,d,m,g,h,_,k,S]}class aC extends be{constructor(e){super(),_e(this,e,rC,oC,me,{field:0,key:1})}}const uC=n=>({}),bd=n=>({});function yd(n,e,t){const i=n.slice();return i[48]=e[t],i}const fC=n=>({}),kd=n=>({});function vd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function wd(n){let e,t,i;return{c(){e=b("div"),t=Y(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),y(e,t),y(e,i)},p(l,s){s[0]&4&&se(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function cC(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function dC(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let u={};if(a!==void 0&&a[0]&2049)u=pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?pt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Ct(r[11])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function Sd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[ve(Fe.call(null,e,"Clear")),K(e,"click",fn(Ye(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function Td(n){let e,t,i,l,s,o;const r=[dC,cC],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&Sd(n);return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),y(e,l),f&&f.m(e,null),y(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(re(),I(a[m],1,1,()=>{a[m]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=Sd(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){I(i),o=!1},d(c){c&&v(e),a[t].d(),f&&f.d()}}}function $d(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[hC]},$$scope:{ctx:n}};return e=new En({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[41](null),V(e,l)}}}function Cd(n){let e,t,i,l,s,o,r,a,u=n[17].length&&Md(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='',l=M(),s=b("input"),o=M(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),y(e,t),y(t,i),y(t,l),y(t,s),ce(s,n[17]),y(t,o),u&&u.m(t,null),s.focus(),r||(a=K(s,"input",n[38]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&ce(s,f[17]),f[17].length?u?u.p(f,c):(u=Md(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&v(e),u&&u.d(),r=!1,a()}}}function Md(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",fn(Ye(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function Od(n){let e,t=n[1]&&Dd(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=Dd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Dd(n){let e,t;return{c(){e=b("div"),t=Y(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&2&&se(t,i[1])},d(i){i&&v(e)}}}function pC(n){let e=n[48]+"",t;return{c(){t=Y(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&se(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function mC(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let u={};if(a!==void 0&&a[0]&4202496)u=pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]);else for(let f=0;f{V(u,1)}),ae()}s?(e=Dt(s,o(r,a)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?pt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Ct(r[13])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&I(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&V(e,r)}}}function Ed(n){let e,t,i,l,s,o,r;const a=[mC,pC],u=[];function f(m,g){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,g){w(m,e,g),u[t].m(e,null),y(e,l),s=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(m,g){n=m;let h=t;t=f(n),t===h?u[t].p(n,g):(re(),I(u[h],1,1,()=>{u[h]=null}),ae(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,l)),(!s||g[0]&512)&&x(e,"closable",n[9]),(!s||g[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(A(i),s=!0)},o(m){I(i),s=!1},d(m){m&&v(e),u[t].d(),o=!1,we(r)}}}function hC(n){let e,t,i,l,s,o=n[14]&&Cd(n);const r=n[35].beforeOptions,a=vt(r,n,n[44],kd);let u=pe(n[22]),f=[];for(let h=0;hI(f[h],1,1,()=>{f[h]=null});let d=null;u.length||(d=Od(n));const m=n[35].afterOptions,g=vt(m,n,n[44],bd);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let h=0;hI(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=wd(n));let c=!n[5]&&!n[6]&&$d(n);return{c(){e=b("div"),t=b("div");for(let d=0;d{c=null}),ae()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;mSe(mt,Ne))||[]}function Te(ne,Ne){ne.preventDefault(),k&&d?G(Ne):W(Ne)}function je(ne,Ne){(ne.code==="Enter"||ne.code==="Space")&&(Te(ne,Ne),S&&U())}function Ve(){ee(),setTimeout(()=>{const ne=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ne&&(ne.focus(),ne.scrollIntoView({block:"nearest"}))},0)}function Qe(ne){ne.stopPropagation(),!g&&!m&&(R==null||R.toggle())}Vt(()=>{const ne=document.querySelectorAll(`label[for="${r}"]`);for(const Ne of ne)Ne.addEventListener("click",Qe);return()=>{for(const Ne of ne)Ne.removeEventListener("click",Qe)}});const tt=ne=>q(ne);function Ge(ne){te[ne?"unshift":"push"](()=>{N=ne,t(20,N)})}function Mt(){P=this.value,t(17,P)}const Pt=(ne,Ne)=>Te(Ne,ne),Ce=(ne,Ne)=>je(Ne,ne);function De(ne){te[ne?"unshift":"push"](()=>{R=ne,t(18,R)})}function ze(ne){Ee.call(this,n,ne)}function _t(ne){te[ne?"unshift":"push"](()=>{F=ne,t(19,F)})}return n.$$set=ne=>{"id"in ne&&t(27,r=ne.id),"noOptionsText"in ne&&t(1,a=ne.noOptionsText),"selectPlaceholder"in ne&&t(2,u=ne.selectPlaceholder),"searchPlaceholder"in ne&&t(3,f=ne.searchPlaceholder),"items"in ne&&t(28,c=ne.items),"multiple"in ne&&t(4,d=ne.multiple),"disabled"in ne&&t(5,m=ne.disabled),"readonly"in ne&&t(6,g=ne.readonly),"upside"in ne&&t(7,h=ne.upside),"selected"in ne&&t(0,_=ne.selected),"toggle"in ne&&t(8,k=ne.toggle),"closable"in ne&&t(9,S=ne.closable),"labelComponent"in ne&&t(10,$=ne.labelComponent),"labelComponentProps"in ne&&t(11,T=ne.labelComponentProps),"optionComponent"in ne&&t(12,C=ne.optionComponent),"optionComponentProps"in ne&&t(13,D=ne.optionComponentProps),"searchable"in ne&&t(14,O=ne.searchable),"searchFunc"in ne&&t(29,E=ne.searchFunc),"class"in ne&&t(15,L=ne.class),"$$scope"in ne&&t(44,o=ne.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(le(),ee()),n.$$.dirty[0]&268566528&&t(22,i=oe(c,P)),n.$$.dirty[0]&1&&t(21,l=function(ne){const Ne=j.toArray(_);return j.inArray(Ne,ne)})},[_,a,u,f,d,m,g,h,k,S,$,T,C,D,O,L,q,P,R,F,N,l,i,ee,Te,je,Ve,r,c,E,W,G,J,H,U,s,tt,Ge,Mt,Pt,Ce,De,ze,_t,o]}class Gb extends be{constructor(e){super(),_e(this,e,bC,gC,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function Ad(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function yC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&Ad(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=Y(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),y(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=Ad(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function kC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Id extends be{constructor(e){super(),_e(this,e,kC,yC,me,{item:0})}}const vC=n=>({}),Ld=n=>({});function wC(n){let e;const t=n[8].afterOptions,i=vt(t,n,n[12],Ld);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&St(i,t,l,l[12],e?wt(t,l[12],s,vC):Tt(l[12]),Ld)},i(l){e||(A(i,l),e=!0)},o(l){I(i,l),e=!1},d(l){i&&i.d(l)}}}function SC(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[wC]},$$scope:{ctx:n}};for(let r=0;rge(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&62?pt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Ct(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function TC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Ze(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Id}=e,{optionComponent:c=Id}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function g($){$=j.toArray($,!0);let T=[];for(let C of $){const D=j.findByKey(r,d,C);D&&T.push(D)}$.length&&!T.length||t(0,u=a?T:T[0])}async function h($){let T=j.toArray($,!0).map(C=>C[d]);r.length&&t(6,m=a?T:T[0])}function _($){u=$,t(0,u)}function k($){Ee.call(this,n,$)}function S($){Ee.call(this,n,$)}return n.$$set=$=>{e=Pe(Pe({},e),Kt($)),t(5,l=Ze(e,i)),"items"in $&&t(1,r=$.items),"multiple"in $&&t(2,a=$.multiple),"selected"in $&&t(0,u=$.selected),"labelComponent"in $&&t(3,f=$.labelComponent),"optionComponent"in $&&t(4,c=$.optionComponent),"selectionKey"in $&&t(7,d=$.selectionKey),"keyOfSelected"in $&&t(6,m=$.keyOfSelected),"$$scope"in $&&t(12,o=$.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(m),n.$$.dirty&1&&h(u)},[u,r,a,f,c,l,m,d,s,_,k,S,o]}class _i extends be{constructor(e){super(),_e(this,e,TC,SC,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function $C(n){let e,t,i,l,s,o;function r(u){n[7](u)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Nl({props:a}),te.push(()=>ge(t,"value",r)),{c(){e=b("div"),B(t.$$.fragment)},m(u,f){w(u,e,f),z(t,e,null),l=!0,s||(o=ve(Fe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&16384&&(c.readonly=!u[14]),!i&&f&1&&(i=!0,c.value=u[0].options.values,ye(()=>i=!1)),t.$set(c)},i(u){l||(A(t.$$.fragment,u),l=!0)},o(u){I(t.$$.fragment,u),l=!1},d(u){u&&v(e),V(t),s=!1,o()}}}function CC(n){let e,t,i;function l(o){n[8](o)}let s={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function MC(n){let e,t,i,l,s,o,r,a,u,f;return i=new he({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[$C,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[CC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&16384&&(m.class="form-field required "+(c[14]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&57345&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const g={};d&16384&&(g.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),V(i,c),V(r,c)}}}function Pd(n){let e,t;return e=new he({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[OC,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&40961&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function OC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"id",o=n[13]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.maxSelect),r||(a=K(s,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&ut(s.value)!==u[0].options.maxSelect&&ce(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function DC(n){let e,t,i=!n[2]&&Pd(n);return{c(){i&&i.c(),e=ke()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(re(),I(i,1,1,()=>{i=null}),ae()):i?(i.p(l,s),s&4&&A(i,1)):(i=Pd(l),i.c(),A(i,1),i.m(e.parentNode,e))},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function EC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[DC],default:[MC,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&18?pt(l,[a&2&&{key:r[1]},a&16&&Ct(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function AC(n,e,t){var k;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((k=s.options)==null?void 0:k.maxSelect)<=1,u=a;function f(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,u=a)}function c(){s.options.maxSelect=ut(this.value),t(0,s),t(5,u),t(2,a)}function d(S){n.$$.not_equal(s.options.values,S)&&(s.options.values=S,t(0,s),t(5,u),t(2,a))}function m(S){a=S,t(2,a)}function g(S){s=S,t(0,s),t(5,u),t(2,a)}function h(S){Ee.call(this,n,S)}function _(S){Ee.call(this,n,S)}return n.$$set=S=>{e=Pe(Pe({},e),Kt(S)),t(4,l=Ze(e,i)),"field"in S&&t(0,s=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,$;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(S=s.options)==null?void 0:S.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&f()},[s,o,a,r,l,u,c,d,m,g,h,_]}class IC extends be{constructor(e){super(),_e(this,e,AC,EC,me,{field:0,key:1})}}function LC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function PC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Fd(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O='"{"a":1,"b":2}"',E,L,R,P,F,N,q,W,G,J,H,U,le;return{c(){e=b("div"),t=b("div"),i=b("div"),l=Y("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=Y(` and + `),r=b("code"),r.textContent="multipart/form-data",a=Y(` + requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=Y(` field + is a + `),c=b("strong"),c.textContent="plain string",d=Y(`: + `),m=b("ul"),g=b("li"),g.innerHTML=""true" is converted to the json true",h=M(),_=b("li"),_.innerHTML=""false" is converted to the json false",k=M(),S=b("li"),S.innerHTML=""null" is converted to the json null",$=M(),T=b("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",C=M(),D=b("li"),E=Y(O),L=Y(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',P=M(),F=b("li"),F.textContent="numeric strings are converted to json number",N=M(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",W=M(),G=b("li"),G.textContent="any other string (empty string too) is double quoted",J=Y(` + Alternatively, if you want to avoid the string value normalizations, you can wrap your + data inside an object, eg.`),H=b("code"),H.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,oe){w(ee,e,oe),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(m,g),y(m,h),y(m,_),y(m,k),y(m,S),y(m,$),y(m,T),y(m,C),y(m,D),y(D,E),y(D,L),y(D,R),y(m,P),y(m,F),y(m,N),y(m,q),y(m,W),y(m,G),y(i,J),y(i,H),le=!0},i(ee){le||(ee&&Ke(()=>{le&&(U||(U=Le(e,et,{duration:150},!0)),U.run(1))}),le=!0)},o(ee){ee&&(U||(U=Le(e,et,{duration:150},!1)),U.run(0)),le=!1},d(ee){ee&&v(e),ee&&U&&U.end()}}}function FC(n){let e,t,i,l,s,o,r;function a(d,m){return d[2]?PC:LC}let u=a(n),f=u(n),c=n[2]&&Fd();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=M(),f.c(),l=M(),c&&c.c(),s=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),y(e,t),y(e,i),f.m(e,null),w(d,l,m),c&&c.m(d,m),w(d,s,m),o||(r=K(e,"click",n[4]),o=!0)},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?m&4&&A(c,1):(c=Fd(),c.c(),A(c,1),c.m(s.parentNode,s)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&(v(e),v(l),v(s)),f.d(),c&&c.d(d),o=!1,r()}}}function NC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[5](r)}let o={$$slots:{options:[FC]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Ct(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function RC(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Pe(Pe({},e),Kt(d)),t(3,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,r,l,a,u,f,c]}class qC extends be{constructor(e){super(),_e(this,e,RC,NC,me,{field:0,key:1})}}function jC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=Y(t),l=M(),s=b("small"),r=Y(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),w(a,s,u),y(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function HC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Nd extends be{constructor(e){super(),_e(this,e,HC,jC,me,{item:0})}}const zC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function VC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function BC(n){let e,t,i,l,s,o;return i=new he({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[VC,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const u={};a&8388608&&(u.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),V(i,r)}}}function UC(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=M(),i=b("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',l=M(),s=b("button"),s.innerHTML='Videos (mp4, avi, mov, 3gp)',o=M(),r=b("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[9]),K(i,"click",n[10]),K(s,"click",n[11]),K(r,"click",n[12])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function WC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$;function T(D){n[8](D)}let C={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Nd,optionComponent:Nd};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new _i({props:C}),te.push(()=>ge(r,"keyOfSelected",T)),_=new En({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[UC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),c=b("button"),d=b("span"),d.textContent="Choose presets",m=M(),g=b("i"),h=M(),B(_.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[22]),p(d,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,O){w(D,e,O),y(e,t),y(e,i),y(e,l),w(D,o,O),z(r,D,O),w(D,u,O),w(D,f,O),y(f,c),y(c,d),y(c,m),y(c,g),y(c,h),z(_,c,null),k=!0,S||($=ve(Fe.call(null,l,{text:`Allow files ONLY with the listed mime types. + Leave empty for no restriction.`,position:"top"})),S=!0)},p(D,O){(!k||O&4194304&&s!==(s=D[22]))&&p(e,"for",s);const E={};O&4194304&&(E.id=D[22]),O&8&&(E.items=D[3]),!a&&O&1&&(a=!0,E.keyOfSelected=D[0].options.mimeTypes,ye(()=>a=!1)),r.$set(E);const L={};O&16777217&&(L.$$scope={dirty:O,ctx:D}),_.$set(L)},i(D){k||(A(r.$$.fragment,D),A(_.$$.fragment,D),k=!0)},o(D){I(r.$$.fragment,D),I(_.$$.fragment,D),k=!1},d(D){D&&(v(e),v(o),v(u),v(f)),V(r,D),V(_),S=!1,$()}}}function YC(n){let e;return{c(){e=b("ul"),e.innerHTML=`
  • WxH + (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt + (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb + (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf + (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH + (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 + (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function KC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C;function D(E){n[13](E)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Nl({props:O}),te.push(()=>ge(r,"value",D)),S=new En({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[YC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),g=b("span"),g.textContent="Supported formats",h=M(),_=b("i"),k=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){w(E,e,L),y(e,t),y(e,i),y(e,l),w(E,o,L),z(r,E,L),w(E,u,L),w(E,f,L),y(f,c),y(f,d),y(f,m),y(m,g),y(m,h),y(m,_),y(m,k),z(S,m,null),$=!0,T||(C=ve(Fe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(E,L){(!$||L&4194304&&s!==(s=E[22]))&&p(e,"for",s);const R={};L&4194304&&(R.id=E[22]),!a&&L&1&&(a=!0,R.value=E[0].options.thumbs,ye(()=>a=!1)),r.$set(R);const P={};L&16777216&&(P.$$scope={dirty:L,ctx:E}),S.$set(P)},i(E){$||(A(r.$$.fragment,E),A(S.$$.fragment,E),$=!0)},o(E){I(r.$$.fragment,E),I(S.$$.fragment,E),$=!1},d(E){E&&(v(e),v(o),v(u),v(f)),V(r,E),V(S),T=!1,C()}}}function JC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&1&&ut(s.value)!==c[0].options.maxSize&&ce(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Rd(n){let e,t,i;return t=new he({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[ZC,({uniqueId:l})=>({22:l}),({uniqueId:l})=>l?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&20971521&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function ZC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[22]),p(s,"id",o=n[22]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.maxSelect),r||(a=K(s,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(s,"id",o),f&1&&ut(s.value)!==u[0].options.maxSelect&&ce(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function GC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new he({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[WC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[KC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),f=new he({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[JC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&Rd(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),d=M(),g&&g.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(h,_){w(h,e,_),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,a),y(e,u),z(f,u,null),y(e,d),g&&g.m(e,null),m=!0},p(h,_){const k={};_&2&&(k.name="schema."+h[1]+".options.mimeTypes"),_&20971529&&(k.$$scope={dirty:_,ctx:h}),i.$set(k);const S={};_&2&&(S.name="schema."+h[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:h}),o.$set(S),(!m||_&4&&r!==(r=h[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const $={};_&2&&($.name="schema."+h[1]+".options.maxSize"),_&20971521&&($.$$scope={dirty:_,ctx:h}),f.$set($),(!m||_&4&&c!==(c=h[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),h[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(h,_),_&4&&A(g,1)):(g=Rd(h),g.c(),A(g,1),g.m(e,null))},i(h){m||(A(i.$$.fragment,h),A(o.$$.fragment,h),A(f.$$.fragment,h),A(g),m=!0)},o(h){I(i.$$.fragment,h),I(o.$$.fragment,h),I(f.$$.fragment,h),I(g),m=!1},d(h){h&&v(e),V(i),V(o),V(f),g&&g.d()}}}function XC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"class","txt"),p(l,"for",o=n[22]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),y(l,s),w(c,r,d),w(c,a,d),u||(f=K(e,"change",n[7]),u=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),u=!1,f()}}}function QC(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[XC,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&20971521&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[QC],options:[GC],default:[BC,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rge(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&34?pt(l,[a&2&&{key:r[1]},a&32&&Ct(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function e6(n,e,t){var R;const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=zC.slice(),u=((R=s.options)==null?void 0:R.maxSelect)<=1,f=u;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const P=[];for(const F of s.options.mimeTypes)a.find(N=>N.mimeType===F)||P.push({mimeType:F});P.length&&t(3,a=a.concat(P))}function m(){s.options.protected=this.checked,t(0,s),t(6,f),t(2,u)}function g(P){n.$$.not_equal(s.options.mimeTypes,P)&&(s.options.mimeTypes=P,t(0,s),t(6,f),t(2,u))}const h=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},_=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},k=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function $(P){n.$$.not_equal(s.options.thumbs,P)&&(s.options.thumbs=P,t(0,s),t(6,f),t(2,u))}function T(){s.options.maxSize=ut(this.value),t(0,s),t(6,f),t(2,u)}function C(){s.options.maxSelect=ut(this.value),t(0,s),t(6,f),t(2,u)}function D(P){u=P,t(2,u)}function O(P){s=P,t(0,s),t(6,f),t(2,u)}function E(P){Ee.call(this,n,P)}function L(P){Ee.call(this,n,P)}return n.$$set=P=>{e=Pe(Pe({},e),Kt(P)),t(5,l=Ze(e,i)),"field"in P&&t(0,s=P.field),"key"in P&&t(1,o=P.key)},n.$$.update=()=>{var P,F;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((F=(P=s.options)==null?void 0:P.values)==null?void 0:F.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,u,a,r,l,f,m,g,h,_,k,S,$,T,C,D,O,E,L]}class t6 extends be{constructor(e){super(),_e(this,e,e6,xC,me,{field:0,key:1})}}function n6(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function i6(n){let e,t,i;function l(o){n[15](o)}let s={id:n[23],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[24]||n[0].id,$$slots:{afterOptions:[n6]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&16777217&&(a.readonly=!o[24]||o[0].id),r&33554440&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function l6(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function s6(n){let e,t,i,l,s,o,r,a,u,f;return i=new he({props:{class:"form-field required "+(n[24]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[i6,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[l6,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),B(i.$$.fragment),l=M(),s=b("div"),o=M(),B(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),z(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),z(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&16777216&&(m.class="form-field required "+(c[24]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&58720297&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const g={};d&16777216&&(g.class="form-field form-field-single-multiple-select "+(c[24]?"":"readonly")),d&58720260&&(g.$$scope={dirty:d,ctx:c}),r.$set(g)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){I(i.$$.fragment,c),I(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),V(i,c),V(r,c)}}}function qd(n){let e,t,i,l,s,o;return t=new he({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[o6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),s=new he({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[r6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),i=M(),l=b("div"),B(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),z(t,e,null),w(r,i,a),w(r,l,a),z(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&41943041&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&41943041&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(A(t.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),V(t),V(s)}}}function o6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Min select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.minSelect),r||(a=K(s,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&ut(s.value)!==u[0].options.minSelect&&ce(s,u[0].options.minSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function r6(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[0].options.maxSelect),a||(u=K(s,"input",n[12]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(s,"id",o),c&1&&r!==(r=f[0].options.minSelect||2)&&p(s,"min",r),c&1&&ut(s.value)!==f[0].options.maxSelect&&ce(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function a6(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(h){n[13](h)}let g={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(g.keyOfSelected=n[0].options.cascadeDelete),a=new _i({props:g}),te.push(()=>ge(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),B(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(h,_){var k,S;w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,r,_),z(a,h,_),f=!0,c||(d=ve(s=Fe.call(null,l,{text:[`Whether on ${((k=n[4])==null?void 0:k.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + +`),position:"top"})),c=!0)},p(h,_){var S,$;s&&$t(s.update)&&_&20&&s.update.call(null,{text:[`Whether on ${((S=h[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,h[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=h[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` + +`),position:"top"}),(!f||_&8388608&&o!==(o=h[23]))&&p(e,"for",o);const k={};_&8388608&&(k.id=h[23]),!u&&_&1&&(u=!0,k.keyOfSelected=h[0].options.cascadeDelete,ye(()=>u=!1)),a.$set(k)},i(h){f||(A(a.$$.fragment,h),f=!0)},o(h){I(a.$$.fragment,h),f=!1},d(h){h&&(v(e),v(r)),V(a,h),c=!1,d()}}}function u6(n){let e,t,i,l,s,o=!n[2]&&qd(n);return l=new he({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[a6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),y(e,t),y(e,i),z(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),I(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&A(o,1)):(o=qd(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(A(o),A(l.$$.fragment,r),s=!0)},o(r){I(o),I(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function f6(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[u6],default:[s6,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fge(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return l=new Qa({props:u}),n[20](l),l.$on("save",n[21]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(f,c){z(e,f,c),w(f,i,c),z(l,f,c),s=!0},p(f,[c]){const d=c&258?pt(o,[c&2&&{key:f[1]},c&256&&Ct(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ye(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(A(e.$$.fragment,f),A(l.$$.fragment,f),s=!0)},o(f){I(e.$$.fragment,f),I(l.$$.fragment,f),s=!1},d(f){f&&v(i),V(e,f),n[20](null),V(l,f)}}}function c6(n,e,t){var P;let i,l;const s=["field","key"];let o=Ze(e,s),r;We(n,zn,F=>t(10,r=F));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((P=a.options)==null?void 0:P.maxSelect)==1,g=m;function h(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,g=m)}function _(){a.options.minSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function k(){a.options.maxSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function S(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,g),t(2,m))}const $=()=>d==null?void 0:d.show();function T(F){n.$$.not_equal(a.options.collectionId,F)&&(a.options.collectionId=F,t(0,a),t(9,g),t(2,m))}function C(F){m=F,t(2,m)}function D(F){a=F,t(0,a),t(9,g),t(2,m)}function O(F){Ee.call(this,n,F)}function E(F){Ee.call(this,n,F)}function L(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const R=F=>{var N,q;(q=(N=F==null?void 0:F.detail)==null?void 0:N.collection)!=null&&q.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=Pe(Pe({},e),Kt(F)),t(8,o=Ze(e,s)),"field"in F&&t(0,a=F.field),"key"in F&&t(1,u=F.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(F=>F.type!="view")),n.$$.dirty&516&&g!=m&&(t(9,g=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&h(),n.$$.dirty&1025&&t(4,l=r.find(F=>F.id==a.options.collectionId)||null)},[a,u,m,d,l,i,f,c,o,g,r,_,k,S,$,T,C,D,O,E,L,R]}class d6 extends be{constructor(e){super(),_e(this,e,c6,f6,me,{field:0,key:1})}}const p6=n=>({dragging:n&4,dragover:n&8}),jd=n=>({dragging:n[2],dragover:n[3]});function m6(n){let e,t,i,l,s;const o=n[10].default,r=vt(o,n,n[9],jd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[11])),K(e,"dragleave",Ye(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&St(r,o,a,a[9],i?wt(o,a[9],u,p6):Tt(a[9]),jd),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){I(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,we(s)}}}function h6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m(T,C){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",T)}}function g(T,C){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let D={};try{D=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(D.group!=a)return;const O=D.index<<0;O{t(3,d=!0)},_=()=>{t(3,d=!1)},k=()=>{t(3,d=!1),t(2,c=!1)},S=T=>m(T,o),$=T=>g(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,l=T.$$scope)},[o,u,c,d,m,g,r,a,f,l,i,h,_,k,S,$]}class Ls extends be{constructor(e){super(),_e(this,e,h6,m6,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Hd(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function zd(n){let e,t,i,l,s,o,r,a;return{c(){e=Y(`, + `),t=b("code"),t.textContent="username",i=Y(` , + `),l=b("code"),l.textContent="email",s=Y(` , + `),o=b("code"),o.textContent="emailVisibility",r=Y(` , + `),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,l,f),w(u,s,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function g6(n){let e,t,i,l;function s(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=Dt(r,a(n)),te.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&B(e.$$.fragment),i=M()},m(u,f){e&&z(e,u,f),w(u,i,f),l=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(e=Dt(r,a(n)),te.push(()=>ge(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],ye(()=>t=!1)),e.$set(c)}},i(u){l||(e&&A(e.$$.fragment,u),l=!0)},o(u){e&&I(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Vd(n,e){let t,i,l,s;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[g6]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Ls({props:r}),te.push(()=>ge(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].schema,ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function _6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=[],g=new Map,h,_,k,S,$,T,C,D,O=n[0].type==="auth"&&zd(),E=pe(n[0].schema);const L=F=>F[17];for(let F=0;Fge(T,"collection",R)),{c(){e=b("div"),t=b("p"),i=Y(`System fields: + `),l=b("code"),l.textContent="id",s=Y(` , + `),o=b("code"),o.textContent="created",r=Y(` , + `),a=b("code"),a.textContent="updated",u=M(),O&&O.c(),f=Y(` + .`),c=M(),d=b("div");for(let F=0;FC=!1)),T.$set(q)},i(F){if(!D){for(let N=0;ND.name===T))}function f(T){return i.findIndex(C=>C===T)}function c(T,C){var D;!((D=l==null?void 0:l.schema)!=null&&D.length)||T===C||!C||t(0,l.indexes=l.indexes.map(O=>j.replaceIndexColumn(O,T,C)),l)}function d(T,C,D,O){D[O]=T,t(0,l)}const m=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function h(T){n.$$.not_equal(l.schema,T)&&(l.schema=T,t(0,l))}const _=T=>{if(!T.detail)return;const C=T.detail.target;C.style.opacity=0,setTimeout(()=>{var D;(D=C==null?void 0:C.style)==null||D.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage(C,0,0)},k=()=>{Gt({})},S=T=>r(T.detail);function $(T){l=T,t(0,l)}return n.$$set=T=>{"collection"in T&&t(0,l=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(T=>!T.toDelete)||[])},[l,s,o,r,f,c,d,m,g,h,_,k,S,$]}class y6 extends be{constructor(e){super(),_e(this,e,b6,_6,me,{collection:0})}}const k6=n=>({isAdminOnly:n&512}),Bd=n=>({isAdminOnly:n[9]}),v6=n=>({isAdminOnly:n&512}),Ud=n=>({isAdminOnly:n[9]}),w6=n=>({isAdminOnly:n&512}),Wd=n=>({isAdminOnly:n[9]});function S6(n){let e,t;return e=new he({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[$6,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function T6(n){let e;return{c(){e=b("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Yd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Kd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function $6(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,u,f,c,d,m,g,h,_,k,S;const $=n[12].beforeLabel,T=vt($,n,n[15],Wd),C=n[12].afterLabel,D=vt(C,n,n[15],Ud);let O=!n[9]&&Yd(n);function E(q){n[14](q)}var L=n[7];function R(q,W){let G={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(G.value=q[0]),{props:G}}L&&(m=Dt(L,R(n)),n[13](m),te.push(()=>ge(m,"value",E)));let P=n[9]&&Kd(n);const F=n[12].default,N=vt(F,n,n[15],Bd);return{c(){e=b("div"),t=b("label"),T&&T.c(),i=M(),l=b("span"),s=Y(n[2]),o=M(),a=Y(r),u=M(),D&&D.c(),f=M(),O&&O.c(),d=M(),m&&B(m.$$.fragment),h=M(),P&&P.c(),_=M(),k=b("div"),N&&N.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(k,"class","help-block")},m(q,W){w(q,e,W),y(e,t),T&&T.m(t,null),y(t,i),y(t,l),y(l,s),y(l,o),y(l,a),y(t,u),D&&D.m(t,null),y(t,f),O&&O.m(t,null),y(e,d),m&&z(m,e,null),y(e,h),P&&P.m(e,null),w(q,_,W),w(q,k,W),N&&N.m(k,null),S=!0},p(q,W){if(T&&T.p&&(!S||W&33280)&&St(T,$,q,q[15],S?wt($,q[15],W,w6):Tt(q[15]),Wd),(!S||W&4)&&se(s,q[2]),(!S||W&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||W&512)&&x(l,"txt-hint",q[9]),D&&D.p&&(!S||W&33280)&&St(D,C,q,q[15],S?wt(C,q[15],W,v6):Tt(q[15]),Ud),q[9]?O&&(O.d(1),O=null):O?O.p(q,W):(O=Yd(q),O.c(),O.m(t,null)),(!S||W&262144&&c!==(c=q[18]))&&p(t,"for",c),W&128&&L!==(L=q[7])){if(m){re();const G=m;I(G.$$.fragment,1,0,()=>{V(G,1)}),ae()}L?(m=Dt(L,R(q)),q[13](m),te.push(()=>ge(m,"value",E)),B(m.$$.fragment),A(m.$$.fragment,1),z(m,e,h)):m=null}else if(L){const G={};W&262144&&(G.id=q[18]),W&2&&(G.baseCollection=q[1]),W&512&&(G.disabled=q[9]),W&544&&(G.placeholder=q[9]?"":q[5]),!g&&W&1&&(g=!0,G.value=q[0],ye(()=>g=!1)),m.$set(G)}q[9]?P?(P.p(q,W),W&512&&A(P,1)):(P=Kd(q),P.c(),A(P,1),P.m(e,null)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),N&&N.p&&(!S||W&33280)&&St(N,F,q,q[15],S?wt(F,q[15],W,k6):Tt(q[15]),Bd)},i(q){S||(A(T,q),A(D,q),m&&A(m.$$.fragment,q),A(P),A(N,q),S=!0)},o(q){I(T,q),I(D,q),m&&I(m.$$.fragment,q),I(P),I(N,q),S=!1},d(q){q&&(v(e),v(_),v(k)),T&&T.d(q),D&&D.d(q),O&&O.d(),n[13](null),m&&V(m),P&&P.d(),N&&N.d(q)}}}function C6(n){let e,t,i,l;const s=[T6,S6],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Jd;function M6(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,g=Jd,h=!1;_();async function _(){g||h||(t(8,h=!0),t(7,g=(await st(()=>import("./FilterAutocompleteInput-c936572d.js"),["./FilterAutocompleteInput-c936572d.js","./index-102ce751.js"],import.meta.url)).default),Jd=g,t(8,h=!1))}async function k(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function $(C){te[C?"unshift":"push"](()=>{d=C,t(6,d)})}function T(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,g,h,i,k,S,l,$,T,s]}class $l extends be{constructor(e){super(),_e(this,e,M6,C6,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Zd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Gd(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L=pe(n[2]),R=[];for(let P=0;P@request
    filter:",c=M(),d=b("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",m=M(),g=b("hr"),h=M(),_=b("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",k=M(),S=b("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",$=M(),T=b("hr"),C=M(),D=b("p"),D.innerHTML=`Example rule: +
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,F){w(P,e,F),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let N=0;N{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(P){P&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(P){P&&v(e),at(R,P),P&&O&&O.end()}}}function Xd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&se(i,t)},d(l){l&&v(e)}}}function Qd(n){let e,t,i,l,s,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[O6,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new $l({props:c}),te.push(()=>ge(e,"rule",f));function d(_){n[7](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new $l({props:m}),te.push(()=>ge(l,"rule",d));function g(_){n[8](_)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new $l({props:h}),te.push(()=>ge(r,"rule",g)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(_,k){z(e,_,k),w(_,i,k),z(l,_,k),w(_,o,k),z(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&17408&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,ye(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,ye(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(l.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(l.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){_&&(v(i),v(o)),V(e,_),V(l,_),V(r,_)}}}function xd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=ve(Fe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function O6(n){let e,t=!n[10]&&xd();return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=xd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function ep(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[D6]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new $l({props:s}),te.push(()=>ge(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function D6(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. + changing the password without requiring to enter the old one, directly updating the verified + state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function E6(n){var F,N;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,g,h,_,k,S,$,T,C=n[1]&&Gd(n);function D(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new $l({props:O}),te.push(()=>ge(f,"rule",D));function E(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new $l({props:L}),te.push(()=>ge(m,"rule",E));let R=((F=n[0])==null?void 0:F.type)!=="view"&&Qd(n),P=((N=n[0])==null?void 0:N.type)==="auth"&&ep(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the +
    PocketBase filter syntax and operators + .`,l=M(),s=b("button"),r=Y(o),a=M(),C&&C.c(),u=M(),B(f.$$.fragment),d=M(),B(m.$$.fragment),h=M(),R&&R.c(),_=M(),P&&P.c(),k=ke(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,W){w(q,e,W),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),C&&C.m(e,null),w(q,u,W),z(f,q,W),w(q,d,W),z(m,q,W),w(q,h,W),R&&R.m(q,W),w(q,_,W),P&&P.m(q,W),w(q,k,W),S=!0,$||(T=K(s,"click",n[3]),$=!0)},p(q,[W]){var H,U;(!S||W&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?C?(C.p(q,W),W&2&&A(C,1)):(C=Gd(q),C.c(),A(C,1),C.m(e,null)):C&&(re(),I(C,1,1,()=>{C=null}),ae());const G={};W&1&&(G.collection=q[0]),!c&&W&1&&(c=!0,G.rule=q[0].listRule,ye(()=>c=!1)),f.$set(G);const J={};W&1&&(J.collection=q[0]),!g&&W&1&&(g=!0,J.rule=q[0].viewRule,ye(()=>g=!1)),m.$set(J),((H=q[0])==null?void 0:H.type)!=="view"?R?(R.p(q,W),W&1&&A(R,1)):(R=Qd(q),R.c(),A(R,1),R.m(_.parentNode,_)):R&&(re(),I(R,1,1,()=>{R=null}),ae()),((U=q[0])==null?void 0:U.type)==="auth"?P?(P.p(q,W),W&1&&A(P,1)):(P=ep(q),P.c(),A(P,1),P.m(k.parentNode,k)):P&&(re(),I(P,1,1,()=>{P=null}),ae())},i(q){S||(A(C),A(f.$$.fragment,q),A(m.$$.fragment,q),A(R),A(P),S=!0)},o(q){I(C),I(f.$$.fragment,q),I(m.$$.fragment,q),I(R),I(P),S=!1},d(q){q&&(v(e),v(u),v(d),v(h),v(_),v(k)),C&&C.d(),V(f,q),V(m,q),R&&R.d(q),P&&P.d(q),$=!1,T()}}}function A6(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function u(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function f(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,u,f,c,d]}class I6 extends be{constructor(e){super(),_e(this,e,A6,E6,me,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[9]=e[t],i}function L6(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>ge(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function P6(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function np(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. +
    + If your query doesn't have a suitable one, you can use the universal + (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. + MAX(balance) as maxBalance).
  • `,u=M(),h&&h.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){w(_,e,k),y(e,t),w(_,l,k),m[s].m(_,k),w(_,r,k),w(_,a,k),w(_,u,k),h&&h.m(_,k),w(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=g(_),s===S?m[s].p(_,k):(re(),I(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?h?h.p(_,k):(h=np(_),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(_),h&&h.d(_)}}}function N6(n){let e,t;return e=new he({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[F6,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function R6(n,e,t){let i;We(n,gi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((g=l==null?void 0:l.options)==null?void 0:g.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let h in d)for(let _ in d[h]){const k=d[h][_].message,S=m[h]||h;r.push(j.sentenize(S+": "+k))}}Vt(async()=>{t(2,o=!0);try{t(1,s=(await st(()=>import("./CodeEditor-c4a370cf.js"),["./CodeEditor-c4a370cf.js","./index-102ce751.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const f=()=>{r.length&&ii("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class q6 extends be{constructor(e){super(),_e(this,e,R6,N6,me,{collection:0})}}const j6=n=>({active:n&1}),lp=n=>({active:n[0]});function sp(n){let e,t,i;const l=n[15].default,s=vt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&St(s,l,o,o[14],i?wt(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function H6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=vt(a,n,n[14],lp);let f=n[0]&&sp(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=M(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),y(e,t),u&&u.m(t,null),y(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[K(t,"click",Ye(n[17])),K(t,"drop",Ye(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",Ye(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&St(u,a,c,c[14],s?wt(a,c[14],d,j6):Tt(c[14]),lp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=sp(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(A(u,c),A(f),s=!0)},o(c){I(u,c),I(f),s=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,we(r)}}}function z6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function g(){return!!f}function h(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():h()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of R)P.click()}}Vt(()=>()=>clearTimeout(r));function $(R){Ee.call(this,n,R)}const T=()=>c&&k(),C=R=>{u&&(t(7,m=!1),S(),s("drop",R))},D=R=>u&&s("dragstart",R),O=R=>{u&&(t(7,m=!0),s("dragenter",R))},E=R=>{u&&(t(7,m=!1),s("dragleave",R))};function L(R){te[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,u=R.draggable),"active"in R&&t(0,f=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,k,S,o,m,s,d,g,h,_,r,l,i,$,T,C,D,O,E,L]}class _o extends be{constructor(e){super(),_e(this,e,z6,H6,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function V6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function B6(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[V6,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&12289&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function U6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function W6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function op(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Y6(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?W6:U6}let a=r(n),u=a(n),f=n[3]&&op();return{c(){e=b("div"),e.innerHTML=' Username/Password',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[3]?f?d&8&&A(f,1):(f=op(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function K6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function rp(n){let e,t,i,l,s,o,r,a;return i=new he({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[J6,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[Z6,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&Ke(()=>{a&&(r||(r=Le(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=Le(e,et,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),V(i),V(o),u&&r&&r.end()}}}function J6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[7](_)}let h={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(h.value=n[0].options.exceptEmailDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[12]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`Email domains that are NOT allowed to sign up. + This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function Z6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[8](_)}let h={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Nl({props:h}),te.push(()=>ge(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[12]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Fe.call(null,l,{text:`Email domains that are ONLY allowed to sign up. + This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function G6(n){let e,t,i,l;e=new he({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[K6,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&rp(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&A(s,1)):(s=rp(o),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function X6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Q6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ap(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function x6(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?Q6:X6}let a=r(n),u=a(n),f=n[2]&&ap();return{c(){e=b("div"),e.innerHTML=' Email/Password',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&A(f,1):(f=ap(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function e5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function up(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function t5(n){let e,t,i,l;e=new he({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[e5,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&up();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&A(s,1):(s=up(),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function n5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function i5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function fp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function l5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?i5:n5}let a=r(n),u=a(n),f=n[1]&&fp();return{c(){e=b("div"),e.innerHTML=' OAuth2',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&A(f,1):(f=fp(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function s5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[12]),p(s,"type","number"),p(s,"id",o=n[12]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].options.minPasswordLength),r||(a=K(s,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(s,"id",o),f&1&&ut(s.value)!==u[0].options.minPasswordLength&&ce(s,u[0].options.minPasswordLength)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function o5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[11]),ve(Fe.call(null,r,{text:`The constraint is applied only for new records. +Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function r5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return l=new _o({props:{single:!0,$$slots:{header:[Y6],default:[B6]},$$scope:{ctx:n}}}),o=new _o({props:{single:!0,$$slots:{header:[x6],default:[G6]},$$scope:{ctx:n}}}),a=new _o({props:{single:!0,$$slots:{header:[l5],default:[t5]},$$scope:{ctx:n}}}),g=new he({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[s5,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new he({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[o5,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(g.$$.fragment),h=M(),B(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,$){w(S,e,$),w(S,t,$),w(S,i,$),z(l,i,null),y(i,s),z(o,i,null),y(i,r),z(a,i,null),w(S,u,$),w(S,f,$),w(S,c,$),w(S,d,$),w(S,m,$),z(g,S,$),w(S,h,$),z(_,S,$),k=!0},p(S,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:S}),l.$set(T);const C={};$&8197&&(C.$$scope={dirty:$,ctx:S}),o.$set(C);const D={};$&8195&&(D.$$scope={dirty:$,ctx:S}),a.$set(D);const O={};$&12289&&(O.$$scope={dirty:$,ctx:S}),g.$set(O);const E={};$&12289&&(E.$$scope={dirty:$,ctx:S}),_.$set(E)},i(S){k||(A(l.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),k=!0)},o(S){I(l.$$.fragment,S),I(o.$$.fragment,S),I(a.$$.fragment,S),I(g.$$.fragment,S),I(_.$$.fragment,S),k=!1},d(S){S&&(v(e),v(t),v(i),v(u),v(f),v(c),v(d),v(m),v(h)),V(l),V(o),V(a),V(g,S),V(_,S)}}}function a5(n,e,t){let i,l,s,o;We(n,gi,h=>t(4,o=h));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=ut(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,_,k,S;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,u,f,c,d,m,g]}class u5 extends be{constructor(e){super(),_e(this,e,a5,r5,me,{collection:0})}}function cp(n,e,t){const i=n.slice();return i[18]=e[t],i}function dp(n,e,t){const i=n.slice();return i[18]=e[t],i}function pp(n,e,t){const i=n.slice();return i[18]=e[t],i}function mp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hp(n){let e,t,i,l,s=n[3]&&gp(n),o=!n[4]&&_p(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),y(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=gp(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=_p(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function gp(n){var m,g;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((g=n[2])==null?void 0:g.name)+"",d;return{c(){e=b("li"),t=b("div"),i=Y(`Renamed collection + `),l=b("strong"),o=Y(s),r=M(),a=b("i"),u=M(),f=b("strong"),d=Y(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(h,_){w(h,e,_),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,u),y(t,f),y(f,d)},p(h,_){var k,S;_&2&&s!==(s=((k=h[1])==null?void 0:k.name)+"")&&se(o,s),_&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&v(e)}}}function _p(n){let e,t,i,l=pe(n[6]),s=[];for(let f=0;f
    ',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query, + you'll have to update it manually!`,o=M(),u&&u.c(),r=M(),f&&f.c(),a=ke(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),u&&u.m(l,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=mp(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=hp(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(r),v(a)),u&&u.d(),f&&f.d(c)}}}function c5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function d5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='Cancel',t=M(),i=b("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[K(e,"click",n[12]),K(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function p5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[d5],header:[c5],default:[f5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function m5(n,e,t){let i,l,s,o,r,a;const u=rt();let f,c,d;async function m(C,D){t(1,c=C),t(2,d=D),await Qt(),i||s.length||o.length||r.length?f==null||f.show():h()}function g(){f==null||f.hide()}function h(){g(),u("confirm")}const _=()=>g(),k=()=>h();function S(C){te[C?"unshift":"push"](()=>{f=C,t(5,f)})}function $(C){Ee.call(this,n,C)}function T(C){Ee.call(this,n,C)}return n.$$.update=()=>{var C,D,O;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(E=>E.id&&!E.toDelete&&E.originalName!=E.name))||[]),n.$$.dirty&4&&t(7,o=((D=d==null?void 0:d.schema)==null?void 0:D.filter(E=>E.id&&E.toDelete))||[]),n.$$.dirty&6&&t(6,r=((O=d==null?void 0:d.schema)==null?void 0:O.filter(E=>{var R,P,F;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(N=>N.id==E.id);return L?((P=L.options)==null?void 0:P.maxSelect)!=1&&((F=E.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[g,c,d,i,l,f,r,o,s,a,h,m,_,k,S,$,T]}class h5 extends be{constructor(e){super(),_e(this,e,m5,p5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function vp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function g5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new y6({props:s}),te.push(()=>ge(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function _5(n){let e,t,i;function l(o){n[34](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new q6({props:s}),te.push(()=>ge(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wp(n){let e,t,i,l;function s(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new I6({props:o}),te.push(()=>ge(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){l||(A(t.$$.fragment,r),l=!0)},o(r){I(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function Sp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new u5({props:o}),te.push(()=>ge(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Al)},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&x(e,"active",r[3]===Al)},i(r){l||(A(t.$$.fragment,r),l=!0)},o(r){I(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function b5(n){let e,t,i,l,s,o,r;const a=[_5,g5],u=[];function f(m,g){return m[14]?0:1}i=f(n),l=u[i]=a[i](n);let c=n[3]===ks&&wp(n),d=n[15]&&Sp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Ei),p(e,"class","tabs-content svelte-12y0yzb")},m(m,g){w(m,e,g),y(e,t),u[i].m(t,null),y(e,s),c&&c.m(e,null),y(e,o),d&&d.m(e,null),r=!0},p(m,g){let h=i;i=f(m),i===h?u[i].p(m,g):(re(),I(u[h],1,1,()=>{u[h]=null}),ae(),l=u[i],l?l.p(m,g):(l=u[i]=a[i](m),l.c()),A(l,1),l.m(t,null)),(!r||g[0]&8)&&x(t,"active",m[3]===Ei),m[3]===ks?c?(c.p(m,g),g[0]&8&&A(c,1)):(c=wp(m),c.c(),A(c,1),c.m(e,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),m[15]?d?(d.p(m,g),g[0]&32768&&A(d,1)):(d=Sp(m),d.c(),A(d,1),d.m(e,null)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(m){r||(A(l),A(c),A(d),r=!0)},o(m){I(l),I(c),I(d),r=!1},d(m){m&&v(e),u[i].d(),c&&c.d(),d&&d.d()}}}function Tp(n){let e,t,i,l,s,o,r;return o=new En({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[y5]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("button"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),y(i,l),y(i,s),z(o,i,null),r=!0},p(a,u){const f={};u[1]&4194304&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function y5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML=' Duplicate',t=M(),i=b("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[26]),K(i,"click",fn(Ye(n[27])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function $p(n){let e,t,i,l;return i=new En({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[k5]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(s,o){w(s,e,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),V(i,s)}}}function Cp(n){let e,t,i,l,s,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=Y(" collection"),u=M(),p(t,"class",i=Jn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(s,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),x(e,"selected",n[49]==n[2].type)},m(m,g){w(m,e,g),y(e,t),y(e,l),y(e,s),y(s,r),y(s,a),y(e,u),f||(c=K(e,"click",d),f=!0)},p(m,g){n=m,g[0]&64&&i!==(i=Jn(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),g[0]&64&&o!==(o=n[50]+"")&&se(r,o),g[0]&68&&x(e,"selected",n[49]==n[2].type)},d(m){m&&v(e),f=!1,c()}}}function k5(n){let e,t=pe(Object.entries(n[6])),i=[];for(let l=0;l{P=null}),ae()):P?(P.p(N,q),q[0]&4&&A(P,1)):(P=$p(N),P.c(),A(P,1),P.m(d,null)),(!E||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(N[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!E||q[0]&4&&C!==(C=!!N[2].id))&&(d.disabled=C),N[2].system?F||(F=Mp(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(N){E||(A(P),E=!0)},o(N){I(P),E=!1},d(N){N&&(v(e),v(l),v(s),v(f),v(c),v(D),v(O)),P&&P.d(),F&&F.d(N),L=!1,R()}}}function Op(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=ve(t=Fe.call(null,e,n[11])),s=!0)},p(r,a){t&&$t(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Le(e,Yt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Le(e,Yt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function Dp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Ep(n){var a,u,f;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),s,o,r=l&&Ap();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Al)},m(c,d){w(c,e,d),y(e,t),y(e,i),r&&r.m(e,null),s||(o=K(e,"click",n[33]),s=!0)},p(c,d){var m,g,h;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((h=(g=c[5])==null?void 0:g.options)!=null&&h.manageRule)),l?r?d[0]&32&&A(r,1):(r=Ap(),r.c(),A(r,1),r.m(e,null)):r&&(re(),I(r,1,1,()=>{r=null}),ae()),d[0]&8&&x(e,"active",c[3]===Al)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function Ap(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function w5(n){var W,G,J,H,U,le,ee;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,g=n[14]?"Query":"Fields",h,_,k=!j.isEmpty(n[11]),S,$,T,C,D=!j.isEmpty((W=n[5])==null?void 0:W.listRule)||!j.isEmpty((G=n[5])==null?void 0:G.viewRule)||!j.isEmpty((J=n[5])==null?void 0:J.createRule)||!j.isEmpty((H=n[5])==null?void 0:H.updateRule)||!j.isEmpty((U=n[5])==null?void 0:U.deleteRule)||!j.isEmpty((ee=(le=n[5])==null?void 0:le.options)==null?void 0:ee.manageRule),O,E,L,R,P=!!n[2].id&&!n[2].system&&Tp(n);r=new he({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[v5,({uniqueId:oe})=>({48:oe}),({uniqueId:oe})=>[0,oe?131072:0]]},$$scope:{ctx:n}}});let F=k&&Op(n),N=D&&Dp(),q=n[15]&&Ep(n);return{c(){e=b("h4"),i=Y(t),l=M(),P&&P.c(),s=M(),o=b("form"),B(r.$$.fragment),a=M(),u=b("input"),f=M(),c=b("div"),d=b("button"),m=b("span"),h=Y(g),_=M(),F&&F.c(),S=M(),$=b("button"),T=b("span"),T.textContent="API Rules",C=M(),N&&N.c(),O=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Ei),p(T,"class","txt"),p($,"type","button"),p($,"class","tab-item"),x($,"active",n[3]===ks),p(c,"class","tabs-header stretched")},m(oe,Te){w(oe,e,Te),y(e,i),w(oe,l,Te),P&&P.m(oe,Te),w(oe,s,Te),w(oe,o,Te),z(r,o,null),y(o,a),y(o,u),w(oe,f,Te),w(oe,c,Te),y(c,d),y(d,m),y(m,h),y(d,_),F&&F.m(d,null),y(c,S),y(c,$),y($,T),y($,C),N&&N.m($,null),y(c,O),q&&q.m(c,null),E=!0,L||(R=[K(o,"submit",Ye(n[30])),K(d,"click",n[31]),K($,"click",n[32])],L=!0)},p(oe,Te){var Ve,Qe,tt,Ge,Mt,Pt,Ce;(!E||Te[0]&4)&&t!==(t=oe[2].id?"Edit collection":"New collection")&&se(i,t),oe[2].id&&!oe[2].system?P?(P.p(oe,Te),Te[0]&4&&A(P,1)):(P=Tp(oe),P.c(),A(P,1),P.m(s.parentNode,s)):P&&(re(),I(P,1,1,()=>{P=null}),ae());const je={};Te[0]&8192&&(je.class="form-field collection-field-name required m-b-0 "+(oe[13]?"disabled":"")),Te[0]&41028|Te[1]&4325376&&(je.$$scope={dirty:Te,ctx:oe}),r.$set(je),(!E||Te[0]&16384)&&g!==(g=oe[14]?"Query":"Fields")&&se(h,g),Te[0]&2048&&(k=!j.isEmpty(oe[11])),k?F?(F.p(oe,Te),Te[0]&2048&&A(F,1)):(F=Op(oe),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!E||Te[0]&8)&&x(d,"active",oe[3]===Ei),Te[0]&32&&(D=!j.isEmpty((Ve=oe[5])==null?void 0:Ve.listRule)||!j.isEmpty((Qe=oe[5])==null?void 0:Qe.viewRule)||!j.isEmpty((tt=oe[5])==null?void 0:tt.createRule)||!j.isEmpty((Ge=oe[5])==null?void 0:Ge.updateRule)||!j.isEmpty((Mt=oe[5])==null?void 0:Mt.deleteRule)||!j.isEmpty((Ce=(Pt=oe[5])==null?void 0:Pt.options)==null?void 0:Ce.manageRule)),D?N?Te[0]&32&&A(N,1):(N=Dp(),N.c(),A(N,1),N.m($,null)):N&&(re(),I(N,1,1,()=>{N=null}),ae()),(!E||Te[0]&8)&&x($,"active",oe[3]===ks),oe[15]?q?q.p(oe,Te):(q=Ep(oe),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(oe){E||(A(P),A(r.$$.fragment,oe),A(F),A(N),E=!0)},o(oe){I(P),I(r.$$.fragment,oe),I(F),I(N),E=!1},d(oe){oe&&(v(e),v(l),v(s),v(o),v(f),v(c)),P&&P.d(oe),V(r),F&&F.d(),N&&N.d(),q&&q.d(),L=!1,we(R)}}}function S5(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=Y(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(s,r),u||(f=[K(e,"click",n[24]),K(l,"click",n[25])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function T5(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[S5],header:[w5],default:[b5]},$$scope:{ctx:n}};e=new Xt({props:s}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new h5({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(A(e.$$.fragment,r),A(i.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[39](null),V(e,r),n[42](null),V(i,r)}}}const Ei="schema",ks="api_rules",Al="options",$5="base",Ip="auth",Lp="view";function Rr(n){return JSON.stringify(n)}function C5(n,e,t){let i,l,s,o,r,a;We(n,gi,ne=>t(5,a=ne));const u={};u[$5]="Base",u[Lp]="View",u[Ip]="Auth";const f=rt();let c,d,m=null,g=j.initCollection(),h=!1,_=!1,k=Ei,S=Rr(g),$="";function T(ne){t(3,k=ne)}function C(ne){return O(ne),t(10,_=!0),T(Ei),c==null?void 0:c.show()}function D(){return c==null?void 0:c.hide()}async function O(ne){Gt({}),typeof ne<"u"?(t(22,m=ne),t(2,g=structuredClone(ne))):(t(22,m=null),t(2,g=j.initCollection())),t(2,g.schema=g.schema||[],g),t(2,g.originalName=g.name||"",g),await Qt(),t(23,S=Rr(g))}function E(){g.id?d==null||d.show(m,g):L()}function L(){if(h)return;t(9,h=!0);const ne=R();let Ne;g.id?Ne=ue.collections.update(g.id,ne):Ne=ue.collections.create(ne),Ne.then(Se=>{Ea(),uv(Se),t(10,_=!1),D(),It(g.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!g.id,collection:Se})}).catch(Se=>{ue.error(Se)}).finally(()=>{t(9,h=!1)})}function R(){const ne=Object.assign({},g);ne.schema=ne.schema.slice(0);for(let Ne=ne.schema.length-1;Ne>=0;Ne--)ne.schema[Ne].toDelete&&ne.schema.splice(Ne,1);return ne}function P(){m!=null&&m.id&&an(`Do you really want to delete collection "${m.name}" and all its records?`,()=>ue.collections.delete(m.id).then(()=>{D(),It(`Successfully deleted collection "${m.name}".`),f("delete",m),fv(m)}).catch(ne=>{ue.error(ne)}))}function F(ne){t(2,g.type=ne,g),ii("schema")}function N(){o?an("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ne=m?structuredClone(m):null;if(ne){if(ne.id="",ne.created="",ne.updated="",ne.name+="_duplicate",!j.isEmpty(ne.schema))for(const Ne of ne.schema)Ne.id="";if(!j.isEmpty(ne.indexes))for(let Ne=0;NeD(),G=()=>E(),J=()=>N(),H=()=>P(),U=ne=>{t(2,g.name=j.slugify(ne.target.value),g),ne.target.value=g.name},le=ne=>F(ne),ee=()=>{r&&E()},oe=()=>T(Ei),Te=()=>T(ks),je=()=>T(Al);function Ve(ne){g=ne,t(2,g),t(22,m)}function Qe(ne){g=ne,t(2,g),t(22,m)}function tt(ne){g=ne,t(2,g),t(22,m)}function Ge(ne){g=ne,t(2,g),t(22,m)}const Mt=()=>o&&_?(an("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),D()}),!1):!0;function Pt(ne){te[ne?"unshift":"push"](()=>{c=ne,t(7,c)})}function Ce(ne){Ee.call(this,n,ne)}function De(ne){Ee.call(this,n,ne)}function ze(ne){te[ne?"unshift":"push"](()=>{d=ne,t(8,d)})}const _t=()=>L();return n.$$.update=()=>{var ne,Ne;n.$$.dirty[0]&4&&g.type==="view"&&(t(2,g.createRule=null,g),t(2,g.updateRule=null,g),t(2,g.deleteRule=null,g),t(2,g.indexes=[],g)),n.$$.dirty[0]&4194308&&g.name&&(m==null?void 0:m.name)!=g.name&&g.indexes.length>0&&t(2,g.indexes=(ne=g.indexes)==null?void 0:ne.map(Se=>j.replaceIndexTableName(Se,g.name)),g),n.$$.dirty[0]&4&&t(15,i=g.type===Ip),n.$$.dirty[0]&4&&t(14,l=g.type===Lp),n.$$.dirty[0]&32&&(a.schema||(Ne=a.options)!=null&&Ne.query?t(11,$=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,$="")),n.$$.dirty[0]&4&&t(13,s=!!g.id&&g.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Rr(g)),n.$$.dirty[0]&20&&t(12,r=!g.id||o),n.$$.dirty[0]&12&&k===Al&&g.type!=="auth"&&T(Ei)},[T,D,g,k,o,a,u,c,d,h,_,$,r,s,l,i,E,L,P,F,N,C,m,S,W,G,J,H,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce,De,ze,_t]}class Qa extends be{constructor(e){super(),_e(this,e,C5,T5,me,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function M5(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function O5(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function D5(n){let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,g;function h(S,$){return S[1]?O5:M5}let _=h(n),k=_(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=M(),u=b("span"),k.c(),p(t,"class",i=Jn(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(s,"class","txt m-r-auto"),p(u,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(u,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,$){w(S,e,$),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),y(e,u),k.m(u,null),m||(g=[ve(f=Fe.call(null,u,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),K(u,"click",fn(Ye(n[5]))),ve(ln.call(null,e))],m=!0)},p(S,[$]){var T;$&1&&i!==(i=Jn(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),$&1&&o!==(o=S[0].name+"")&&se(r,o),_!==(_=h(S))&&(k.d(1),k=_(S),k&&(k.c(),k.m(u,null))),f&&$t(f.update)&&$&2&&f.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),$&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),$&1&&d!==(d=S[0].name)&&p(e,"title",d),$&5&&x(e,"active",((T=S[2])==null?void 0:T.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),k.d(),m=!1,we(g)}}}function E5(n,e,t){let i,l;We(n,li,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?j.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class Xb extends be{constructor(e){super(),_e(this,e,E5,D5,me,{collection:0,pinnedIds:4})}}function Pp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Fp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Np(n){let e,t,i=[],l=new Map,s,o,r=pe(n[6]);const a=u=>u[22].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&64&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function qp(n){let e,t=[],i=new Map,l,s,o=n[6].length&&jp(),r=pe(n[5]);const a=u=>u[22].id;for(let u=0;uge(i,"pinnedIds",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&32&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function zp(n){let e;return{c(){e=b("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Vp(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),y(e,t),i||(l=K(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function A5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S=n[6].length&&Np(n),$=n[5].length&&qp(n),T=n[3].length&&!n[2].length&&zp(),C=!n[9]&&Vp(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='',s=M(),o=b("input"),r=M(),a=b("hr"),u=M(),f=b("div"),S&&S.c(),c=M(),$&&$.c(),d=M(),T&&T.c(),m=M(),C&&C.c(),g=ke(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[8]),x(f,"sidebar-content-compact",n[2].length>20)},m(D,O){w(D,e,O),y(e,t),y(t,i),y(i,l),y(t,s),y(t,o),ce(o,n[0]),w(D,r,O),w(D,a,O),w(D,u,O),w(D,f,O),S&&S.m(f,null),y(f,c),$&&$.m(f,null),y(f,d),T&&T.m(f,null),w(D,m,O),C&&C.m(D,O),w(D,g,O),h=!0,_||(k=[K(l,"click",n[12]),K(o,"input",n[13])],_=!0)},p(D,O){(!h||O&128)&&x(l,"hidden",!D[7]),O&1&&o.value!==D[0]&&ce(o,D[0]),(!h||O&128)&&x(t,"active",D[7]),D[6].length?S?(S.p(D,O),O&64&&A(S,1)):(S=Np(D),S.c(),A(S,1),S.m(f,c)):S&&(re(),I(S,1,1,()=>{S=null}),ae()),D[5].length?$?($.p(D,O),O&32&&A($,1)):($=qp(D),$.c(),A($,1),$.m(f,d)):$&&(re(),I($,1,1,()=>{$=null}),ae()),D[3].length&&!D[2].length?T||(T=zp(),T.c(),T.m(f,null)):T&&(T.d(1),T=null),(!h||O&256)&&x(f,"fade",D[8]),(!h||O&4)&&x(f,"sidebar-content-compact",D[2].length>20),D[9]?C&&(C.d(1),C=null):C?C.p(D,O):(C=Vp(D),C.c(),C.m(g.parentNode,g))},i(D){h||(A(S),A($),h=!0)},o(D){I(S),I($),h=!1},d(D){D&&(v(e),v(r),v(a),v(u),v(f),v(m),v(g)),S&&S.d(),$&&$.d(),T&&T.d(),C&&C.d(D),_=!1,we(k)}}}function I5(n){let e,t,i,l;e=new Wb({props:{class:"collection-sidebar",$$slots:{default:[A5]},$$scope:{ctx:n}}});let s={};return i=new Qa({props:s}),n[17](i),i.$on("save",n[18]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(A(e.$$.fragment,o),A(i.$$.fragment,o),l=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[17](null),V(i,o)}}}const Bp="@pinnedCollections";function L5(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function P5(n,e,t){let i,l,s,o,r,a,u,f,c;We(n,zn,L=>t(11,a=L)),We(n,li,L=>t(19,u=L)),We(n,Co,L=>t(8,f=L)),We(n,Ml,L=>t(9,c=L));let d,m="",g=[];_();function h(L){tn(li,u=L,u)}function _(){t(1,g=[]);try{const L=localStorage.getItem(Bp);L&&t(1,g=JSON.parse(L)||[])}catch{}}function k(){t(1,g=g.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function $(){m=this.value,t(0,m)}function T(L){g=L,t(1,g)}function C(L){g=L,t(1,g)}const D=()=>d==null?void 0:d.show();function O(L){te[L?"unshift":"push"](()=>{d=L,t(4,d)})}const E=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&h(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(k(),L5()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&g&&localStorage.setItem(Bp,JSON.stringify(g)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>g.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!g.includes(L.id)))},[m,g,s,i,d,r,o,l,f,c,h,a,S,$,T,C,D,O,E]}class F5 extends be{constructor(e){super(),_e(this,e,P5,I5,me,{})}}function Up(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Wp(n){n[18]=n[19].default}function Yp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Kp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Jp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,u,f,c=i&&Kp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ke(),c&&c.c(),l=M(),s=b("button"),r=Y(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,g){w(m,t,g),c&&c.m(m,g),w(m,l,g),w(m,s,g),y(s,r),y(s,a),u||(f=K(s,"click",d),u=!0)},p(m,g){e=m,g&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Kp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),g&8&&o!==(o=e[15].label+"")&&se(r,o),g&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),u=!1,f()}}}function Zp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:q5,then:R5,catch:N5,value:19,blocks:[,,,]};return su(t=n[15].component,l),{c(){e=ke(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&su(t,l)||I0(l,n,o)},i(s){i||(A(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];I(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function N5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function R5(n){Wp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){B(e.$$.fragment),t=M()},m(l,s){z(e,l,s),w(l,t,s),i=!0},p(l,s){Wp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(A(e.$$.fragment,l),i=!0)},o(l){I(e.$$.fragment,l),i=!1},d(l){l&&v(t),V(e,l)}}}function q5(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Gp(n,e){let t,i,l,s=e[5]===e[14]&&Zp(e);return{key:n,first:null,c(){t=ke(),s&&s.c(),i=ke(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&A(s,1)):(s=Zp(e),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(s),l=!0)},o(o){I(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function j5(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=h=>h[14];for(let h=0;hh[14];for(let h=0;hClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function z5(n){let e,t,i={class:"docs-panel",$$slots:{footer:[H5],default:[j5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function V5(n,e,t){const i={list:{label:"List/Search",component:st(()=>import("./ListApiDocs-8893d294.js"),["./ListApiDocs-8893d294.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:st(()=>import("./ViewApiDocs-23e66fca.js"),["./ViewApiDocs-23e66fca.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},create:{label:"Create",component:st(()=>import("./CreateApiDocs-585fc5d4.js"),["./CreateApiDocs-585fc5d4.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},update:{label:"Update",component:st(()=>import("./UpdateApiDocs-fc34c4b8.js"),["./UpdateApiDocs-fc34c4b8.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},delete:{label:"Delete",component:st(()=>import("./DeleteApiDocs-d2d1d4be.js"),["./DeleteApiDocs-d2d1d4be.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:st(()=>import("./RealtimeApiDocs-614048dc.js"),["./RealtimeApiDocs-614048dc.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:st(()=>import("./AuthWithPasswordDocs-0a927386.js"),["./AuthWithPasswordDocs-0a927386.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:st(()=>import("./AuthWithOAuth2Docs-c73de73c.js"),["./AuthWithOAuth2Docs-c73de73c.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},refresh:{label:"Auth refresh",component:st(()=>import("./AuthRefreshDocs-cba47500.js"),["./AuthRefreshDocs-cba47500.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},"request-verification":{label:"Request verification",component:st(()=>import("./RequestVerificationDocs-ac34ed9e.js"),["./RequestVerificationDocs-ac34ed9e.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:st(()=>import("./ConfirmVerificationDocs-4e703cc5.js"),["./ConfirmVerificationDocs-4e703cc5.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:st(()=>import("./RequestPasswordResetDocs-c3812420.js"),["./RequestPasswordResetDocs-c3812420.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:st(()=>import("./ConfirmPasswordResetDocs-0d3db4a6.js"),["./ConfirmPasswordResetDocs-0d3db4a6.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:st(()=>import("./RequestEmailChangeDocs-b1c5a122.js"),["./RequestEmailChangeDocs-b1c5a122.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:st(()=>import("./ConfirmEmailChangeDocs-88a7323c.js"),["./ConfirmEmailChangeDocs-88a7323c.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:st(()=>import("./AuthMethodsDocs-932fac77.js"),["./AuthMethodsDocs-932fac77.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:st(()=>import("./ListExternalAuthsDocs-baf81d9b.js"),["./ListExternalAuthsDocs-baf81d9b.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-2d478986.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:st(()=>import("./UnlinkExternalAuthDocs-1e98af12.js"),["./UnlinkExternalAuthDocs-1e98af12.js","./SdkTabs-821a5c7e.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(k){return t(2,o=k),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(k){t(5,r=k)}const d=()=>f(),m=k=>c(k);function g(k){te[k?"unshift":"push"](()=>{s=k,t(4,s)})}function h(k){Ee.call(this,n,k)}function _(k){Ee.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,g,h,_]}class B5 extends be{constructor(e){super(),_e(this,e,V5,z5,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function U5(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=ve(t=Fe.call(null,e,{text:n[0].join(` +`),position:"left"})),i=!0)},p(s,[o]){t&&$t(t.update)&&o&1&&t.update.call(null,{text:s[0].join(` +`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const Xp="yyyy-MM-dd HH:mm:ss.SSS";function W5(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,Xp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,Xp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Qb extends be{constructor(e){super(),_e(this,e,W5,U5,me,{model:1})}}function Y5(n){let e,t,i,l,s,o,r,a,u,f;return s=new rl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Y(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),y(e,t),y(t,i),n[6](t),y(e,l),z(s,e,null),y(e,o),y(e,r),a=!0,u||(f=[ve(Fe.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(A(s.$$.fragment,c),a=!0)},o(c){I(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),u=!1,we(f)}}}function K5(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[Y5]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new En({props:d}),te.push(()=>ge(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,g){w(m,e,g),y(e,t),y(e,i),z(l,e,null),a=!0,u||(f=ve(r=Fe.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[g]){const h={};g&518&&(h.$$scope={dirty:g,ctx:m}),!s&&g&8&&(s=!0,h.active=m[3],ye(()=>s=!1)),l.$set(h),(!a||g&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&$t(r.update)&&g&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(A(l.$$.fragment,m),a=!0)},o(m){I(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),u=!1,f()}}}function J5(n,e,t){const i=rt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class xb extends be{constructor(e){super(),_e(this,e,J5,K5,me,{class:0,length:5})}}function Z5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(m,g){w(m,e,g),y(e,t),y(e,i),y(e,l),w(m,o,g),w(m,r,g),ce(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,g){g&8192&&s!==(s=m[13])&&p(e,"for",s),g&4&&a!==(a=!m[2])&&p(r,"requried",a),g&4&&u!==(u=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",u),g&8192&&f!==(f=m[13])&&p(r,"id",f),g&1&&r.value!==m[0].username&&ce(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function G5(n){let e,t,i,l,s,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,g,h,_,k,S,$;return{c(){var T;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),u=b("span"),f=Y("Public: "),d=Y(c),g=M(),h=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(h,"type","email"),h.autofocus=n[2],p(h,"autocomplete","off"),p(h,"id",_=n[13]),h.required=k=(T=n[1].options)==null?void 0:T.requireEmail,p(h,"class","svelte-1751a4d")},m(T,C){w(T,e,C),y(e,t),y(e,i),y(e,l),w(T,o,C),w(T,r,C),y(r,a),y(a,u),y(u,f),y(u,d),w(T,g,C),w(T,h,C),ce(h,n[0].email),n[2]&&h.focus(),S||($=[ve(Fe.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",Ye(n[6])),K(h,"input",n[7])],S=!0)},p(T,C){var D;C&8192&&s!==(s=T[13])&&p(e,"for",s),C&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&se(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(h.autofocus=T[2]),C&8192&&_!==(_=T[13])&&p(h,"id",_),C&2&&k!==(k=(D=T[1].options)==null?void 0:D.requireEmail)&&(h.required=k),C&1&&h.value!==T[0].email&&ce(h,T[0].email)},d(T){T&&(v(e),v(o),v(r),v(g),v(h)),S=!1,we($)}}}function Qp(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[X5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function X5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function xp(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field required",name:"password",$$slots:{default:[Q5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[x5,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&8)&&x(t,"p-t-xs",f[3])},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function Q5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return c=new xb({props:{length:15}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(f,"class","form-field-addon")},m(h,_){w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,o,_),w(h,r,_),ce(r,n[0].password),w(h,u,_),w(h,f,_),z(c,f,null),d=!0,m||(g=K(r,"input",n[9]),m=!0)},p(h,_){(!d||_&8192&&s!==(s=h[13]))&&p(e,"for",s),(!d||_&8192&&a!==(a=h[13]))&&p(r,"id",a),_&1&&r.value!==h[0].password&&ce(r,h[0].password)},i(h){d||(A(c.$$.fragment,h),d=!0)},o(h){I(c.$$.fragment,h),d=!1},d(h){h&&(v(e),v(o),v(r),v(u),v(f)),V(c),m=!1,g()}}}function x5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[0].passwordConfirm),u||(f=K(r,"input",n[10]),u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&ce(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function eM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,l,f),y(l,s),r||(a=[K(e,"change",n[11]),K(e,"change",Ye(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function tM(n){var _;let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new he({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[Z5,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[G5,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}});let g=!n[2]&&Qp(n),h=(n[2]||n[3])&&xp(n);return d=new he({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[eM,({uniqueId:k})=>({13:k}),({uniqueId:k})=>k?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),g&&g.c(),u=M(),h&&h.c(),f=M(),c=b("div"),B(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(k,S){w(k,e,S),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),g&&g.m(a,null),y(a,u),h&&h.m(a,null),y(e,f),y(e,c),z(d,c,null),m=!0},p(k,[S]){var D;const $={};S&4&&($.class="form-field "+(k[2]?"":"required")),S&24581&&($.$$scope={dirty:S,ctx:k}),i.$set($);const T={};S&2&&(T.class="form-field "+((D=k[1].options)!=null&&D.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:k}),o.$set(T),k[2]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p(k,S),S&4&&A(g,1)):(g=Qp(k),g.c(),A(g,1),g.m(a,u)),k[2]||k[3]?h?(h.p(k,S),S&12&&A(h,1)):(h=xp(k),h.c(),A(h,1),h.m(a,null)):h&&(re(),I(h,1,1,()=>{h=null}),ae());const C={};S&24581&&(C.$$scope={dirty:S,ctx:k}),d.$set(C)},i(k){m||(A(i.$$.fragment,k),A(o.$$.fragment,k),A(g),A(h),A(d.$$.fragment,k),m=!0)},o(k){I(i.$$.fragment,k),I(o.$$.fragment,k),I(g),I(h),I(d.$$.fragment,k),m=!1},d(k){k&&v(e),V(i),V(o),g&&g.d(),h&&h.d(),V(d)}}}function nM(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function g(){i.verified=this.checked,t(0,i),t(3,r)}const h=_=>{s||an("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!_.target.checked,i)})};return n.$$set=_=>{"record"in _&&t(0,i=_.record),"collection"in _&&t(1,l=_.collection),"isNew"in _&&t(2,s=_.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),ii("password"),ii("passwordConfirm")))},[i,l,s,r,o,a,u,f,c,d,m,g,h]}class iM extends be{constructor(e){super(),_e(this,e,nM,tM,me,{record:0,collection:1,isNew:2})}}function lM(n){let e,t,i,l=[n[3]],s={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Vt(()=>(u(),()=>clearTimeout(a)));function c(m){te[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(3,l=Ze(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class oM extends be{constructor(e){super(),_e(this,e,sM,lM,me,{value:0,maxHeight:4})}}function rM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d;function m(h){n[2](h)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new oM({props:g}),te.push(()=>ge(f,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),B(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),z(f,h,_),d=!0},p(h,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(h[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=h[1].name+"")&&se(r,o),(!d||_&8&&a!==(a=h[3]))&&p(e,"for",a);const k={};_&8&&(k.id=h[3]),_&2&&(k.required=h[1].required),!c&&_&1&&(c=!0,k.value=h[0],ye(()=>c=!1)),f.$set(k)},i(h){d||(A(f.$$.fragment,h),d=!0)},o(h){I(f.$$.fragment,h),d=!1},d(h){h&&(v(e),v(u)),V(f,h)}}}function aM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[rM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function uM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class fM extends be{constructor(e){super(),_e(this,e,uM,aM,me,{field:1,value:0})}}function cM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_;return{c(){var k,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",m=(k=n[1].options)==null?void 0:k.min),p(f,"max",g=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(k,S){w(k,e,S),y(e,t),y(e,l),y(e,s),y(s,r),w(k,u,S),w(k,f,S),ce(f,n[0]),h||(_=K(f,"input",n[2]),h=!0)},p(k,S){var $,T;S&2&&i!==(i=j.getFieldTypeIcon(k[1].type))&&p(t,"class",i),S&2&&o!==(o=k[1].name+"")&&se(r,o),S&8&&a!==(a=k[3])&&p(e,"for",a),S&8&&c!==(c=k[3])&&p(f,"id",c),S&2&&d!==(d=k[1].required)&&(f.required=d),S&2&&m!==(m=($=k[1].options)==null?void 0:$.min)&&p(f,"min",m),S&2&&g!==(g=(T=k[1].options)==null?void 0:T.max)&&p(f,"max",g),S&1&&ut(f.value)!==k[0]&&ce(f,k[0])},d(k){k&&(v(e),v(u),v(f)),h=!1,_()}}}function dM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[cM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function pM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=ut(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class mM extends be{constructor(e){super(),_e(this,e,pM,dM,me,{field:1,value:0})}}function hM(n){let e,t,i,l,s=n[1].name+"",o,r,a,u;return{c(){e=b("input"),i=M(),l=b("label"),o=Y(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,l,c),y(l,o),a||(u=K(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&s!==(s=f[1].name+"")&&se(o,s),c&8&&r!==(r=f[3])&&p(l,"for",r)},d(f){f&&(v(e),v(i),v(l)),a=!1,u()}}}function gM(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[hM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _M(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class bM extends be{constructor(e){super(),_e(this,e,_M,gM,me,{field:1,value:0})}}function yM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),w(h,f,_),ce(f,n[0]),m||(g=K(f,"input",n[2]),m=!0)},p(h,_){_&2&&i!==(i=j.getFieldTypeIcon(h[1].type))&&p(t,"class",i),_&2&&o!==(o=h[1].name+"")&&se(r,o),_&8&&a!==(a=h[3])&&p(e,"for",a),_&8&&c!==(c=h[3])&&p(f,"id",c),_&2&&d!==(d=h[1].required)&&(f.required=d),_&1&&f.value!==h[0]&&ce(f,h[0])},d(h){h&&(v(e),v(u),v(f)),m=!1,g()}}}function kM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[yM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function vM(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class wM extends be{constructor(e){super(),_e(this,e,vM,kM,me,{field:1,value:0})}}function SM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(h,_){w(h,e,_),y(e,t),y(e,l),y(e,s),y(s,r),w(h,u,_),w(h,f,_),ce(f,n[0]),m||(g=K(f,"input",n[2]),m=!0)},p(h,_){_&2&&i!==(i=j.getFieldTypeIcon(h[1].type))&&p(t,"class",i),_&2&&o!==(o=h[1].name+"")&&se(r,o),_&8&&a!==(a=h[3])&&p(e,"for",a),_&8&&c!==(c=h[3])&&p(f,"id",c),_&2&&d!==(d=h[1].required)&&(f.required=d),_&1&&f.value!==h[0]&&ce(f,h[0])},d(h){h&&(v(e),v(u),v(f)),m=!1,g()}}}function TM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SM,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $M(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class CM extends be{constructor(e){super(),_e(this,e,$M,TM,me,{field:1,value:0})}}function em(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),y(e,t),i||(l=[ve(Fe.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,we(l)}}}function MM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_=n[0]&&!n[1].required&&em(n);function k(T){n[6](T)}function S(T){n[7](T)}let $={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&($.value=n[2]),n[0]!==void 0&&($.formattedValue=n[0]),d=new Xa({props:$}),te.push(()=>ge(d,"value",k)),te.push(()=>ge(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=Y(" (UTC)"),f=M(),_&&_.c(),c=M(),B(d.$$.fragment),p(t,"class",i=Jn(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",u=n[8])},m(T,C){w(T,e,C),y(e,t),y(e,l),y(e,s),y(s,r),y(s,a),w(T,f,C),_&&_.m(T,C),w(T,c,C),z(d,T,C),h=!0},p(T,C){(!h||C&2&&i!==(i=Jn(j.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!h||C&2)&&o!==(o=T[1].name+"")&&se(r,o),(!h||C&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,C):(_=em(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const D={};C&256&&(D.id=T[8]),!m&&C&4&&(m=!0,D.value=T[2],ye(()=>m=!1)),!g&&C&1&&(g=!0,D.formattedValue=T[0],ye(()=>g=!1)),d.$set(D)},i(T){h||(A(d.$$.fragment,T),h=!0)},o(T){I(d.$$.fragment,T),h=!1},d(T){T&&(v(e),v(f),v(c)),_&&_.d(T),V(d,T)}}}function OM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[MM,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DM(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class EM extends be{constructor(e){super(),_e(this,e,DM,OM,me,{field:1,value:0})}}function tm(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=Y("Select up to "),l=Y(i),s=Y(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),y(e,t),y(e,l),y(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(l,i)},d(o){o&&v(e)}}}function AM(n){var S,$,T,C,D,O;let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g;function h(E){n[3](E)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=(($=n[1].options)==null?void 0:$.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((D=(C=n[1].options)==null?void 0:C.values)==null?void 0:D.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new Gb({props:_}),te.push(()=>ge(f,"selected",h));let k=((O=n[1].options)==null?void 0:O.maxSelect)>1&&tm(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),B(f.$$.fragment),d=M(),k&&k.c(),m=ke(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(E,L){w(E,e,L),y(e,t),y(e,l),y(e,s),y(s,r),w(E,u,L),z(f,E,L),w(E,d,L),k&&k.m(E,L),w(E,m,L),g=!0},p(E,L){var P,F,N,q,W,G;(!g||L&2&&i!==(i=j.getFieldTypeIcon(E[1].type)))&&p(t,"class",i),(!g||L&2)&&o!==(o=E[1].name+"")&&se(r,o),(!g||L&16&&a!==(a=E[4]))&&p(e,"for",a);const R={};L&16&&(R.id=E[4]),L&6&&(R.toggle=!E[1].required||E[2]),L&4&&(R.multiple=E[2]),L&7&&(R.closable=!E[2]||((P=E[0])==null?void 0:P.length)>=((F=E[1].options)==null?void 0:F.maxSelect)),L&2&&(R.items=(N=E[1].options)==null?void 0:N.values),L&2&&(R.searchable=((W=(q=E[1].options)==null?void 0:q.values)==null?void 0:W.length)>5),!c&&L&1&&(c=!0,R.selected=E[0],ye(()=>c=!1)),f.$set(R),((G=E[1].options)==null?void 0:G.maxSelect)>1?k?k.p(E,L):(k=tm(E),k.c(),k.m(m.parentNode,m)):k&&(k.d(1),k=null)},i(E){g||(A(f.$$.fragment,E),g=!0)},o(E){I(f.$$.fragment,E),g=!1},d(E){E&&(v(e),v(u),v(d),v(m)),V(f,E),k&&k.d(E)}}}function IM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[AM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function LM(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class PM extends be{constructor(e){super(),_e(this,e,LM,IM,me,{field:1,value:0})}}function FM(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function NM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function RM(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function qM(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=Dt(l,s(n)),e.$on("change",n[5])),{c(){e&&B(e.$$.fragment),t=ke()},m(o,r){e&&z(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){re();const a=e;I(a.$$.fragment,1,0,()=>{V(a,1)}),ae()}l?(e=Dt(l,s(o)),e.$on("change",o[5]),B(e.$$.fragment),A(e.$$.fragment,1),z(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&A(e.$$.fragment,o),i=!0)},o(o){e&&I(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&V(e,o)}}}function jM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,g,h,_,k,S;function $(L,R){return L[4]?NM:FM}let T=$(n),C=T(n);const D=[qM,RM],O=[];function E(L,R){return L[3]?0:1}return m=E(n),g=O[m]=D[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),a=M(),u=b("span"),C.c(),d=M(),g.c(),h=ke(),p(t,"class",i=Jn(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),y(e,u),C.m(u,null),w(L,d,R),O[m].m(L,R),w(L,h,R),_=!0,k||(S=ve(f=Fe.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),k=!0)},p(L,R){(!_||R&2&&i!==(i=Jn(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||R&2)&&o!==(o=L[1].name+"")&&se(r,o),T!==(T=$(L))&&(C.d(1),C=T(L),C&&(C.c(),C.m(u,null))),f&&$t(f.update)&&R&16&&f.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!_||R&64&&c!==(c=L[6]))&&p(e,"for",c);let P=m;m=E(L),m===P?O[m].p(L,R):(re(),I(O[P],1,1,()=>{O[P]=null}),ae(),g=O[m],g?g.p(L,R):(g=O[m]=D[m](L),g.c()),A(g,1),g.m(h.parentNode,h))},i(L){_||(A(g),_=!0)},o(L){I(g),_=!1},d(L){L&&(v(e),v(d),v(h)),C.d(),O[m].d(L),k=!1,S()}}}function HM(n){let e,t;return e=new he({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[jM,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nm(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function zM(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function VM(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=nm(s);Vt(async()=>{try{t(3,o=(await st(()=>import("./CodeEditor-c4a370cf.js"),["./CodeEditor-c4a370cf.js","./index-102ce751.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=nm(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=zM(r))},[s,l,r,o,i,a]}class BM extends be{constructor(e){super(),_e(this,e,VM,HM,me,{field:1,value:0})}}function UM(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function WM(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),nn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(l,s){w(l,e,s)},p(l,s){s&4&&!nn(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function YM(n){let e;function t(s,o){return s[2]?WM:UM}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function KM(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class JM extends be{constructor(e){super(),_e(this,e,KM,YM,me,{file:0,size:1})}}function im(n){let e;function t(s,o){return s[4]==="image"?GM:ZM}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function ZM(n){let e,t;return{c(){e=b("object"),t=Y("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function GM(n){let e,t,i;return{c(){e=b("img"),nn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!nn(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function XM(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&im(n);return{c(){i&&i.c(),t=ke()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=im(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function QM(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function xM(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("a"),t=Y(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=K(a,"click",n[0]),u=!0)},p(c,d){d&4&&se(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),u=!1,f()}}}function eO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[xM],header:[QM],default:[XM]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&1054&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[7](null),V(e,l)}}}function tO(n,e,t){let i,l,s,o,r="";function a(m){m!==""&&(t(1,r=m),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(m){te[m?"unshift":"push"](()=>{o=m,t(3,o)})}function c(m){Ee.call(this,n,m)}function d(m){Ee.call(this,n,m)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[u,r,l,o,s,a,i,f,c,d]}class nO extends be{constructor(e){super(),_e(this,e,tO,eO,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function iO(n){let e,t,i,l,s;function o(u,f){return u[3]==="image"?rO:u[3]==="video"||u[3]==="audio"?oO:sO}let r=o(n),a=r(n);return{c(){e=b("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){w(u,e,f),a.m(e,null),l||(s=K(e,"click",fn(n[11])),l=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&v(e),a.d(),l=!1,s()}}}function lO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function sO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function rO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),nn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),l||(s=K(e,"error",n[8]),l=!0)},p(o,r){r&32&&!nn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function lm(n){let e,t,i={};return e=new nO({props:i}),n[12](e),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function aO(n){let e,t,i;function l(a,u){return a[2]?lO:iO}let s=l(n),o=s(n),r=n[7]&&lm(n);return{c(){o.c(),e=M(),r&&r.c(),t=ke()},m(a,u){o.m(a,u),w(a,e,u),r&&r.m(a,u),w(a,t,u),i=!0},p(a,[u]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&A(r,1)):(r=lm(a),r.c(),A(r,1),r.m(t.parentNode,t)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){i||(A(r),i=!0)},o(a){I(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function uO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;m();async function m(){t(2,d=!0);try{t(10,c=await ue.getAdminFileToken(s.collectionId))}catch(k){console.warn("File token failure:",k)}t(2,d=!1)}function g(){t(5,u="")}const h=k=>{l&&(k.preventDefault(),a==null||a.show(f))};function _(k){te[k?"unshift":"push"](()=>{a=k,t(4,a)})}return n.$$set=k=>{"record"in k&&t(9,s=k.record),"filename"in k&&t(0,o=k.filename),"size"in k&&t(1,r=k.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":ue.files.getUrl(s,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":ue.files.getUrl(s,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,l,g,s,c,h,_]}class xa extends be{constructor(e){super(),_e(this,e,uO,aO,me,{record:9,filename:0,size:1})}}function sm(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function om(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const l=i[2].includes(i[34]);return i[35]=l,i}function fO(n){let e,t,i;function l(){return n[17](n[34])}return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[ve(Fe.call(null,e,"Remove file")),K(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function cO(n){let e,t,i;function l(){return n[16](n[34])}return{c(){e=b("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=K(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function dO(n){let e,t,i,l,s,o,r=n[34]+"",a,u,f,c,d,m;i=new xa({props:{record:n[3],filename:n[34]}});function g(k,S){return k[35]?cO:fO}let h=g(n),_=h(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("a"),a=Y(r),c=M(),d=b("div"),_.c(),x(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=ue.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(s,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(k,S){w(k,e,S),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),y(o,a),y(e,c),y(e,d),_.m(d,null),m=!0},p(k,S){const $={};S[0]&8&&($.record=k[3]),S[0]&32&&($.filename=k[34]),i.$set($),(!m||S[0]&36)&&x(t,"fade",k[35]),(!m||S[0]&32)&&r!==(r=k[34]+"")&&se(a,r),(!m||S[0]&1064&&u!==(u=ue.files.getUrl(k[3],k[34],{token:k[10]})))&&p(o,"href",u),(!m||S[0]&36&&f!==(f="txt-ellipsis "+(k[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),h===(h=g(k))&&_?_.p(k,S):(_.d(1),_=h(k),_&&(_.c(),_.m(d,null))),(!m||S[1]&2)&&x(e,"dragging",k[32]),(!m||S[1]&4)&&x(e,"dragover",k[33])},i(k){m||(A(i.$$.fragment,k),m=!0)},o(k){I(i.$$.fragment,k),m=!1},d(k){k&&v(e),V(i),_.d()}}}function rm(n,e){let t,i,l,s;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[dO,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Ls({props:r}),te.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.list=e[0],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function pO(n){let e,t,i,l,s,o,r,a,u=n[29].name+"",f,c,d,m,g,h,_;i=new JM({props:{file:n[29]}});function k(){return n[19](n[31])}return{c(){e=b("div"),t=b("figure"),B(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),f=Y(u),d=M(),m=b("button"),m.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[29].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[32]),x(e,"dragover",n[33])},m(S,$){w(S,e,$),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),y(s,r),y(s,a),y(a,f),y(e,d),y(e,m),g=!0,h||(_=[ve(Fe.call(null,m,"Remove file")),K(m,"click",k)],h=!0)},p(S,$){n=S;const T={};$[0]&2&&(T.file=n[29]),i.$set(T),(!g||$[0]&2)&&u!==(u=n[29].name+"")&&se(f,u),(!g||$[0]&2&&c!==(c=n[29].name))&&p(s,"title",c),(!g||$[1]&2)&&x(e,"dragging",n[32]),(!g||$[1]&4)&&x(e,"dragover",n[33])},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){I(i.$$.fragment,S),g=!1},d(S){S&&v(e),V(i),h=!1,we(_)}}}function am(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[pO,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Ls({props:r}),te.push(()=>ge(i,"list",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&2&&(l=!0,f.list=e[1],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function mO(n){let e,t,i,l,s,o=n[4].name+"",r,a,u,f,c=[],d=new Map,m,g=[],h=new Map,_,k,S,$,T,C,D,O,E,L,R,P,F=pe(n[5]);const N=G=>G[34]+G[3].id;for(let G=0;GG[29].name+G[31];for(let G=0;G({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),z(t,e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=` + form-field form-field-list form-field-file + `+(o[4].required?"required":"")+` + `+(o[9]?"dragover":"")+` + `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){I(t.$$.fragment,o),i=!1},d(o){o&&v(e),V(t),l=!1,we(s)}}}function gO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,g="";function h(W){j.removeByValue(f,W),t(2,f)}function _(W){j.pushUnique(f,W),t(2,f)}function k(W){j.isEmpty(u[W])||u.splice(W,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(W){var J,H;W.preventDefault(),t(9,m=!1);const G=((J=W.dataTransfer)==null?void 0:J.files)||[];if(!(s||!G.length)){for(const U of G){const le=l.length+u.length-f.length;if(((H=r.options)==null?void 0:H.maxSelect)<=le)break;u.push(U)}t(1,u)}}Vt(async()=>{t(10,g=await ue.getAdminFileToken(o.collectionId))});const T=W=>h(W),C=W=>_(W);function D(W){a=W,t(0,a),t(6,i),t(4,r)}const O=W=>k(W);function E(W){u=W,t(1,u)}function L(W){te[W?"unshift":"push"](()=>{c=W,t(7,c)})}const R=()=>{for(let W of c.files)u.push(W);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function F(W){te[W?"unshift":"push"](()=>{d=W,t(8,d)})}const N=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=W=>{"record"in W&&t(3,o=W.record),"field"in W&&t(4,r=W.field),"value"in W&&t(0,a=W.value),"uploadedFiles"in W&&t(1,u=W.uploadedFiles),"deletedFileNames"in W&&t(2,f=W.deletedFileNames)},n.$$.update=()=>{var W,G;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=j.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((W=r.options)==null?void 0:W.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&((G=r.options)==null?void 0:G.maxSelect)<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,g,s,h,_,k,$,T,C,D,O,E,L,R,P,F,N,q]}class _O extends be{constructor(e){super(),_e(this,e,gO,hO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function um(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function bO(n,e){e=um(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=um(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function fm(n,e,t){const i=n.slice();i[5]=e[t];const l=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=l,i}function cm(n,e,t){const i=n.slice();return i[9]=e[t],i}function dm(n){let e,t;return e=new xa({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&5&&(s.filename=i[9]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function pm(n){let e=!j.isEmpty(n[9]),t,i,l=e&&dm(n);return{c(){l&&l.c(),t=ke()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&5&&(e=!j.isEmpty(s[9])),e?l?(l.p(s,o),o&5&&A(l,1)):(l=dm(s),l.c(),A(l,1),l.m(t.parentNode,t)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(s){i||(A(l),i=!0)},o(s){I(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function mm(n){let e,t,i=pe(n[6]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;oI(m[h],1,1,()=>{m[h]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let h=0;ht(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,u,f,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,l=((u=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:u.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,s=((c=(f=i==null?void 0:i.schema)==null?void 0:f.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,s,l,i,o]}class ir extends be{constructor(e){super(),_e(this,e,kO,yO,me,{record:0})}}function hm(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function gm(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function _m(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function bm(n){let e,t=!n[13]&&ym(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=ym(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function ym(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&km(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),y(e,t),y(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=km(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function km(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function vO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function wO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function vm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),y(e,t),i||(l=[ve(Fe.call(null,t,"Edit")),K(t,"keydown",fn(n[27])),K(t,"click",fn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,we(l)}}}function wm(n,e){let t,i,l,s,o,r,a,u;function f(_,k){return _[6]?wO:vO}let c=f(e),d=c(e);s=new ir({props:{record:e[49]}});let m=!e[11]&&vm(e);function g(){return e[33](e[49])}function h(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),B(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,k){w(_,t,k),d.m(t,null),y(t,i),y(t,l),z(s,l,null),y(t,o),m&&m.m(t,null),r=!0,a||(u=[K(t,"click",g),K(t,"keydown",h)],a=!0)},p(_,k){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};k[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,k):(m=vm(e),m.c(),m.m(t,null)),(!r||k[0]&768)&&x(t,"selected",e[6]),(!r||k[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(s.$$.fragment,_),r=!0)},o(_){I(s.$$.fragment,_),r=!1},d(_){_&&v(t),d.d(),V(s),m&&m.d(),a=!1,we(u)}}}function Sm(n){let e;return{c(){e=b("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Tm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=Y("("),i=Y(t),l=Y(" of MAX "),s=Y(n[4]),o=Y(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function SO(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function TO(n){let e,t,i=pe(n[6]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,c){w(f,e,c),z(t,e,null),y(e,i),y(e,l),w(f,s,c),o=!0,r||(a=K(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){I(t.$$.fragment,f),o=!1},d(f){f&&(v(e),v(s)),V(t),r=!1,a()}}}function $m(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[$O,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Ls({props:s}),te.push(()=>ge(e,"list",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CO(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,g,h,_,k,S,$;t=new Ds({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&_m(n),C=pe(n[8]);const D=N=>N[49].id;for(let N=0;N1&&Tm(n);const R=[TO,SO],P=[];function F(N,q){return N[6].length?0:1}return g=F(n),h=P[g]=R[g](n),{c(){e=b("div"),B(t.$$.fragment),i=M(),T&&T.c(),l=M(),s=b("div");for(let N=0;N1?L?L.p(N,q):(L=Tm(N),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let G=g;g=F(N),g===G?P[g].p(N,q):(re(),I(P[G],1,1,()=>{P[G]=null}),ae(),h=P[g],h?h.p(N,q):(h=P[g]=R[g](N),h.c()),A(h,1),h.m(_.parentNode,_))},i(N){if(!k){A(t.$$.fragment,N);for(let q=0;qCancel',t=M(),i=b("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[28]),K(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function DO(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[OO],header:[MO],default:[CO]},$$scope:{ctx:n}};for(let a=0;at(26,m=Se));const g=rt(),h="picker_"+j.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",C=[],D=[],O=1,E=0,L=!1,R=!1;function P(){return t(2,T=""),t(8,C=[]),t(6,D=[]),N(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function N(){const Se=j.toArray(_);if(!l||!Se.length)return;t(24,R=!0);let mt=[];const Bt=Se.slice(),cn=[];for(;Bt.length>0;){const on=[];for(const Vn of Bt.splice(0,so))on.push(`id="${Vn}"`);cn.push(ue.collection(l).getFullList({batch:so,filter:on.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(cn).then(on=>{mt=mt.concat(...on)}),t(6,D=[]);for(const on of Se){const Vn=j.findByKey(mt,"id",on);Vn&&D.push(Vn)}T.trim()||t(8,C=j.filterDuplicatesByKey(D.concat(C))),t(24,R=!1)}catch(on){on.isAbort||(ue.error(on),t(24,R=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&(T.trim()?t(8,C=[]):t(8,C=j.toArray(D).slice()));try{const mt=Se?1:O+1,Bt=j.getAllCollectionIdentifiers(s),cn=await ue.collection(l).getList(mt,so,{filter:j.normalizeSearchFilter(T,Bt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:h+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(cn.items))),O=cn.page,t(23,E=cn.items.length),t(3,L=!1)}catch(mt){mt.isAbort||(ue.error(mt),t(3,L=!1))}}}function W(Se){i==1?t(6,D=[Se]):u&&(j.pushOrReplaceByKey(D,Se),t(6,D))}function G(Se){j.removeByKey(D,"id",Se.id),t(6,D)}function J(Se){f(Se)?G(Se):W(Se)}function H(){var Se;i!=1?t(20,_=D.map(mt=>mt.id)):t(20,_=((Se=D==null?void 0:D[0])==null?void 0:Se.id)||""),g("save",D),F()}function U(Se){Ee.call(this,n,Se)}const le=()=>F(),ee=()=>H(),oe=Se=>t(2,T=Se.detail),Te=()=>$==null?void 0:$.show(),je=Se=>$==null?void 0:$.show(Se),Ve=Se=>J(Se),Qe=(Se,mt)=>{(mt.code==="Enter"||mt.code==="Space")&&(mt.preventDefault(),mt.stopPropagation(),J(Se))},tt=()=>t(2,T=""),Ge=()=>{a&&!L&&q()},Mt=Se=>G(Se);function Pt(Se){D=Se,t(6,D)}function Ce(Se){te[Se?"unshift":"push"](()=>{S=Se,t(1,S)})}function De(Se){Ee.call(this,n,Se)}function ze(Se){Ee.call(this,n,Se)}function _t(Se){te[Se?"unshift":"push"](()=>{$=Se,t(7,$)})}const ne=Se=>{j.removeByKey(C,"id",Se.detail.record.id),C.unshift(Se.detail.record),t(8,C),W(Se.detail.record)},Ne=Se=>{j.removeByKey(C,"id",Se.detail.id),t(8,C),G(Se.detail)};return n.$$set=Se=>{e=Pe(Pe({},e),Kt(Se)),t(19,d=Ze(e,c)),"value"in Se&&t(20,_=Se.value),"field"in Se&&t(21,k=Se.field)},n.$$.update=()=>{var Se,mt;n.$$.dirty[0]&2097152&&t(4,i=((Se=k==null?void 0:k.options)==null?void 0:Se.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(mt=k==null?void 0:k.options)==null?void 0:mt.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(Bt=>Bt.id==l)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=E==so),n.$$.dirty[0]&80&&t(10,u=i===null||i>D.length),n.$$.dirty[0]&64&&t(9,f=function(Bt){return j.findByKey(D,"id",Bt.id)})},[F,S,T,L,i,s,D,$,C,f,u,o,a,r,q,W,G,J,H,d,_,k,P,E,R,l,m,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne]}class AO extends be{constructor(e){super(),_e(this,e,EO,DO,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function Cm(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function Mm(n,e,t){const i=n.slice();return i[26]=e[t],i}function Om(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=ve(t=Fe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&$t(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function Dm(n){let e,t=n[5]&&Em(n);return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=Em(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Em(n){let e,t=pe(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function IO(n){let e,t,i,l,s,o,r,a,u,f;i=new ir({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),y(e,t),z(i,t,null),y(e,l),y(e,s),y(s,o),w(d,r,m),a=!0,u||(f=[ve(Fe.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(d,m){n=d;const g={};m&16&&(g.record=n[21]),i.$set(g),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){I(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),V(i),u=!1,we(f)}}}function Im(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[IO,({dragging:a,dragover:u})=>({24:a,25:u}),({dragging:a,dragover:u})=>(a?16777216:0)|(u?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Ls({props:r}),te.push(()=>ge(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[23]),u&128&&(f.disabled=!e[7]),u&587202576&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function LO(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m=[],g=new Map,h,_,k,S,$,T,C=n[6].length&&Om(n),D=pe(n[4]);const O=L=>L[21].id;for(let L=0;L Open picker',p(t,"class",i=Jn(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(k,"type","button"),p(k,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),y(e,t),y(e,l),y(e,s),y(s,r),y(e,a),C&&C.m(e,null),w(L,f,R),w(L,c,R),y(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new he({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new AO({props:o}),n[16](i),i.$on("save",n[17]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&537919735&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(A(e.$$.fragment,r),A(i.$$.fragment,r),l=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const Lm=100;function FO(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const O=j.toArray(s);return t(4,a=a.filter(E=>O.includes(E.id))),O.length!=a.length}async function m(){var R,P;const O=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!O.length){t(5,u=!1);return}t(5,u=!0);const E=O.slice(),L=[];for(;E.length>0;){const F=[];for(const N of E.splice(0,Lm))F.push(`id="${N}"`);L.push(ue.collection((P=l==null?void 0:l.options)==null?void 0:P.collectionId).getFullList(Lm,{filter:F.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let F=[];await Promise.all(L).then(N=>{F=F.concat(...N)});for(const N of O){const q=j.findByKey(F,"id",N);q?a.push(q):c.push(N)}t(4,a),h()}catch(F){ue.error(F)}t(5,u=!1)}function g(O){j.removeByKey(a,"id",O.id),t(4,a),h()}function h(){var O;i?t(0,s=a.map(E=>E.id)):t(0,s=((O=a[0])==null?void 0:O.id)||"")}Ts(()=>{clearTimeout(f)});const _=O=>g(O);function k(O){a=O,t(4,a)}const S=()=>{h()},$=()=>o==null?void 0:o.show();function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function C(O){te[O?"unshift":"push"](()=>{o=O,t(1,o)})}const D=O=>{var E;t(4,a=O.detail||[]),t(0,s=i?a.map(L=>L.id):((E=a[0])==null?void 0:E.id)||"")};return n.$$set=O=>{"field"in O&&t(2,l=O.field),"value"in O&&t(0,s=O.value),"picker"in O&&t(1,o=O.picker)},n.$$.update=()=>{var O;n.$$.dirty&4&&t(7,i=((O=l.options)==null?void 0:O.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(m,0)))},[s,o,l,r,a,u,c,i,g,h,f,_,k,S,$,T,C,D]}class NO extends be{constructor(e){super(),_e(this,e,FO,PO,me,{field:2,value:0,picker:1})}}function RO(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),S0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function qO(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function jO(n){let e;function t(s,o){return s[1]?qO:RO}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function HO(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let zO=HO();function qr(){return window&&window.tinymce?window.tinymce:null}function VO(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(E,L)=>{d.forEach(R=>{E.on(R,P=>{L(R.toLowerCase(),{eventName:R,event:P,editor:E})})})};let g,h,_,k=u,S=s;const $=rt();function T(){const E={...r,target:h,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,_=L),L.on("init",()=>{L.setContent(u),L.on(a,()=>{t(12,k=L.getContent()),k!==u&&(t(5,u=k),t(6,f=L.getContent({format:"text"})))})}),m(L,$),typeof r.setup=="function"&&r.setup(L)}};t(4,h.style.visibility="",h),qr().init(E)}Vt(()=>(qr()!==null?T():zO.load(g.ownerDocument,o,()=>{g&&T()}),()=>{var E;try{_&&((E=qr())==null||E.remove(_))}catch{}}));function C(E){te[E?"unshift":"push"](()=>{h=E,t(4,h)})}function D(E){te[E?"unshift":"push"](()=>{h=E,t(4,h)})}function O(E){te[E?"unshift":"push"](()=>{g=E,t(3,g)})}return n.$$set=E=>{"id"in E&&t(0,i=E.id),"inline"in E&&t(1,l=E.inline),"disabled"in E&&t(7,s=E.disabled),"scriptSrc"in E&&t(8,o=E.scriptSrc),"conf"in E&&t(9,r=E.conf),"modelEvents"in E&&t(10,a=E.modelEvents),"value"in E&&t(5,u=E.value),"text"in E&&t(6,f=E.text),"cssClass"in E&&t(2,c=E.cssClass)},n.$$.update=()=>{var E;if(n.$$.dirty&14496)try{_&&k!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&s!==S&&(t(13,S=s),typeof((E=_.mode)==null?void 0:E.set)=="function"?_.mode.set(s?"readonly":"design"):_.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,g,h,u,f,s,o,r,a,_,k,S,C,D,O]}class eu extends be{constructor(e){super(),_e(this,e,VO,jO,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function Pm(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Fm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Nm(n,e,t){const i=n.slice();return i[51]=e[t],i}function BO(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,g,h,_=pe(n[7]);const k=S=>S[51].id;for(let S=0;S<_.length;S+=1){let $=Nm(n,_,S),T=k($);l.set(T,i[S]=Rm(T,$))}return a=new Ds({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new xo({props:{class:"files-list",vThreshold:100,$$slots:{default:[ZO]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;SNew record',c=M(),B(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,$){w(S,e,$),y(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Rm(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=Y(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),y(t,l),y(t,s),o||(r=K(t,"click",Ye(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&se(l,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&v(t),o=!1,r()}}}function WO(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&qm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),y(e,t),y(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=qm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function YO(n){let e=[],t=new Map,i,l=pe(n[5]);const s=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ye(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function KO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JO(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),nn(e.src,t=ue.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!nn(e.src,t=ue.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function jm(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(f[48])),t?JO:KO}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),y(e,i),s||(o=[ve(l=Fe.call(null,e,n[48]+` +(record: `+n[44].id+")")),K(e,"click",Ye(function(){$t(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&$t(l.update)&&c[0]&32&&l.update.call(null,n[48]+` +(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,we(o)}}}function Hm(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ZO(n){let e,t;function i(r,a){if(r[15])return YO;if(!r[6])return WO}let l=i(n),s=l&&l(n),o=n[6]&&zm();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ke()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=zm(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function GO(n){let e,t,i,l;const s=[UO,BO],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function XO(n){let e,t;return{c(){e=b("h4"),t=Y(n[0])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&1&&se(t,i[0])},d(i){i&&v(e)}}}function Vm(n){let e,t;return e=new he({props:{class:"form-field file-picker-size-select",$$slots:{default:[QO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QO(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new _i({props:s}),te.push(()=>ge(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function xO(n){var g;let e,t,i,l=j.hasImageExtension((g=n[9])==null?void 0:g.name),s,o,r,a,u,f,c,d,m=l&&Vm(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=Y(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(h,_){w(h,e,_),y(e,t),w(h,i,_),m&&m.m(h,_),w(h,s,_),w(h,o,_),y(o,r),y(r,a),f=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(h,_){var k;(!f||_[0]&64)&&(e.disabled=h[6]),_[0]&512&&(l=j.hasImageExtension((k=h[9])==null?void 0:k.name)),l?m?(m.p(h,_),_[0]&512&&A(m,1)):(m=Vm(h),m.c(),A(m,1),m.m(s.parentNode,s)):m&&(re(),I(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&se(a,h[1]),(!f||_[0]&8192&&u!==(u=!h[13]))&&(o.disabled=u)},i(h){f||(A(m),f=!0)},o(h){I(m),f=!1},d(h){h&&(v(e),v(i),v(s),v(o)),m&&m.d(h),c=!1,we(d)}}}function eD(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[xO],header:[XO],default:[GO]},$$scope:{ctx:n}};for(let a=0;at(27,u=De));const f=rt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:g=["image","document","video","audio","file"]}=e,h,_,k="",S=[],$=1,T=0,C=!1,D=[],O=[],E=[],L={},R={},P="";function F(){return G(!0),h==null?void 0:h.show()}function N(){return h==null?void 0:h.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,P="")}function W(){t(4,k="")}async function G(De=!1){if(L!=null&&L.id){t(6,C=!0),De&&q();try{const ze=De?1:$+1,_t=j.getAllCollectionIdentifiers(L);let ne=j.normalizeSearchFilter(k,_t)||"";ne&&(ne+=" && "),ne+="("+O.map(Se=>`${Se.name}:length>0`).join("||")+")";const Ne=await ue.collection(L.id).getList(ze,Bm,{filter:ne,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(Ne.items))),$=Ne.page,t(26,T=Ne.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(ue.error(ze),t(6,C=!1))}}}function J(){var ze,_t;let De=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const ne of O)if(j.toArray(R.record[ne.name]).includes(R.name)){De=De.concat(j.toArray((_t=ne.options)==null?void 0:_t.thumbs));break}}t(11,E=[{label:"Original size",value:""}]);for(const ne of De)E.push({label:`${ne} thumb`,value:ne});P&&!De.includes(P)&&t(12,P="")}function H(De){let ze=[];for(const _t of O){const ne=j.toArray(De[_t.name]);for(const Ne of ne)g.includes(j.getFileType(Ne))&&ze.push(Ne)}return ze}function U(De,ze){t(9,R={record:De,name:ze})}function le(){o&&(f("submit",Object.assign({size:P},R)),N())}function ee(De){P=De,t(12,P)}const oe=De=>{t(8,L=De)},Te=De=>t(4,k=De.detail),je=()=>_==null?void 0:_.show(),Ve=()=>{s&&G()};function Qe(De){te[De?"unshift":"push"](()=>{h=De,t(3,h)})}function tt(De){Ee.call(this,n,De)}function Ge(De){Ee.call(this,n,De)}function Mt(De){te[De?"unshift":"push"](()=>{_=De,t(10,_)})}const Pt=De=>{j.removeByKey(S,"id",De.detail.record.id),S.unshift(De.detail.record),t(5,S);const ze=H(De.detail.record);ze.length>0&&U(De.detail.record,ze[0])},Ce=De=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==De.detail.id&&t(9,R={}),j.removeByKey(S,"id",De.detail.id),t(5,S)};return n.$$set=De=>{e=Pe(Pe({},e),Kt(De)),t(22,a=Ze(e,r)),"title"in De&&t(0,d=De.title),"submitText"in De&&t(1,m=De.submitText),"fileTypes"in De&&t(24,g=De.fileTypes)},n.$$.update=()=>{var De;n.$$.dirty[0]&134217728&&t(7,D=u.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(_t=>{var ne,Ne,Se,mt,Bt;return _t.type==="file"&&!((ne=_t.options)!=null&&ne.protected)&&(!((Se=(Ne=_t.options)==null?void 0:Ne.mimeTypes)!=null&&Se.length)||!!((Bt=(mt=_t.options)==null?void 0:mt.mimeTypes)!=null&&Bt.find(cn=>cn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&D.length>0&&t(8,L=D[0]),n.$$.dirty[0]&256&&(O=(De=L==null?void 0:L.schema)==null?void 0:De.filter(ze=>{var _t;return ze.type==="file"&&!((_t=ze.options)!=null&&_t.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(W(),J()),n.$$.dirty[0]&512&&R!=null&&R.name&&J(),n.$$.dirty[0]&280&&typeof k<"u"&&L!=null&&L.id&&h!=null&&h.isActive()&&G(!0),n.$$.dirty[0]&512&&t(16,i=(ze,_t)=>{var ne;return(R==null?void 0:R.name)==_t&&((ne=R==null?void 0:R.record)==null?void 0:ne.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>H(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&T==Bm),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,N,h,k,S,C,D,L,R,_,E,P,o,s,l,i,W,G,H,U,le,a,c,g,F,T,u,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt,Ce]}class nD extends be{constructor(e){super(),_e(this,e,tD,eD,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function iD(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function lD(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new eu({props:s}),te.push(()=>ge(e,"value",l)),e.$on("init",n[7]),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function sD(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m;const g=[lD,iD],h=[];function _(k,S){return k[4]?0:1}return f=_(n),c=h[f]=g[f](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Y(o),u=M(),c.c(),d=ke(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(k,S){w(k,e,S),y(e,t),y(e,l),y(e,s),y(s,r),w(k,u,S),h[f].m(k,S),w(k,d,S),m=!0},p(k,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(k[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=k[1].name+"")&&se(r,o),(!m||S&2048&&a!==(a=k[11]))&&p(e,"for",a);let $=f;f=_(k),f===$?h[f].p(k,S):(re(),I(h[$],1,1,()=>{h[$]=null}),ae(),c=h[f],c?c.p(k,S):(c=h[f]=g[f](k),c.c()),A(c,1),c.m(d.parentNode,d))},i(k){m||(A(c),m=!0)},o(k){I(c),m=!1},d(k){k&&(v(e),v(u),v(d)),h[f].d(k)}}}function oD(n){let e,t,i,l;e=new he({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[sD,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new nD({props:s}),n[8](i),i.$on("submit",n[9]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(o,r){z(e,o,r),w(o,t,r),z(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(A(e.$$.fragment,o),A(i.$$.fragment,o),l=!0)},o(o){I(e.$$.fragment,o),I(i.$$.fragment,o),l=!1},d(o){o&&v(t),V(e,o),n[8](null),V(i,o)}}}function rD(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Vt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(g){s=g,t(0,s)}const c=g=>{t(3,r=g.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(g){te[g?"unshift":"push"](()=>{o=g,t(2,o)})}const m=g=>{r==null||r.execCommand("InsertImage",!1,ue.files.getUrl(g.detail.record,g.detail.name,{thumb:g.detail.size}))};return n.$$set=g=>{"field"in g&&t(1,l=g.field),"value"in g&&t(0,s=g.value)},n.$$.update=()=>{var g;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(g=l.options)==null?void 0:g.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class aD extends be{constructor(e){super(),_e(this,e,rD,oD,me,{field:1,value:0})}}function uD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].authUrl),r||(a=K(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authUrl&&ce(s,u[0].authUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function fD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].tokenUrl),r||(a=K(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenUrl&&ce(s,u[0].tokenUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function cD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].userApiUrl),r||(a=K(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userApiUrl&&ce(s,u[0].userApiUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function dD(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[uD,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[fD,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new he({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[cD,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=Y(n[2]),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),y(e,t),w(f,i,c),z(l,f,c),w(f,s,c),z(o,f,c),w(f,r,c),z(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const g={};c&8&&(g.class="form-field "+(f[3]?"required":"")),c&2&&(g.name=f[1]+".userApiUrl"),c&777&&(g.$$scope={dirty:c,ctx:f}),a.$set(g)},i(f){u||(A(l.$$.fragment,f),A(o.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){I(l.$$.fragment,f),I(o.$$.fragment,f),I(a.$$.fragment,f),u=!1},d(f){f&&(v(e),v(i),v(s),v(r)),V(l,f),V(o,f),V(a,f)}}}function pD(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function u(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class _l extends be{constructor(e){super(),_e(this,e,pD,dD,me,{key:1,config:0,required:4,title:2})}}function mD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Auth URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[0].authUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&ce(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function hD(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Token URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[0].tokenUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&ce(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function gD(n){let e,t,i,l,s,o;return i=new he({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[mD,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new he({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[hD,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(A(i.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(i.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),V(i,r),V(s,r)}}}function _D(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class bD extends be{constructor(e){super(),_e(this,e,_D,gD,me,{key:1,config:0})}}function yD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[2]),r||(a=K(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function kD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[3]),r||(a=K(s,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&8&&s.value!==u[3]&&ce(s,u[3])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function vD(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[4]),r||(a=K(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&16&&s.value!==u[4]&&ce(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function wD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",bo),r.required=!0},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[6]),u||(f=[ve(Fe.call(null,l,{text:`Max ${bo} seconds (~${bo/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&ce(r,c[6])},d(c){c&&(v(e),v(o),v(r)),u=!1,we(f)}}}function SD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Private key"),l=M(),s=b("textarea"),r=M(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY----- +... +-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[5]),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&ce(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function TD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S;return l=new he({props:{class:"form-field required",name:"clientId",$$slots:{default:[yD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"teamId",$$slots:{default:[kD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new he({props:{class:"form-field required",name:"keyId",$$slots:{default:[vD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new he({props:{class:"form-field required",name:"duration",$$slots:{default:[wD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),h=new he({props:{class:"form-field required",name:"privateKey",$$slots:{default:[SD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),g=M(),B(h.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){w($,e,T),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,u),z(f,u,null),y(t,c),y(t,d),z(m,d,null),y(t,g),z(h,t,null),_=!0,k||(S=K(e,"submit",Ye(n[17])),k=!0)},p($,T){const C={};T&25165828&&(C.$$scope={dirty:T,ctx:$}),l.$set(C);const D={};T&25165832&&(D.$$scope={dirty:T,ctx:$}),r.$set(D);const O={};T&25165840&&(O.$$scope={dirty:T,ctx:$}),f.$set(O);const E={};T&25165888&&(E.$$scope={dirty:T,ctx:$}),m.$set(E);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:$}),h.$set(L)},i($){_||(A(l.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(h.$$.fragment,$),_=!0)},o($){I(l.$$.fragment,$),I(r.$$.fragment,$),I(f.$$.fragment,$),I(m.$$.fragment,$),I(h.$$.fragment,$),_=!1},d($){$&&v(e),V(l),V(r),V(f),V(m),V(h),k=!1,S()}}}function $D(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function CD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function MD(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[CD],header:[$D],default:[TD]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const bo=15777e3;function OD(n,e,t){let i;const l=rt(),s="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,u=R.keyId||""),t(5,f=R.privateKey||""),t(6,c=R.duration||bo),Gt({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const R=await ue.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),It("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){ue.error(R)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function k(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function $(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const C=()=>h(),D=()=>!d;function O(R){te[R?"unshift":"push"](()=>{o=R,t(1,o)})}function E(R){Ee.call(this,n,R)}function L(R){Ee.call(this,n,R)}return t(8,i=!0),[g,o,r,a,u,f,c,d,i,s,h,m,_,k,S,$,T,C,D,O,E,L]}class DD extends be{constructor(e){super(),_e(this,e,OD,MD,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function ED(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new DD({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),B(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),y(e,t),y(e,i),y(e,l),w(d,o,m),z(r,d,m),a=!0,u||(f=K(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const g={};r.$set(g)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){I(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),V(r,d),u=!1,f()}}}function AD(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class ID extends be{constructor(e){super(),_e(this,e,AD,ED,me,{key:1,config:0})}}const yo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:ID},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:bD},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:_l,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:_l,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:_l,optionsComponentProps:{required:!0}},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:_l,optionsComponentProps:{required:!0}},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:_l,optionsComponentProps:{required:!0}},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:_l,optionsComponentProps:{required:!0}}];function Um(n,e,t){const i=n.slice();return i[9]=e[t],i}function LD(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function PD(n){let e,t=pe(n[1]),i=[];for(let l=0;l',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Wm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,g,h,_,k,S;function $(){return n[6](n[9])}return{c(){var T;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=Y(r),u=M(),f=b("div"),c=Y("ID: "),m=Y(d),g=M(),h=b("button"),h.innerHTML='',_=M(),nn(i.src,l="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(h,"type","button"),p(h,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,C){w(T,e,C),y(e,t),y(t,i),y(e,s),y(e,o),y(o,a),y(e,u),y(e,f),y(f,c),y(f,m),y(e,g),y(e,h),y(e,_),k||(S=K(h,"click",$),k=!0)},p(T,C){var D;n=T,C&2&&!nn(i.src,l="./images/oauth2/"+((D=n[3](n[9].provider))==null?void 0:D.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),C&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d(T){T&&v(e),k=!1,S()}}}function ND(n){let e;function t(s,o){var r;return s[2]?FD:(r=s[0])!=null&&r.id&&s[1].length?PD:LD}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function RD(n,e,t){const i=rt();let{record:l}=e,s=[],o=!1;function r(d){return yo.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await ue.collection(l.collectionId).listExternalAuths(l.id))}catch(d){ue.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||an(`Do you really want to unlink the ${a(d)} provider?`,()=>ue.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{It(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(m=>{ue.error(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class qD extends be{constructor(e){super(),_e(this,e,RD,ND,me,{record:0})}}function Ym(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Km(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=Y(`The record has previous unsaved changes. + `),r=b("button"),r.textContent="Restore draft",a=M(),u=b("button"),u.innerHTML='',f=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(t,a),y(t,u),y(e,f),y(e,c),m=!0,g||(h=[K(r,"click",n[38]),ve(Fe.call(null,u,"Discard draft")),K(u,"click",Ye(n[39]))],g=!0)},p:Q,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=ya(e,et,{duration:150})),m=!1},d(_){_&&v(e),_&&d&&d.end(),g=!1,we(h)}}}function Jm(n){let e,t,i;return t=new Qb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function jD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k=!n[6]&&Jm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),k&&k.c(),u=M(),f=b("input"),p(t,"class",Jn(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[72]),p(f,"type","text"),p(f,"id",c=n[72]),p(f,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=m=!n[6]},m(S,$){w(S,e,$),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),w(S,a,$),k&&k.m(S,$),w(S,u,$),w(S,f,$),ce(f,n[3].id),g=!0,h||(_=K(f,"input",n[40]),h=!0)},p(S,$){(!g||$[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?k&&(re(),I(k,1,1,()=>{k=null}),ae()):k?(k.p(S,$),$[0]&64&&A(k,1)):(k=Jm(S),k.c(),A(k,1),k.m(u.parentNode,u)),(!g||$[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!g||$[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!g||$[0]&64&&m!==(m=!S[6]))&&(f.readOnly=m),$[0]&8&&f.value!==S[3].id&&ce(f,S[3].id)},i(S){g||(A(k),g=!0)},o(S){I(k),g=!1},d(S){S&&(v(e),v(a),v(u),v(f)),k&&k.d(S),h=!1,_()}}}function Zm(n){var u,f;let e,t,i,l,s;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new iM({props:r}),te.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Gm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ke()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var g,h;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ye(()=>t=!1)),e.$set(m),(h=(g=c[0])==null?void 0:g.schema)!=null&&h.length?a||(a=Gm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(A(e.$$.fragment,c),s=!0)},o(c){I(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function Gm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function HD(n){let e,t,i;function l(o){n[54](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new NO({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zD(n){let e,t,i,l,s;function o(f){n[51](f,n[69])}function r(f){n[52](f,n[69])}function a(f){n[53](f,n[69])}let u={field:n[69],record:n[3]};return n[3][n[69].name]!==void 0&&(u.value=n[3][n[69].name]),n[4][n[69].name]!==void 0&&(u.uploadedFiles=n[4][n[69].name]),n[5][n[69].name]!==void 0&&(u.deletedFileNames=n[5][n[69].name]),e=new _O({props:u}),te.push(()=>ge(e,"value",o)),te.push(()=>ge(e,"uploadedFiles",r)),te.push(()=>ge(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(f,c){z(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[69]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[69].name],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ye(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[69].name],ye(()=>l=!1)),e.$set(d)},i(f){s||(A(e.$$.fragment,f),s=!0)},o(f){I(e.$$.fragment,f),s=!1},d(f){V(e,f)}}}function VD(n){let e,t,i;function l(o){n[50](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new BM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function BD(n){let e,t,i;function l(o){n[49](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new PM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function UD(n){let e,t,i;function l(o){n[48](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new EM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function WD(n){let e,t,i;function l(o){n[47](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new aD({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function YD(n){let e,t,i;function l(o){n[46](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new CM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function KD(n){let e,t,i;function l(o){n[45](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new wM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function JD(n){let e,t,i;function l(o){n[44](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new bM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ZD(n){let e,t,i;function l(o){n[43](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new mM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function GD(n){let e,t,i;function l(o){n[42](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new fM({props:s}),te.push(()=>ge(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Xm(n,e){let t,i,l,s,o;const r=[GD,ZD,JD,KD,YD,WD,UD,BD,VD,zD,HD],a=[];function u(f,c){return f[69].type==="text"?0:f[69].type==="number"?1:f[69].type==="bool"?2:f[69].type==="email"?3:f[69].type==="url"?4:f[69].type==="editor"?5:f[69].type==="date"?6:f[69].type==="select"?7:f[69].type==="json"?8:f[69].type==="file"?9:f[69].type==="relation"?10:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ke(),l&&l.c(),s=ke(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(re(),I(a[d],1,1,()=>{a[d]=null}),ae()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),A(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(A(l),o=!0)},o(f){I(l),o=!1},d(f){f&&(v(t),v(s)),~i&&a[i].d(f)}}}function Qm(n){let e,t,i;return t=new qD({props:{record:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===vs)},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===vs)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function XD(n){var S;let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[10]&&!n[7]&&Km(n);l=new he({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[jD,({uniqueId:$})=>({72:$}),({uniqueId:$})=>[0,0,$?1024:0]]},$$scope:{ctx:n}}});let g=n[14]&&Zm(n),h=pe(((S=n[0])==null?void 0:S.schema)||[]);const _=$=>$[69].name;for(let $=0;${m=null}),ae());const C={};T[0]&64&&(C.class="form-field "+($[6]?"":"readonly")),T[0]&200|T[2]&3072&&(C.$$scope={dirty:T,ctx:$}),l.$set(C),$[14]?g?(g.p($,T),T[0]&16384&&A(g,1)):(g=Zm($),g.c(),A(g,1),g.m(t,o)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),T[0]&57&&(h=pe(((D=$[0])==null?void 0:D.schema)||[]),re(),r=dt(r,T,_,1,$,h,a,t,Lt,Xm,null,Ym),ae()),(!f||T[0]&128)&&x(t,"no-pointer-events",$[7]),(!f||T[0]&8192)&&x(t,"active",$[13]===el),$[14]&&!$[6]?k?(k.p($,T),T[0]&16448&&A(k,1)):(k=Qm($),k.c(),A(k,1),k.m(e,null)):k&&(re(),I(k,1,1,()=>{k=null}),ae())},i($){if(!f){A(m),A(l.$$.fragment,$),A(g);for(let T=0;T{d=null}),ae()):d?(d.p(g,h),h[0]&64&&A(d,1)):(d=xm(g),d.c(),A(d,1),d.m(f.parentNode,f))},i(g){c||(A(d),c=!0)},o(g){I(d),c=!1},d(g){g&&(v(e),v(u),v(f)),d&&d.d(g)}}}function xD(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function xm(n){let e,t,i,l,s,o,r;return o=new En({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[eE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("button"),l=b("i"),s=M(),B(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),y(i,l),y(i,s),z(o,i,null),r=!0},p(a,u){const f={};u[0]&16388|u[2]&2048&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){I(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),V(o)}}}function eh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[32]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function th(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function eE(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&eh(n),u=n[14]&&n[2].email&&th(n);return{c(){a&&a.c(),e=M(),u&&u.c(),t=M(),i=b("button"),i.innerHTML=' Duplicate',l=M(),s=b("button"),s.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,l,c),w(f,s,c),o||(r=[K(i,"click",n[34]),K(s,"click",fn(Ye(n[35])))],o=!0)},p(f,c){f[14]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=eh(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[14]&&f[2].email?u?u.p(f,c):(u=th(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(f),u&&u.d(f),o=!1,we(r)}}}function nh(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===el),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===vs),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),s||(o=[K(t,"click",n[36]),K(l,"click",n[37])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===el),a[0]&8192&&x(l,"active",r[13]===vs)},d(r){r&&v(e),s=!1,we(o)}}}function tE(n){let e,t,i,l,s;const o=[xD,QD],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[14]&&!n[6]&&nh(n);return{c(){t.c(),i=M(),u&&u.c(),l=ke()},m(f,c){r[e].m(f,c),w(f,i,c),u&&u.m(f,c),w(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),A(t,1),t.m(i.parentNode,i)),f[14]&&!f[6]?u?u.p(f,c):(u=nh(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(A(t),s=!0)},o(f){I(t),s=!1},d(f){f&&(v(i),v(l)),r[e].d(f),u&&u.d(f)}}}function nE(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,u,f,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Y(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),y(s,o),y(o,a),f||(c=K(e,"click",n[31]),f=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&se(a,r),m[0]&34816&&u!==(u=!d[15]||d[11])&&(s.disabled=u),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),f=!1,c()}}}function iE(n){let e,t,i={class:` + record-panel + `+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+` + `+(n[14]&&!n[6]?"colored-header":"")+` + `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[nE],header:[tE],default:[XD]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=` + record-panel + `+(l[16]?"overlay-panel-xl":"overlay-panel-lg")+` + `+(l[14]&&!l[6]?"colored-header":"")+` + `),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[55]),s[0]&60925|s[2]&2048&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[56](null),V(e,l)}}}const el="form",vs="providers";function lE(n,e,t){let i,l,s,o,r;const a=rt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d={},m={},g=null,h=!1,_=!1,k={},S={},$=JSON.stringify(d),T=$,C=el,D=!0,O=!0;function E(fe){return F(fe),t(12,_=!0),t(13,C=el),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function R(){t(12,_=!1),L()}async function P(fe){if(fe&&typeof fe=="string"){try{return await ue.collection(f.id).getOne(fe)}catch(Me){Me.isAbort||(R(),console.warn("resolveModel:",Me),hi(`Unable to load record with id "${fe}"`))}return null}return fe}async function F(fe){t(7,O=!0),Gt({}),t(4,k={}),t(5,S={}),t(2,d=typeof fe=="string"?{id:fe,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:fe||{}),t(3,m=structuredClone(d)),t(2,d=await P(fe)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,g=W()),!g||H(m,g)?t(10,g=null):(delete g.password,delete g.passwordConfirm),t(28,$=JSON.stringify(m)),t(7,O=!1)}async function N(fe){var Xe,Jt;Gt({}),t(2,d=fe||{}),t(4,k={}),t(5,S={});const Me=((Jt=(Xe=f==null?void 0:f.schema)==null?void 0:Xe.filter(nt=>nt.type!="file"))==null?void 0:Jt.map(nt=>nt.name))||[];for(let nt in fe)Me.includes(nt)||t(3,m[nt]=fe[nt],m);await Qt(),t(28,$=JSON.stringify(m)),U()}function q(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function W(fe){try{const Me=window.localStorage.getItem(q());if(Me)return JSON.parse(Me)}catch{}return fe}function G(fe){try{window.localStorage.setItem(q(),fe)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(q())}}function J(){g&&(t(3,m=g),t(10,g=null))}function H(fe,Me){var Bn;const Xe=structuredClone(fe||{}),Jt=structuredClone(Me||{}),nt=(Bn=f==null?void 0:f.schema)==null?void 0:Bn.filter(oi=>oi.type==="file");for(let oi of nt)delete Xe[oi.name],delete Jt[oi.name];const en=["expand","password","passwordConfirm"];for(let oi of en)delete Xe[oi],delete Jt[oi];return JSON.stringify(Xe)==JSON.stringify(Jt)}function U(){t(10,g=null),window.localStorage.removeItem(q())}async function le(fe=!0){if(!(h||!r||!(f!=null&&f.id))){t(11,h=!0);try{const Me=oe();let Xe;D?Xe=await ue.collection(f.id).create(Me):Xe=await ue.collection(f.id).update(m.id,Me),It(D?"Successfully created record.":"Successfully updated record."),U(),fe?R():N(Xe),a("save",{isNew:D,record:Xe})}catch(Me){ue.error(Me)}t(11,h=!1)}}function ee(){d!=null&&d.id&&an("Do you really want to delete the selected record?",()=>ue.collection(d.collectionId).delete(d.id).then(()=>{L(),It("Successfully deleted record."),a("delete",d)}).catch(fe=>{ue.error(fe)}))}function oe(){const fe=structuredClone(m||{}),Me=new FormData,Xe={id:fe.id},Jt={};for(const nt of(f==null?void 0:f.schema)||[])Xe[nt.name]=!0,nt.type=="json"&&(Jt[nt.name]=!0);i&&(Xe.username=!0,Xe.email=!0,Xe.emailVisibility=!0,Xe.password=!0,Xe.passwordConfirm=!0,Xe.verified=!0);for(const nt in fe)if(Xe[nt]){if(typeof fe[nt]>"u"&&(fe[nt]=null),Jt[nt]&&fe[nt]!=="")try{JSON.parse(fe[nt])}catch(en){const Bn={};throw Bn[nt]={code:"invalid_json",message:en.toString()},new qn({status:400,response:{data:Bn}})}j.addValueToFormData(Me,nt,fe[nt])}for(const nt in k){const en=j.toArray(k[nt]);for(const Bn of en)Me.append(nt,Bn)}for(const nt in S){const en=j.toArray(S[nt]);for(const Bn of en)Me.append(nt+"."+Bn,"")}return Me}function Te(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent verification email to ${d.email}?`,()=>ue.collection(f.id).requestVerification(d.email).then(()=>{It(`Successfully sent verification email to ${d.email}.`)}).catch(fe=>{ue.error(fe)}))}function je(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent password reset email to ${d.email}?`,()=>ue.collection(f.id).requestPasswordReset(d.email).then(()=>{It(`Successfully sent password reset email to ${d.email}.`)}).catch(fe=>{ue.error(fe)}))}function Ve(){o?an("You have unsaved changes. Do you really want to discard them?",()=>{Qe()}):Qe()}async function Qe(){let fe=d?structuredClone(d):null;if(fe){fe.id="",fe.created="",fe.updated="";const Me=(f==null?void 0:f.schema)||[];for(const Xe of Me)Xe.type==="file"&&delete fe[Xe.name]}U(),E(fe),await Qt(),t(28,$="")}function tt(fe){(fe.ctrlKey||fe.metaKey)&&fe.code=="KeyS"&&(fe.preventDefault(),fe.stopPropagation(),le(!1))}const Ge=()=>L(),Mt=()=>Te(),Pt=()=>je(),Ce=()=>Ve(),De=()=>ee(),ze=()=>t(13,C=el),_t=()=>t(13,C=vs),ne=()=>J(),Ne=()=>U();function Se(){m.id=this.value,t(3,m)}function mt(fe){m=fe,t(3,m)}function Bt(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function cn(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function on(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Vn(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ni(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function al(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function yi(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ae(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ft(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Ri(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}function Gn(fe,Me){n.$$.not_equal(k[Me.name],fe)&&(k[Me.name]=fe,t(4,k))}function ul(fe,Me){n.$$.not_equal(S[Me.name],fe)&&(S[Me.name]=fe,t(5,S))}function Rl(fe,Me){n.$$.not_equal(m[Me.name],fe)&&(m[Me.name]=fe,t(3,m))}const ki=()=>o&&_?(an("You have unsaved changes. Do you really want to close the panel?",()=>{R()}),!1):(Gt({}),U(),!0);function fl(fe){te[fe?"unshift":"push"](()=>{c=fe,t(9,c)})}function cl(fe){Ee.call(this,n,fe)}function bt(fe){Ee.call(this,n,fe)}return n.$$set=fe=>{"collection"in fe&&t(0,f=fe.collection)},n.$$.update=()=>{var fe;n.$$.dirty[0]&1&&t(14,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((fe=f==null?void 0:f.schema)!=null&&fe.find(Me=>Me.type==="editor"))),n.$$.dirty[0]&48&&t(30,s=j.hasNonEmptyProps(k)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,T=JSON.stringify(m)),n.$$.dirty[0]&1879048192&&t(8,o=s||$!=T),n.$$.dirty[0]&4&&t(6,D=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!O&&(D||o)),n.$$.dirty[0]&536871040&&(O||G(T))},[f,L,d,m,k,S,D,O,o,c,g,h,_,C,i,r,l,u,R,J,U,le,ee,Te,je,Ve,tt,E,$,T,s,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne,Se,mt,Bt,cn,on,Vn,Ni,al,yi,Ae,Ft,Ri,Gn,ul,Rl,ki,fl,cl,bt]}class tu extends be{constructor(e){super(),_e(this,e,lE,iE,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function sE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function oE(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=Y(n[2]),l=M(),s=b("div"),o=Y(n[1]),r=Y(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),y(e,t),y(t,i),y(e,l),y(e,s),y(s,o),y(s,r),a||(u=ve(Fe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&se(i,f[2]),c&2&&se(o,f[1])},d(f){f&&v(e),a=!1,u()}}}function rE(n){let e;function t(s,o){return s[0]?oE:sE}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function aE(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class nl extends be{constructor(e){super(),_e(this,e,aE,rE,me,{date:0})}}function ih(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function lh(n,e,t){const i=n.slice();return i[13]=e[t],i}function sh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function oh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function uE(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function fE(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function cE(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function dE(n){let e,t;return{c(){e=b("div"),t=Y(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function pE(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),y(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&se(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function mE(n){let e,t=[],i=new Map,l,s,o=pe(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&ah();return{c(){var u;e=b("div");for(let f=0;fu[17]?a||(a=ah(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&x(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!s){for(let f=0;fn[11]&&ch();return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),y(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,l)),f[9].length>f[11]?u||(u=ch(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(A(i),s=!0)},o(f){I(i),s=!1},d(f){f&&v(e),r[t].d(),u&&u.d()}}}function gE(n){let e,t=[],i=new Map,l=pe(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function yE(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=Y(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),y(e,i),l||(s=[ve(Fe.call(null,e,"Open in new tab")),K(e,"click",fn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function kE(n){let e,t;return{c(){e=b("span"),t=Y(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),y(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function vE(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function wE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function SE(n){let e,t,i,l;const s=[DE,OE],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function rh(n,e){let t,i,l;return i=new xa({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function ah(n){let e;return{c(){e=Y("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function TE(n){let e,t=pe(n[9].slice(0,n[11])),i=[];for(let l=0;lr[8]+r[6];for(let r=0;r500&&ph(n);return{c(){e=b("span"),i=Y(t),l=M(),r&&r.c(),s=ke(),p(e,"class","txt")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),r&&r.m(a,u),w(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=ph(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){o||(A(r),o=!0)},o(a){I(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function DE(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function ph(n){let e,t;return e=new rl({props:{value:JSON.stringify(n[3],null,2)}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function EE(n){let e,t,i,l,s;const o=[SE,wE,vE,kE,yE,bE,_E,gE,hE,mE,pE,dE],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?cE(f):c===8?fE(f):c===9?uE(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ke()},m(f,c){r[t].m(f,c),w(f,l,c),s=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),I(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(l.parentNode,l))},i(f){s||(A(i),s=!0)},o(f){I(i),s=!1},d(f){f&&v(l),r[t].d(f)}}}function AE(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ee.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class e0 extends be{constructor(e){super(),_e(this,e,AE,EE,me,{record:0,field:1,short:2})}}function mh(n,e,t){const i=n.slice();return i[13]=e[t],i}function hh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new e0({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=Y(i),s=M(),o=b("td"),B(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),y(e,t),y(t,l),y(e,s),y(e,o),z(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&se(l,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){I(r.$$.fragment,u),a=!1},d(u){u&&v(e),V(r)}}}function gh(n){let e,t,i,l,s,o;return s=new nl({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),z(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),s.$set(u)},i(r){o||(A(s.$$.fragment,r),o=!0)},o(r){I(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function _h(n){let e,t,i,l,s,o;return s=new nl({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),B(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(e,l),z(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),s.$set(u)},i(r){o||(A(s.$$.fragment,r),o=!0)},o(r){I(s.$$.fragment,r),o=!1},d(r){r&&v(e),V(s)}}}function IE(n){var D;let e,t,i,l,s,o,r,a,u,f,c=(n[3].id||"...")+"",d,m,g,h,_;a=new rl({props:{value:n[3].id}});let k=pe((D=n[0])==null?void 0:D.schema),S=[];for(let O=0;OI(S[O],1,1,()=>{S[O]=null});let T=n[3].created&&gh(n),C=n[3].updated&&_h(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),B(a.$$.fragment),u=M(),f=b("span"),d=Y(c),m=M();for(let O=0;O{T=null}),ae()),O[3].updated?C?(C.p(O,E),E&8&&A(C,1)):(C=_h(O),C.c(),A(C,1),C.m(t,null)):C&&(re(),I(C,1,1,()=>{C=null}),ae()),(!_||E&16)&&x(e,"table-loading",O[4])},i(O){if(!_){A(a.$$.fragment,O);for(let E=0;EClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function FE(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[PE],header:[LE],default:[IE]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[8](null),V(e,l)}}}function NE(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(_){return f(_),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.hide()}async function f(_){t(3,o={}),t(4,r=!0),t(3,o=await c(_)||{}),t(4,r=!1)}async function c(_){if(_&&typeof _=="string"){try{return await ue.collection(l.id).getOne(_)}catch(k){k.isAbort||(u(),console.warn("resolveModel:",k),hi(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function m(_){te[_?"unshift":"push"](()=>{s=_,t(2,s)})}function g(_){Ee.call(this,n,_)}function h(_){Ee.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,l=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=l==null?void 0:l.schema)!=null&&_.find(k=>k.type==="editor")))},[l,u,s,o,r,i,a,d,m,g,h]}class RE extends be{constructor(e){super(),_e(this,e,NE,FE,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function bh(n,e,t){const i=n.slice();return i[63]=e[t],i}function yh(n,e,t){const i=n.slice();return i[66]=e[t],i}function kh(n,e,t){const i=n.slice();return i[66]=e[t],i}function vh(n,e,t){const i=n.slice();return i[59]=e[t],i}function wh(n){let e;function t(s,o){return s[13]?jE:qE}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function qE(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),o||(r=K(t,"change",n[32]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function jE(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Sh(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[HE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function HE(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Th(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&$h(n),r=i&&Ch(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ke()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,l,u),s=!0},p(a,u){u[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,u),u[0]&32&&A(o,1)):(o=$h(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),u[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=Ch(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),I(r,1,1,()=>{r=null}),ae())},i(a){s||(A(o),A(r),s=!0)},o(a){I(o),I(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function $h(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[zE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zE(n){let e;return{c(){e=b("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ch(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[VE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function VE(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function BE(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=Y(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),y(e,t),y(e,l),y(e,s),y(s,r)},p(a,u){u[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[66].name+"")&&se(r,o)},d(a){a&&v(e)}}}function Mh(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[BE]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Tn({props:r}),te.push(()=>ge(i,"sort",o)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[66].type+" col-field-"+e[66].name),u[0]&524288&&(f.name=e[66].name),u[0]&524288|u[2]&512&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function Oh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[UE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function UE(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Dh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[WE]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Tn({props:s}),te.push(()=>ge(e,"sort",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function WE(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Eh(n){let e;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function Ah(n){let e;function t(s,o){return s[13]?KE:YE}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function YE(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return ZE;if(!a[10])return JE}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function KE(n){let e;return{c(){e=b("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function ZE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Ih(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),y(e,t),y(t,i),y(t,o),y(t,r),u||(f=[K(i,"change",c),K(t,"click",fn(n[30]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),u=!1,we(f)}}}function Lh(n){let e,t,i,l,s,o,r=n[63].id+"",a,u,f;l=new rl({props:{value:n[63].id}});let c=n[9]&&Ph(n);return{c(){e=b("td"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),a=Y(r),u=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),y(e,t),y(t,i),z(l,i,null),y(i,s),y(i,o),y(o,a),y(t,u),c&&c.m(t,null),f=!0},p(d,m){const g={};m[0]&8&&(g.value=d[63].id),l.$set(g),(!f||m[0]&8)&&r!==(r=d[63].id+"")&&se(a,r),d[9]?c?c.p(d,m):(c=Ph(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(l.$$.fragment,d),f=!0)},o(d){I(l.$$.fragment,d),f=!1},d(d){d&&v(e),V(l),c&&c.d()}}}function Ph(n){let e;function t(s,o){return s[63].verified?XE:GE}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function GE(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=ve(Fe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function XE(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=ve(Fe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Fh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Nh(n),o=i&&Rh(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ke()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Nh(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Rh(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Nh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?xE:QE}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function QE(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),y(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&se(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function xE(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Rh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?t8:e8}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function e8(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=Y(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),y(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&se(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function t8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qh(n,e){let t,i,l,s;return i=new e0({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),B(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),z(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(A(i.$$.fragment,o),s=!0)},o(o){I(i.$$.fragment,o),s=!1},d(o){o&&v(t),V(i)}}}function jh(n){let e,t,i;return t=new nl({props:{date:n[63].created}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function Hh(n){let e,t,i;return t=new nl({props:{date:n[63].updated}}),{c(){e=b("td"),B(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function zh(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,g,h,_,k,S=!e[10]&&Ih(e),$=l&&Lh(e),T=e[9]&&Fh(e),C=pe(e[19]);const D=P=>P[66].name;for(let P=0;P',p(g,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(P,F){w(P,t,F),S&&S.m(t,null),y(t,i),$&&$.m(t,null),y(t,s),T&&T.m(t,null),y(t,o);for(let N=0;N{$=null}),ae()),e[9]?T?T.p(e,F):(T=Fh(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),F[0]&524296&&(C=pe(e[19]),re(),r=dt(r,F,D,1,e,C,a,t,Lt,qh,u,yh),ae()),F[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?O?(O.p(e,F),F[0]&288&&A(O,1)):(O=jh(e),O.c(),A(O,1),O.m(t,c)):O&&(re(),I(O,1,1,()=>{O=null}),ae()),F[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?E?(E.p(e,F),F[0]&160&&A(E,1)):(E=Hh(e),E.c(),A(E,1),E.m(t,m)):E&&(re(),I(E,1,1,()=>{E=null}),ae())},i(P){if(!h){A($);for(let F=0;FH[66].name;for(let H=0;HH[10]?H[63]:H[63].id;for(let H=0;H{O=null}),ae()),H[9]?E?(E.p(H,U),U[0]&512&&A(E,1)):(E=Th(H),E.c(),A(E,1),E.m(i,r)):E&&(re(),I(E,1,1,()=>{E=null}),ae()),U[0]&524289&&(L=pe(H[19]),re(),a=dt(a,U,R,1,H,L,u,i,Lt,Mh,f,kh),ae()),U[0]&288&&(c=H[8]&&!H[5].includes("@created")),c?P?(P.p(H,U),U[0]&288&&A(P,1)):(P=Oh(H),P.c(),A(P,1),P.m(i,d)):P&&(re(),I(P,1,1,()=>{P=null}),ae()),U[0]&160&&(m=H[7]&&!H[5].includes("@updated")),m?F?(F.p(H,U),U[0]&160&&A(F,1)):(F=Dh(H),F.c(),A(F,1),F.m(i,g)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),H[16].length?N?N.p(H,U):(N=Eh(H),N.c(),N.m(h,null)):N&&(N.d(1),N=null),U[0]&9971642&&(q=pe(H[3]),re(),S=dt(S,U,W,1,H,q,$,k,Lt,zh,T,bh),ae(),!q.length&&G?G.p(H,U):q.length?G&&(G.d(1),G=null):(G=Ah(H),G.c(),G.m(k,T))),H[3].length&&H[18]?J?J.p(H,U):(J=Vh(H),J.c(),J.m(k,null)):J&&(J.d(1),J=null),(!C||U[0]&8192)&&x(e,"table-loading",H[13])},i(H){if(!C){A(O),A(E);for(let U=0;U({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),z(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(A(i.$$.fragment,s),l=!0)},o(s){I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(i,s)}}}function l8(n){let e,t,i=[],l=new Map,s,o,r=pe(n[16]);const a=u=>u[59].id+u[59].name;for(let u=0;u{i=null}),ae())},i(l){t||(A(i),t=!0)},o(l){I(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Wh(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,g,h,_,k,S;return{c(){e=b("div"),t=b("div"),i=Y("Selected "),l=b("strong"),s=Y(n[6]),o=M(),a=Y(r),u=M(),f=b("button"),f.innerHTML='Reset',c=M(),d=b("div"),m=M(),g=b("button"),g.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-transparent btn-danger"),x(g,"btn-loading",n[14]),x(g,"btn-disabled",n[14]),p(e,"class","bulkbar")},m($,T){w($,e,T),y(e,t),y(t,i),y(t,l),y(l,s),y(t,o),y(t,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),_=!0,k||(S=[K(f,"click",n[47]),K(g,"click",n[48])],k=!0)},p($,T){(!_||T[0]&64)&&se(s,$[6]),(!_||T[0]&64)&&r!==(r=$[6]===1?"record":"records")&&se(a,r),(!_||T[0]&16384)&&x(f,"btn-disabled",$[14]),(!_||T[0]&16384)&&x(g,"btn-loading",$[14]),(!_||T[0]&16384)&&x(g,"btn-disabled",$[14])},i($){_||($&&Ke(()=>{_&&(h||(h=Le(e,jn,{duration:150,y:5},!0)),h.run(1))}),_=!0)},o($){$&&(h||(h=Le(e,jn,{duration:150,y:5},!1)),h.run(0)),_=!1},d($){$&&v(e),$&&h&&h.end(),k=!1,we(S)}}}function o8(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[s8],default:[n8]},$$scope:{ctx:n}};e=new xo({props:s}),n[46](e);let o=n[6]&&Wh(n);return{c(){B(e.$$.fragment),t=M(),o&&o.c(),i=ke()},m(r,a){z(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const u={};a[0]&1030075|a[2]&512&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&A(o,1)):(o=Wh(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(re(),I(o,1,1,()=>{o=null}),ae())},i(r){l||(A(e.$$.fragment,r),A(o),l=!0)},o(r){I(e.$$.fragment,r),I(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),V(e,r),o&&o.d(r)}}}const r8=/^([\+\-])?(\w+)$/,Yh=40;function a8(n,e,t){let i,l,s,o,r,a,u,f,c,d,m,g;We(n,zn,Ae=>t(53,g=Ae));const h=rt();let{collection:_}=e,{sort:k=""}=e,{filter:S=""}=e,$,T=[],C=1,D=0,O={},E=!0,L=!1,R=0,P,F=[],N=[],q="";function W(){_!=null&&_.id&&(F.length?localStorage.setItem(q,JSON.stringify(F)):localStorage.removeItem(q))}function G(){if(t(5,F=[]),!!(_!=null&&_.id))try{const Ae=localStorage.getItem(q);Ae&&t(5,F=JSON.parse(Ae)||[])}catch{}}function J(Ae){return!!T.find(Ft=>Ft.id)}async function H(){const Ae=C;for(let Ft=1;Ft<=Ae;Ft++)(Ft===1||u)&&await U(Ft,!1)}async function U(Ae=1,Ft=!0){var fl,cl,bt;if(!(_!=null&&_.id))return;t(13,E=!0);let Ri=k;const Gn=Ri.match(r8),ul=Gn?r.find(fe=>fe.name===Gn[2]):null;if(Gn&&ul){const fe=((bt=(cl=(fl=g==null?void 0:g.find(Xe=>{var Jt;return Xe.id==((Jt=ul.options)==null?void 0:Jt.collectionId)}))==null?void 0:fl.schema)==null?void 0:cl.filter(Xe=>Xe.presentable))==null?void 0:bt.map(Xe=>Xe.name))||[],Me=[];for(const Xe of fe)Me.push((Gn[1]||"")+Gn[2]+"."+Xe);Me.length>0&&(Ri=Me.join(","))}const Rl=j.getAllCollectionIdentifiers(_),ki=o.map(fe=>fe.name+":excerpt(200)").concat(r.map(fe=>"expand."+fe.name+".*:excerpt(200)"));return ki.length&&ki.unshift("*"),ue.collection(_.id).getList(Ae,Yh,{sort:Ri,skipTotal:1,filter:j.normalizeSearchFilter(S,Rl),expand:r.map(fe=>fe.name).join(","),fields:ki.join(","),requestKey:"records_list"}).then(async fe=>{var Me;if(Ae<=1&&le(),t(13,E=!1),t(12,C=fe.page),t(28,D=fe.items.length),h("load",T.concat(fe.items)),o.length)for(let Xe of fe.items)Xe._partial=!0;if(Ft){const Xe=++R;for(;(Me=fe.items)!=null&&Me.length&&R==Xe;){const Jt=fe.items.splice(0,20);for(let nt of Jt)j.pushOrReplaceByKey(T,nt);t(3,T),await j.yieldToMain()}}else{for(let Xe of fe.items)j.pushOrReplaceByKey(T,Xe);t(3,T)}}).catch(fe=>{fe!=null&&fe.isAbort||(t(13,E=!1),console.warn(fe),le(),ue.error(fe,(fe==null?void 0:fe.status)!=400))})}function le(){$==null||$.resetVerticalScroll(),t(3,T=[]),t(12,C=1),t(28,D=0),t(4,O={})}function ee(){c?oe():Te()}function oe(){t(4,O={})}function Te(){for(const Ae of T)t(4,O[Ae.id]=Ae,O);t(4,O)}function je(Ae){O[Ae.id]?delete O[Ae.id]:t(4,O[Ae.id]=Ae,O),t(4,O)}function Ve(){an(`Do you really want to delete the selected ${f===1?"record":"records"}?`,Qe)}async function Qe(){if(L||!f||!(_!=null&&_.id))return;let Ae=[];for(const Ft of Object.keys(O))Ae.push(ue.collection(_.id).delete(Ft));return t(14,L=!0),Promise.all(Ae).then(()=>{It(`Successfully deleted the selected ${f===1?"record":"records"}.`),h("delete",O),oe()}).catch(Ft=>{ue.error(Ft)}).finally(()=>(t(14,L=!1),H()))}function tt(Ae){Ee.call(this,n,Ae)}const Ge=(Ae,Ft)=>{Ft.target.checked?j.removeByValue(F,Ae.id):j.pushUnique(F,Ae.id),t(5,F)},Mt=()=>ee();function Pt(Ae){k=Ae,t(0,k)}function Ce(Ae){k=Ae,t(0,k)}function De(Ae){k=Ae,t(0,k)}function ze(Ae){k=Ae,t(0,k)}function _t(Ae){k=Ae,t(0,k)}function ne(Ae){k=Ae,t(0,k)}function Ne(Ae){te[Ae?"unshift":"push"](()=>{P=Ae,t(15,P)})}const Se=Ae=>je(Ae),mt=Ae=>h("select",Ae),Bt=(Ae,Ft)=>{Ft.code==="Enter"&&(Ft.preventDefault(),h("select",Ae))},cn=()=>t(1,S=""),on=()=>h("new"),Vn=()=>U(C+1);function Ni(Ae){te[Ae?"unshift":"push"](()=>{$=Ae,t(11,$)})}const al=()=>oe(),yi=()=>Ve();return n.$$set=Ae=>{"collection"in Ae&&t(25,_=Ae.collection),"sort"in Ae&&t(0,k=Ae.sort),"filter"in Ae&&t(1,S=Ae.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(q=_.id+"@hiddenColumns",G(),le()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ae=>Ae.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ae=>Ae.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ae=>!F.includes(Ae.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&k!==-1&&S!==-1&&U(1),n.$$.dirty[0]&268435456&&t(18,u=D>=Yh),n.$$.dirty[0]&16&&t(6,f=Object.keys(O).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&F!==-1&&W(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,N=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ae=>({id:Ae.id,name:Ae.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[k,S,U,T,O,F,f,m,d,l,i,$,C,E,L,P,N,c,u,a,h,ee,oe,je,Ve,_,J,H,D,s,tt,Ge,Mt,Pt,Ce,De,ze,_t,ne,Ne,Se,mt,Bt,cn,on,Vn,Ni,al,yi]}class u8 extends be{constructor(e){super(),_e(this,e,a8,o8,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function f8(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=Y(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),y(e,t),y(e,i),y(e,l),y(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&se(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function c8(n,e,t){const i=rt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(l),c=await ue.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class d8 extends be{constructor(e){super(),_e(this,e,c8,f8,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function p8(n){let e,t,i,l;return e=new F5({}),i=new _n({props:{class:"flex-content",$$slots:{footer:[_8],default:[g8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function m8(n){let e,t;return e=new _n({props:{center:!0,$$slots:{default:[k8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function h8(n){let e,t;return e=new _n({props:{center:!0,$$slots:{default:[v8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Kh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[ve(Fe.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function Jh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function g8(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P=!n[12]&&Kh(n);c=new Qo({}),c.$on("refresh",n[21]);let F=n[2].type!=="view"&&Jh(n);k=new Ds({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[24]);function N(G){n[26](G)}function q(G){n[27](G)}let W={collection:n[2]};return n[0]!==void 0&&(W.filter=n[0]),n[1]!==void 0&&(W.sort=n[1]),C=new u8({props:W}),n[25](C),te.push(()=>ge(C,"filter",N)),te.push(()=>ge(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=Y(o),a=M(),u=b("div"),P&&P.c(),f=M(),B(c.$$.fragment),d=M(),m=b("div"),g=b("button"),g.innerHTML=' API Preview',h=M(),F&&F.c(),_=M(),B(k.$$.fragment),S=M(),$=b("div"),T=M(),B(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(g,"type","button"),p(g,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-sm")},m(G,J){w(G,e,J),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),y(e,u),P&&P.m(u,null),y(u,f),z(c,u,null),y(e,d),y(e,m),y(m,g),y(m,h),F&&F.m(m,null),w(G,_,J),z(k,G,J),w(G,S,J),w(G,$,J),w(G,T,J),z(C,G,J),E=!0,L||(R=K(g,"click",n[22]),L=!0)},p(G,J){(!E||J[0]&4)&&o!==(o=G[2].name+"")&&se(r,o),G[12]?P&&(P.d(1),P=null):P?P.p(G,J):(P=Kh(G),P.c(),P.m(u,f)),G[2].type!=="view"?F?F.p(G,J):(F=Jh(G),F.c(),F.m(m,null)):F&&(F.d(1),F=null);const H={};J[0]&1&&(H.value=G[0]),J[0]&4&&(H.autocompleteCollection=G[2]),k.$set(H);const U={};J[0]&4&&(U.collection=G[2]),!D&&J[0]&1&&(D=!0,U.filter=G[0],ye(()=>D=!1)),!O&&J[0]&2&&(O=!0,U.sort=G[1],ye(()=>O=!1)),C.$set(U)},i(G){E||(A(c.$$.fragment,G),A(k.$$.fragment,G),A(C.$$.fragment,G),E=!0)},o(G){I(c.$$.fragment,G),I(k.$$.fragment,G),I(C.$$.fragment,G),E=!1},d(G){G&&(v(e),v(_),v(S),v($),v(T)),P&&P.d(),V(c),F&&F.d(),V(k,G),n[25](null),V(C,G),L=!1,R()}}}function _8(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new d8({props:s}),n[18](e),te.push(()=>ge(e,"totalCount",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function b8(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function y8(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function k8(n){let e,t,i;function l(r,a){return r[12]?y8:b8}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),y(e,t),y(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function v8(n){let e;return{c(){e=b("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function w8(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[h8,m8,p8],m=[];function g($,T){return $[3]&&!$[11].length?0:$[11].length?2:1}e=g(n),t=m[e]=d[e](n);let h={};l=new Qa({props:h}),n[31](l);let _={};o=new B5({props:_}),n[32](o);let k={collection:n[2]};a=new tu({props:k}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return f=new RE({props:S}),n[37](f),f.$on("hide",n[38]),{c(){t.c(),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),B(f.$$.fragment)},m($,T){m[e].m($,T),w($,i,T),z(l,$,T),w($,s,T),z(o,$,T),w($,r,T),z(a,$,T),w($,u,T),z(f,$,T),c=!0},p($,T){let C=e;e=g($),e===C?m[e].p($,T):(re(),I(m[C],1,1,()=>{m[C]=null}),ae(),t=m[e],t?t.p($,T):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const D={};l.$set(D);const O={};o.$set(O);const E={};T[0]&4&&(E.collection=$[2]),a.$set(E);const L={};T[0]&4&&(L.collection=$[2]),f.$set(L)},i($){c||(A(t),A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){I(t),I(l.$$.fragment,$),I(o.$$.fragment,$),I(a.$$.fragment,$),I(f.$$.fragment,$),c=!1},d($){$&&(v(i),v(s),v(r),v(u)),m[e].d($),n[31](null),V(l,$),n[32](null),V(o,$),n[33](null),V(a,$),n[37](null),V(f,$)}}}function S8(n,e,t){let i,l,s,o,r,a,u;We(n,li,Ce=>t(2,l=Ce)),We(n,Et,Ce=>t(39,s=Ce)),We(n,Co,Ce=>t(3,o=Ce)),We(n,Uo,Ce=>t(16,r=Ce)),We(n,zn,Ce=>t(11,a=Ce)),We(n,Ml,Ce=>t(12,u=Ce));const f=new URLSearchParams(r);let c,d,m,g,h,_,k=f.get("filter")||"",S=f.get("sort")||"-created",$=f.get("collectionId")||(l==null?void 0:l.id),T=0;cv($);async function C(Ce){await Qt(),(l==null?void 0:l.type)==="view"?g.show(Ce):m==null||m.show(Ce)}function D(){t(14,$=l==null?void 0:l.id),t(0,k=""),t(1,S="-created"),E({recordId:null}),O()}async function O(){if(!S)return;const Ce=j.getAllCollectionIdentifiers(l),De=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);De.filter(ze=>Ce.includes(ze)).length!=De.length&&(Ce.includes("created")?t(1,S="-created"):t(1,S=""))}function E(Ce={}){const De=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:k,sort:S},Ce);j.replaceHashQueryParams(De)}const L=()=>c==null?void 0:c.show();function R(Ce){te[Ce?"unshift":"push"](()=>{_=Ce,t(9,_)})}function P(Ce){T=Ce,t(10,T)}const F=()=>c==null?void 0:c.show(l),N=()=>{h==null||h.load(),_==null||_.reload()},q=()=>d==null?void 0:d.show(l),W=()=>m==null?void 0:m.show(),G=Ce=>t(0,k=Ce.detail);function J(Ce){te[Ce?"unshift":"push"](()=>{h=Ce,t(8,h)})}function H(Ce){k=Ce,t(0,k)}function U(Ce){S=Ce,t(1,S)}const le=Ce=>{E({recordId:Ce.detail.id});let De=Ce.detail._partial?Ce.detail.id:Ce.detail;l.type==="view"?g==null||g.show(De):m==null||m.show(De)},ee=()=>{_==null||_.reload()},oe=()=>m==null?void 0:m.show();function Te(Ce){te[Ce?"unshift":"push"](()=>{c=Ce,t(4,c)})}function je(Ce){te[Ce?"unshift":"push"](()=>{d=Ce,t(5,d)})}function Ve(Ce){te[Ce?"unshift":"push"](()=>{m=Ce,t(6,m)})}const Qe=()=>{E({recordId:null})},tt=Ce=>{k?_==null||_.reload():Ce.detail.isNew&&t(10,T++,T),h==null||h.reloadLoadedPages()},Ge=Ce=>{(!k||h!=null&&h.hasRecord(Ce.detail.id))&&t(10,T--,T),h==null||h.reloadLoadedPages()};function Mt(Ce){te[Ce?"unshift":"push"](()=>{g=Ce,t(7,g)})}const Pt=()=>{E({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=$&&av(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&$!=l.id&&D(),n.$$.dirty[0]&4&&l!=null&&l.id&&O(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&C(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||k||l!=null&&l.id)&&E(),n.$$.dirty[0]&4&&tn(Et,s=(l==null?void 0:l.name)||"Collections",s)},[k,S,l,o,c,d,m,g,h,_,T,a,u,E,$,i,r,L,R,P,F,N,q,W,G,J,H,U,le,ee,oe,Te,je,Ve,Qe,tt,Ge,Mt,Pt]}class T8 extends be{constructor(e){super(),_e(this,e,S8,w8,me,{},null,[-1,-1])}}function $8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML=' Application',s=M(),o=b("a"),o.innerHTML=' Mail settings',r=M(),a=b("a"),a.innerHTML=' Files storage',u=M(),f=b("a"),f.innerHTML=' Backups',c=M(),d=b("div"),d.innerHTML='Sync',m=M(),g=b("a"),g.innerHTML=' Export collections',h=M(),_=b("a"),_.innerHTML=' Import collections',k=M(),S=b("div"),S.textContent="Authentication",$=M(),T=b("a"),T.innerHTML=' Auth providers',C=M(),D=b("a"),D.innerHTML=' Token options',O=M(),E=b("a"),E.innerHTML=' Admins',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(d,"class","sidebar-title"),p(g,"href","/settings/export-collections"),p(g,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(S,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(D,"href","/settings/tokens"),p(D,"class","sidebar-list-item"),p(E,"href","/settings/admins"),p(E,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(P,F){w(P,e,F),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),y(e,r),y(e,a),y(e,u),y(e,f),y(e,c),y(e,d),y(e,m),y(e,g),y(e,h),y(e,_),y(e,k),y(e,S),y(e,$),y(e,T),y(e,C),y(e,D),y(e,O),y(e,E),L||(R=[ve(Pn.call(null,l,{path:"/settings"})),ve(ln.call(null,l)),ve(Pn.call(null,o,{path:"/settings/mail/?.*"})),ve(ln.call(null,o)),ve(Pn.call(null,a,{path:"/settings/storage/?.*"})),ve(ln.call(null,a)),ve(Pn.call(null,f,{path:"/settings/backups/?.*"})),ve(ln.call(null,f)),ve(Pn.call(null,g,{path:"/settings/export-collections/?.*"})),ve(ln.call(null,g)),ve(Pn.call(null,_,{path:"/settings/import-collections/?.*"})),ve(ln.call(null,_)),ve(Pn.call(null,T,{path:"/settings/auth-providers/?.*"})),ve(ln.call(null,T)),ve(Pn.call(null,D,{path:"/settings/tokens/?.*"})),ve(ln.call(null,D)),ve(Pn.call(null,E,{path:"/settings/admins/?.*"})),ve(ln.call(null,E))],L=!0)},p:Q,d(P){P&&v(e),L=!1,we(R)}}}function C8(n){let e,t;return e=new Wb({props:{class:"settings-sidebar",$$slots:{default:[$8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&1&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}class bi extends be{constructor(e){super(),_e(this,e,null,C8,me,{})}}function Zh(n,e,t){const i=n.slice();return i[31]=e[t],i}function Gh(n){let e,t;return e=new he({props:{class:"form-field readonly",name:"id",$$slots:{default:[M8,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function M8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return a=new Qb({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),B(a.$$.fragment),u=M(),f=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(f,"type","text"),p(f,"id",c=n[30]),f.value=d=n[1].id,f.readOnly=!0},m(g,h){w(g,e,h),y(e,t),y(e,i),y(e,l),w(g,o,h),w(g,r,h),z(a,r,null),w(g,u,h),w(g,f,h),m=!0},p(g,h){(!m||h[0]&1073741824&&s!==(s=g[30]))&&p(e,"for",s);const _={};h[0]&2&&(_.model=g[1]),a.$set(_),(!m||h[0]&1073741824&&c!==(c=g[30]))&&p(f,"id",c),(!m||h[0]&2&&d!==(d=g[1].id)&&f.value!==d)&&(f.value=d)},i(g){m||(A(a.$$.fragment,g),m=!0)},o(g){I(a.$$.fragment,g),m=!1},d(g){g&&(v(e),v(o),v(r),v(u),v(f)),V(a)}}}function Xh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),nn(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(u,f){w(u,e,f),y(e,t),y(e,l),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(u){u&&v(e),o=!1,r()}}}function O8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[3]),u||(f=K(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&ce(r,c[3])},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function Qh(n){let e,t;return e=new he({props:{class:"form-field form-field-toggle",$$slots:{default:[D8,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function D8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function xh(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field required",name:"password",$$slots:{default:[E8,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[A8,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(t,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(t,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function E8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return c=new xb({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),B(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(h,_){w(h,e,_),y(e,t),y(e,i),y(e,l),w(h,o,_),w(h,r,_),ce(r,n[9]),w(h,u,_),w(h,f,_),z(c,f,null),d=!0,m||(g=K(r,"input",n[21]),m=!0)},p(h,_){(!d||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s),(!d||_[0]&1073741824&&a!==(a=h[30]))&&p(r,"id",a),_[0]&512&&r.value!==h[9]&&ce(r,h[9])},i(h){d||(A(c.$$.fragment,h),d=!0)},o(h){I(c.$$.fragment,h),d=!1},d(h){h&&(v(e),v(o),v(r),v(u),v(f)),V(c),m=!1,g()}}}function A8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[10]),u||(f=K(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&ce(r,c[10])},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function I8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g=!n[5]&&Gh(n),h=pe([0,1,2,3,4,5,6,7,8,9]),_=[];for(let $=0;$<10;$+=1)_[$]=Xh(Zh(n,h,$));a=new he({props:{class:"form-field required",name:"email",$$slots:{default:[O8,({uniqueId:$})=>({30:$}),({uniqueId:$})=>[$?1073741824:0]]},$$scope:{ctx:n}}});let k=!n[5]&&Qh(n),S=(n[5]||n[4])&&xh(n);return{c(){e=b("form"),g&&g.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let $=0;$<10;$+=1)_[$].c();r=M(),B(a.$$.fragment),u=M(),k&&k.c(),f=M(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m($,T){w($,e,T),g&&g.m(e,null),y(e,t),y(e,i),y(i,l),y(i,s),y(i,o);for(let C=0;C<10;C+=1)_[C]&&_[C].m(o,null);y(e,r),z(a,e,null),y(e,u),k&&k.m(e,null),y(e,f),S&&S.m(e,null),c=!0,d||(m=K(e,"submit",Ye(n[13])),d=!0)},p($,T){if($[5]?g&&(re(),I(g,1,1,()=>{g=null}),ae()):g?(g.p($,T),T[0]&32&&A(g,1)):(g=Gh($),g.c(),A(g,1),g.m(e,t)),T[0]&4){h=pe([0,1,2,3,4,5,6,7,8,9]);let D;for(D=0;D<10;D+=1){const O=Zh($,h,D);_[D]?_[D].p(O,T):(_[D]=Xh(O),_[D].c(),_[D].m(o,null))}for(;D<10;D+=1)_[D].d(1)}const C={};T[0]&1073741832|T[1]&8&&(C.$$scope={dirty:T,ctx:$}),a.$set(C),$[5]?k&&(re(),I(k,1,1,()=>{k=null}),ae()):k?(k.p($,T),T[0]&32&&A(k,1)):(k=Qh($),k.c(),A(k,1),k.m(e,f)),$[5]||$[4]?S?(S.p($,T),T[0]&48&&A(S,1)):(S=xh($),S.c(),A(S,1),S.m(e,null)):S&&(re(),I(S,1,1,()=>{S=null}),ae())},i($){c||(A(g),A(a.$$.fragment,$),A(k),A(S),c=!0)},o($){I(g),I(a.$$.fragment,$),I(k),I(S),c=!1},d($){$&&v(e),g&&g.d(),at(_,$),V(a),k&&k.d(),S&&S.d(),d=!1,m()}}}function L8(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&se(i,t)},d(l){l&&v(e)}}}function eg(n){let e,t,i,l,s,o,r,a,u;return o=new En({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[P8]},$$scope:{ctx:n}}}),{c(){e=b("button"),t=b("span"),i=M(),l=b("i"),s=M(),B(o.$$.fragment),r=M(),a=b("div"),p(l,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),y(e,t),y(e,i),y(e,l),y(e,s),z(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){I(o.$$.fragment,f),u=!1},d(f){f&&(v(e),v(r),v(a)),V(o)}}}function P8(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function F8(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,m=!n[5]&&eg(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Y(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[11]||n[7],x(s,"btn-loading",n[7])},m(g,h){m&&m.m(g,h),w(g,e,h),w(g,t,h),y(t,i),w(g,l,h),w(g,s,h),y(s,o),y(o,a),f=!0,c||(d=K(t,"click",n[17]),c=!0)},p(g,h){g[5]?m&&(re(),I(m,1,1,()=>{m=null}),ae()):m?(m.p(g,h),h[0]&32&&A(m,1)):(m=eg(g),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||h[0]&128)&&(t.disabled=g[7]),(!f||h[0]&32)&&r!==(r=g[5]?"Create":"Save changes")&&se(a,r),(!f||h[0]&2176&&u!==(u=!g[11]||g[7]))&&(s.disabled=u),(!f||h[0]&128)&&x(s,"btn-loading",g[7])},i(g){f||(A(m),f=!0)},o(g){I(m),f=!1},d(g){g&&(v(e),v(t),v(l),v(s)),m&&m.d(g),c=!1,d()}}}function N8(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[F8],header:[L8],default:[I8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[24](null),V(e,l)}}}function R8(n,e,t){let i,l;const s=rt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",m="",g="",h=!1;function _(J){return S(J),t(8,f=!0),r==null?void 0:r.show()}function k(){return r==null?void 0:r.hide()}function S(J){t(1,a=structuredClone(J||{})),$()}function $(){t(4,h=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,g=""),Gt({})}function T(){if(u||!l)return;t(7,u=!0);const J={email:d,avatar:c};(i||h)&&(J.password=m,J.passwordConfirm=g);let H;i?H=ue.admins.create(J):H=ue.admins.update(a.id,J),H.then(async U=>{var le;t(8,f=!1),k(),It(i?"Successfully created admin.":"Successfully updated admin."),((le=ue.authStore.model)==null?void 0:le.id)===U.id&&ue.authStore.save(ue.authStore.token,U),s("save",U)}).catch(U=>{ue.error(U)}).finally(()=>{t(7,u=!1)})}function C(){a!=null&&a.id&&an("Do you really want to delete the selected admin?",()=>ue.admins.delete(a.id).then(()=>{t(8,f=!1),k(),It("Successfully deleted admin."),s("delete",a)}).catch(J=>{ue.error(J)}))}const D=()=>C(),O=()=>k(),E=J=>t(2,c=J);function L(){d=this.value,t(3,d)}function R(){h=this.checked,t(4,h)}function P(){m=this.value,t(9,m)}function F(){g=this.value,t(10,g)}const N=()=>l&&f?(an("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),k()}),!1):!0;function q(J){te[J?"unshift":"push"](()=>{r=J,t(6,r)})}function W(J){Ee.call(this,n,J)}function G(J){Ee.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||h||d!==a.email||c!==a.avatar)},[k,a,c,d,h,i,r,u,f,m,g,l,o,T,C,_,D,O,E,L,R,P,F,N,q,W,G]}class q8 extends be{constructor(e){super(),_e(this,e,R8,N8,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function tg(n,e,t){const i=n.slice();return i[24]=e[t],i}function j8(n){let e;return{c(){e=b("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function H8(n){let e;return{c(){e=b("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function z8(n){let e;return{c(){e=b("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function V8(n){let e;return{c(){e=b("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ng(n){let e;function t(s,o){return s[5]?U8:B8}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function B8(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&ig(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),y(e,t),y(t,i),y(t,l),o&&o.m(t,null),y(e,s)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=ig(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function U8(n){let e;return{c(){e=b("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function ig(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function lg(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sg(n,e){let t,i,l,s,o,r,a,u,f,c,d,m=e[24].id+"",g,h,_,k,S,$=e[24].email+"",T,C,D,O,E,L,R,P,F,N,q,W,G,J;f=new rl({props:{value:e[24].id}});let H=e[24].id===e[7].id&&lg();E=new nl({props:{date:e[24].created}}),P=new nl({props:{date:e[24].updated}});function U(){return e[15](e[24])}function le(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),u=b("div"),B(f.$$.fragment),c=M(),d=b("span"),g=Y(m),h=M(),H&&H.c(),_=M(),k=b("td"),S=b("span"),T=Y($),D=M(),O=b("td"),B(E.$$.fragment),L=M(),R=b("td"),B(P.$$.fragment),F=M(),N=b("td"),N.innerHTML='',q=M(),nn(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(k,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(N,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,oe){w(ee,t,oe),y(t,i),y(i,l),y(l,s),y(t,r),y(t,a),y(a,u),z(f,u,null),y(u,c),y(u,d),y(d,g),y(a,h),H&&H.m(a,null),y(t,_),y(t,k),y(k,S),y(S,T),y(t,D),y(t,O),z(E,O,null),y(t,L),y(t,R),z(P,R,null),y(t,F),y(t,N),y(t,q),W=!0,G||(J=[K(t,"click",U),K(t,"keydown",le)],G=!0)},p(ee,oe){e=ee,(!W||oe&16&&!nn(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Te={};oe&16&&(Te.value=e[24].id),f.$set(Te),(!W||oe&16)&&m!==(m=e[24].id+"")&&se(g,m),e[24].id===e[7].id?H||(H=lg(),H.c(),H.m(a,null)):H&&(H.d(1),H=null),(!W||oe&16)&&$!==($=e[24].email+"")&&se(T,$),(!W||oe&16&&C!==(C=e[24].email))&&p(S,"title",C);const je={};oe&16&&(je.date=e[24].created),E.$set(je);const Ve={};oe&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){W||(A(f.$$.fragment,ee),A(E.$$.fragment,ee),A(P.$$.fragment,ee),W=!0)},o(ee){I(f.$$.fragment,ee),I(E.$$.fragment,ee),I(P.$$.fragment,ee),W=!1},d(ee){ee&&v(t),V(f),H&&H.d(),V(E),V(P),G=!1,we(J)}}}function W8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C=[],D=new Map,O;function E(U){n[11](U)}let L={class:"col-type-text",name:"id",$$slots:{default:[j8]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Tn({props:L}),te.push(()=>ge(o,"sort",E));function R(U){n[12](U)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[H8]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new Tn({props:P}),te.push(()=>ge(u,"sort",R));function F(U){n[13](U)}let N={class:"col-type-date col-field-created",name:"created",$$slots:{default:[z8]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),d=new Tn({props:N}),te.push(()=>ge(d,"sort",F));function q(U){n[14](U)}let W={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[V8]},$$scope:{ctx:n}};n[2]!==void 0&&(W.sort=n[2]),h=new Tn({props:W}),te.push(()=>ge(h,"sort",q));let G=pe(n[4]);const J=U=>U[24].id;for(let U=0;Ur=!1)),o.$set(ee);const oe={};le&134217728&&(oe.$$scope={dirty:le,ctx:U}),!f&&le&4&&(f=!0,oe.sort=U[2],ye(()=>f=!1)),u.$set(oe);const Te={};le&134217728&&(Te.$$scope={dirty:le,ctx:U}),!m&&le&4&&(m=!0,Te.sort=U[2],ye(()=>m=!1)),d.$set(Te);const je={};le&134217728&&(je.$$scope={dirty:le,ctx:U}),!_&&le&4&&(_=!0,je.sort=U[2],ye(()=>_=!1)),h.$set(je),le&186&&(G=pe(U[4]),re(),C=dt(C,le,J,1,U,G,D,T,Lt,sg,null,tg),ae(),!G.length&&H?H.p(U,le):G.length?H&&(H.d(1),H=null):(H=ng(U),H.c(),H.m(T,null))),(!O||le&32)&&x(e,"table-loading",U[5])},i(U){if(!O){A(o.$$.fragment,U),A(u.$$.fragment,U),A(d.$$.fragment,U),A(h.$$.fragment,U);for(let le=0;le New admin',g=M(),B(h.$$.fragment),_=M(),k=b("div"),S=M(),B($.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(k,"class","clearfix m-b-base")},m(O,E){w(O,e,E),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(e,r),z(a,e,null),y(e,u),y(e,f),y(e,c),y(e,d),y(d,m),w(O,g,E),z(h,O,E),w(O,_,E),w(O,k,E),w(O,S,E),z($,O,E),T=!0,C||(D=K(m,"click",n[9]),C=!0)},p(O,E){(!T||E&64)&&se(o,O[6]);const L={};E&2&&(L.value=O[1]),h.$set(L);const R={};E&134217918&&(R.$$scope={dirty:E,ctx:O}),$.$set(R)},i(O){T||(A(a.$$.fragment,O),A(h.$$.fragment,O),A($.$$.fragment,O),T=!0)},o(O){I(a.$$.fragment,O),I(h.$$.fragment,O),I($.$$.fragment,O),T=!1},d(O){O&&(v(e),v(g),v(_),v(k),v(S)),V(a),V(h,O),V($,O),C=!1,D()}}}function K8(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=Y("Total found: "),l=Y(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),y(e,t),y(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&se(l,i)},d(s){s&&v(e)}}}function J8(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{footer:[K8],default:[Y8]},$$scope:{ctx:n}}});let r={};return s=new q8({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[18](null),V(s,a)}}}function Z8(n,e,t){let i,l,s;We(n,Uo,P=>t(21,i=P)),We(n,Et,P=>t(6,l=P)),We(n,Ia,P=>t(7,s=P)),tn(Et,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const P=j.normalizeSearchFilter(f,["id","email","created","updated"]);return ue.admins.getFullList(100,{sort:c||"-created",filter:P}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),m(),ue.error(F,(F==null?void 0:F.status)!=400))})}function m(){t(4,a=[])}const g=()=>d(),h=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function k(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function $(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const C=P=>r==null?void 0:r.show(P),D=(P,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(P))},O=()=>t(1,f="");function E(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();il("/settings/admins?"+P),d()}},[d,f,c,r,a,u,l,s,g,h,_,k,S,$,T,C,D,O,E,L,R]}class G8 extends be{constructor(e){super(),_e(this,e,Z8,J8,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function X8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0]),s.focus(),r||(a=K(s,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&1&&s.value!==u[0]&&ce(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Q8(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Y("Password"),l=M(),s=b("input"),r=M(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[1]),w(d,r,m),w(d,a,m),y(a,u),f||(c=[K(s,"input",n[5]),ve(ln.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&ce(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),f=!1,we(c)}}}function x8(n){let e,t,i,l,s,o,r,a,u,f,c;return l=new he({props:{class:"form-field required",name:"identity",$$slots:{default:[X8,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"password",$$slots:{default:[Q8,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="

    Admin sign in

    ",i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),a=b("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),y(e,t),y(e,i),z(l,e,null),y(e,s),z(o,e,null),y(e,r),y(e,a),u=!0,f||(c=K(e,"submit",Ye(n[3])),f=!0)},p(d,m){const g={};m&769&&(g.$$scope={dirty:m,ctx:d}),l.$set(g);const h={};m&770&&(h.$$scope={dirty:m,ctx:d}),o.$set(h),(!u||m&4)&&x(a,"btn-disabled",d[2]),(!u||m&4)&&x(a,"btn-loading",d[2])},i(d){u||(A(l.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(l.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&v(e),V(l),V(o),f=!1,c()}}}function eA(n){let e,t;return e=new Z1({props:{$$slots:{default:[x8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function tA(n,e,t){let i;We(n,Uo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ue.admins.authWithPassword(s,o).then(()=>{Ea(),il("/")}).catch(()=>{hi("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){s=this.value,t(0,s)}function f(){o=this.value,t(1,o)}return[s,o,r,a,u,f]}class nA extends be{constructor(e){super(),_e(this,e,tA,eA,me,{})}}function iA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$;i=new he({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[sA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[oA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new he({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[rA,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let T=n[3]&&og(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("div"),c=b("div"),d=M(),T&&T.c(),m=M(),g=b("button"),h=b("span"),h.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(h,"class","txt"),p(g,"type","submit"),p(g,"class","btn btn-expanded"),g.disabled=_=!n[3]||n[2],x(g,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,D){w(C,e,D),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),z(a,e,null),y(e,u),y(e,f),y(f,c),y(f,d),T&&T.m(f,null),y(f,m),y(f,g),y(g,h),k=!0,S||($=K(g,"click",n[12]),S=!0)},p(C,D){const O={};D&786433&&(O.$$scope={dirty:D,ctx:C}),i.$set(O);const E={};D&786433&&(E.$$scope={dirty:D,ctx:C}),o.$set(E);const L={};D&786433&&(L.$$scope={dirty:D,ctx:C}),a.$set(L),C[3]?T?T.p(C,D):(T=og(C),T.c(),T.m(f,m)):T&&(T.d(1),T=null),(!k||D&12&&_!==(_=!C[3]||C[2]))&&(g.disabled=_),(!k||D&4)&&x(g,"btn-loading",C[2])},i(C){k||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),k=!0)},o(C){I(i.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),k=!1},d(C){C&&v(e),V(i),V(o),V(a),T&&T.d(),S=!1,$()}}}function lA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function sA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.appName),r||(a=K(s,"input",n[8]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&ce(s,u[0].meta.appName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function oA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.appUrl),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appUrl&&ce(s,u[0].meta.appUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function rA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[10]),ve(Fe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function og(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function aA(n){let e,t,i,l,s,o,r,a,u;const f=[lA,iA],c=[];function d(m,g){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,g){w(m,e,g),w(m,t,g),w(m,i,g),y(i,l),c[s].m(l,null),r=!0,a||(u=K(l,"submit",Ye(n[4])),a=!0)},p(m,g){let h=s;s=d(m),s===h?c[s].p(m,g):(re(),I(c[h],1,1,()=>{c[h]=null}),ae(),o=c[s],o?o.p(m,g):(o=c[s]=f[s](m),o.c()),A(o,1),o.m(l,null))},i(m){r||(A(o),r=!0)},o(m){I(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,u()}}}function uA(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[aA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function fA(n,e,t){let i,l,s,o;We(n,Ml,C=>t(13,l=C)),We(n,Oo,C=>t(14,s=C)),We(n,Et,C=>t(15,o=C)),tn(Et,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await ue.settings.getAll()||{};g(C)}catch(C){ue.error(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await ue.settings.update(j.filterRedactedProps(a));g(C),It("Successfully saved application settings.")}catch(C){ue.error(C)}t(2,f=!1)}}function g(C={}){var D,O;tn(Oo,s=(D=C==null?void 0:C.meta)==null?void 0:D.appName,s),tn(Ml,l=!!((O=C==null?void 0:C.meta)!=null&&O.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>h(),T=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,h,r,c,_,k,S,$,T]}class cA extends be{constructor(e){super(),_e(this,e,fA,uA,me,{})}}function dA(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),l.autofocus&&l.focus(),s||(o=[ve(Fe.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],s=!0)},p(u,f){ni(l,a=pt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(v(e),v(i),v(l)),s=!1,we(o)}}}function mA(n){let e;function t(s,o){return s[3]?pA:dA}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function hA(n,e,t){const i=["value","mask"];let l=Ze(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const f=()=>u();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Pe(Pe({},e),Kt(m)),t(5,l=Ze(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,u,l,f,c,d]}class nu extends be{constructor(e){super(),_e(this,e,hA,mA,me,{value:0,mask:1})}}function gA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;return{c(){e=b("label"),t=Y("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),u=Y(`Available placeholder parameters: + `),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`, + `),d=b("button"),d.textContent="{APP_URL} ",m=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(_,k){w(_,e,k),y(e,t),w(_,l,k),w(_,s,k),ce(s,n[0].subject),w(_,r,k),w(_,a,k),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),g||(h=[K(s,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],g=!0)},p(_,k){k[1]&1&&i!==(i=_[31])&&p(e,"for",i),k[1]&1&&o!==(o=_[31])&&p(s,"id",o),k[0]&1&&s.value!==_[0].subject&&ce(s,_[0].subject)},d(_){_&&(v(e),v(l),v(s),v(r),v(a)),g=!1,we(h)}}}function _A(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return{c(){e=b("label"),t=Y("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),u=Y(`Available placeholder parameters: + `),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`, + `),d=b("button"),d.textContent="{APP_URL} ",m=Y(`, + `),g=b("button"),g.textContent="{TOKEN} ",h=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(S,$){w(S,e,$),y(e,t),w(S,l,$),w(S,s,$),ce(s,n[0].actionUrl),w(S,r,$),w(S,a,$),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),_||(k=[K(s,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(g,"click",n[19])],_=!0)},p(S,$){$[1]&1&&i!==(i=S[31])&&p(e,"for",i),$[1]&1&&o!==(o=S[31])&&p(s,"id",o),$[0]&1&&s.value!==S[0].actionUrl&&ce(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),_=!1,we(k)}}}function bA(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),ce(e,n[0].body),i||(l=K(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&ce(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function yA(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Dt(o,r(n)),te.push(()=>ge(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Dt(o,r(a)),te.push(()=>ge(e,"value",s)),B(e.$$.fragment),A(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ye(()=>t=!1)),e.$set(f)}},i(a){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function kA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T;const C=[yA,bA],D=[];function O(E,L){return E[4]&&!E[5]?0:1}return s=O(n),o=D[s]=C[s](n),{c(){e=b("label"),t=Y("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),u=Y(`Available placeholder parameters: + `),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`, + `),d=b("button"),d.textContent="{APP_URL} ",m=Y(`, + `),g=b("button"),g.textContent="{TOKEN} ",h=Y(`, + `),_=b("button"),_.textContent="{ACTION_URL} ",k=Y("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(E,L){w(E,e,L),y(e,t),w(E,l,L),D[s].m(E,L),w(E,r,L),w(E,a,L),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),y(a,_),y(a,k),S=!0,$||(T=[K(f,"click",n[22]),K(d,"click",n[23]),K(g,"click",n[24]),K(_,"click",n[25])],$=!0)},p(E,L){(!S||L[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let R=s;s=O(E),s===R?D[s].p(E,L):(re(),I(D[R],1,1,()=>{D[R]=null}),ae(),o=D[s],o?o.p(E,L):(o=D[s]=C[s](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){S||(A(o),S=!0)},o(E){I(o),S=!1},d(E){E&&(v(e),v(l),v(r),v(a)),D[s].d(E),$=!1,we(T)}}}function vA(n){let e,t,i,l,s,o;return e=new he({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[gA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new he({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[_A,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new he({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[kA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),s.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function rg(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function wA(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&rg();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=Y(n[2]),o=M(),r=b("div"),a=M(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(s,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=rg(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function SA(n){let e,t;const i=[n[8]];let l={$$slots:{header:[wA],default:[vA]},$$scope:{ctx:n}};for(let s=0;st(12,o=U));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=ag,d=!1;function m(){f==null||f.expand()}function g(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await st(()=>import("./CodeEditor-c4a370cf.js"),["./CodeEditor-c4a370cf.js","./index-102ce751.js"],import.meta.url)).default),ag=c,t(5,d=!1))}function k(U){j.copyToClipboard(U),$o(`Copied ${U} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function C(){u.actionUrl=this.value,t(0,u)}const D=()=>k("{APP_NAME}"),O=()=>k("{APP_URL}"),E=()=>k("{TOKEN}");function L(U){n.$$.not_equal(u.body,U)&&(u.body=U,t(0,u))}function R(){u.body=this.value,t(0,u)}const P=()=>k("{APP_NAME}"),F=()=>k("{APP_URL}"),N=()=>k("{TOKEN}"),q=()=>k("{ACTION_URL}");function W(U){te[U?"unshift":"push"](()=>{f=U,t(3,f)})}function G(U){Ee.call(this,n,U)}function J(U){Ee.call(this,n,U)}function H(U){Ee.call(this,n,U)}return n.$$set=U=>{e=Pe(Pe({},e),Kt(U)),t(8,s=Ze(e,l)),"key"in U&&t(1,r=U.key),"title"in U&&t(2,a=U.title),"config"in U&&t(0,u=U.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||ii(r))},[u,r,a,f,c,d,i,k,s,m,g,h,o,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J,H]}class jr extends be{constructor(e){super(),_e(this,e,TA,SA,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function ug(n,e,t){const i=n.slice();return i[21]=e[t],i}function fg(n,e){let t,i,l,s,o,r=e[21].label+"",a,u,f,c,d,m;return c=v0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=Y(r),f=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,ce(i,i.__value),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(g,h){w(g,t,h),y(t,i),i.checked=i.__value===e[2],y(t,s),y(t,o),y(o,a),y(t,f),d||(m=K(i,"change",e[10]),d=!0)},p(g,h){e=g,h&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),h&4&&(i.checked=i.__value===e[2]),h&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(g){g&&v(t),c.r(),d=!1,m()}}}function $A(n){let e=[],t=new Map,i,l=pe(n[7]);const s=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new he({props:{class:"form-field required m-0",name:"email",$$slots:{default:[CA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),z(t,e,null),y(e,i),z(l,e,null),s=!0,o||(r=K(e,"submit",Ye(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(A(t.$$.fragment,a),A(l.$$.fragment,a),s=!0)},o(a){I(t.$$.fragment,a),I(l.$$.fragment,a),s=!1},d(a){a&&v(e),V(t),V(l),o=!1,r()}}}function OA(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function DA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function EA(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[DA],header:[OA],default:[MA]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[15](null),V(e,l)}}}const Hr="last_email_test",cg="email_test_request";function AA(n,e,t){let i;const l=rt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Hr),u=o[0].value,f=!1,c=null;function d(O="",E=""){t(1,a=O||localStorage.getItem(Hr)),t(2,u=E||o[0].value),Gt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function g(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Hr,a),clearTimeout(c),c=setTimeout(()=>{ue.cancelRequest(cg),hi("Test email send timeout.")},3e4);try{await ue.settings.testEmail(a,u,{$cancelKey:cg}),It("Successfully sent test email."),l("submit"),t(4,f=!1),await Qt(),m()}catch(O){t(4,f=!1),ue.error(O)}clearTimeout(c)}}const h=[[]];function _(){u=this.__value,t(2,u)}function k(){a=this.value,t(1,a)}const S=()=>g(),$=()=>!f;function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function C(O){Ee.call(this,n,O)}function D(O){Ee.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,s,o,g,d,_,h,k,S,$,T,C,D]}class IA extends be{constructor(e){super(),_e(this,e,AA,EA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function LA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;i=new he({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[FA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[NA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});function P(ee){n[15](ee)}let F={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(F.config=n[0].meta.verificationTemplate),u=new jr({props:F}),te.push(()=>ge(u,"config",P));function N(ee){n[16](ee)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new jr({props:q}),te.push(()=>ge(d,"config",N));function W(ee){n[17](ee)}let G={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(G.config=n[0].meta.confirmEmailChangeTemplate),h=new jr({props:G}),te.push(()=>ge(h,"config",W)),T=new he({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[RA,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let J=n[0].smtp.enabled&&dg(n);function H(ee,oe){return ee[5]?JA:KA}let U=H(n),le=U(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),c=M(),B(d.$$.fragment),g=M(),B(h.$$.fragment),k=M(),S=b("hr"),$=M(),B(T.$$.fragment),C=M(),J&&J.c(),D=M(),O=b("div"),E=b("div"),L=M(),le.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(E,"class","flex-fill"),p(O,"class","flex")},m(ee,oe){w(ee,e,oe),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),w(ee,r,oe),w(ee,a,oe),z(u,a,null),y(a,c),z(d,a,null),y(a,g),z(h,a,null),w(ee,k,oe),w(ee,S,oe),w(ee,$,oe),z(T,ee,oe),w(ee,C,oe),J&&J.m(ee,oe),w(ee,D,oe),w(ee,O,oe),y(O,E),y(O,L),le.m(O,null),R=!0},p(ee,oe){const Te={};oe[0]&1|oe[1]&24&&(Te.$$scope={dirty:oe,ctx:ee}),i.$set(Te);const je={};oe[0]&1|oe[1]&24&&(je.$$scope={dirty:oe,ctx:ee}),o.$set(je);const Ve={};!f&&oe[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,ye(()=>f=!1)),u.$set(Ve);const Qe={};!m&&oe[0]&1&&(m=!0,Qe.config=ee[0].meta.resetPasswordTemplate,ye(()=>m=!1)),d.$set(Qe);const tt={};!_&&oe[0]&1&&(_=!0,tt.config=ee[0].meta.confirmEmailChangeTemplate,ye(()=>_=!1)),h.$set(tt);const Ge={};oe[0]&1|oe[1]&24&&(Ge.$$scope={dirty:oe,ctx:ee}),T.$set(Ge),ee[0].smtp.enabled?J?(J.p(ee,oe),oe[0]&1&&A(J,1)):(J=dg(ee),J.c(),A(J,1),J.m(D.parentNode,D)):J&&(re(),I(J,1,1,()=>{J=null}),ae()),U===(U=H(ee))&&le?le.p(ee,oe):(le.d(1),le=U(ee),le&&(le.c(),le.m(O,null)))},i(ee){R||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(h.$$.fragment,ee),A(T.$$.fragment,ee),A(J),R=!0)},o(ee){I(i.$$.fragment,ee),I(o.$$.fragment,ee),I(u.$$.fragment,ee),I(d.$$.fragment,ee),I(h.$$.fragment,ee),I(T.$$.fragment,ee),I(J),R=!1},d(ee){ee&&(v(e),v(r),v(a),v(k),v(S),v($),v(C),v(D),v(O)),V(i),V(o),V(u),V(d),V(h),V(T,ee),J&&J.d(ee),le.d()}}}function PA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function FA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.senderName),r||(a=K(s,"input",n[13]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&ce(s,u[0].meta.senderName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function NA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].meta.senderAddress),r||(a=K(s,"input",n[14]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&ce(s,u[0].meta.senderAddress)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function RA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server (recommended)",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[18]),ve(Fe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function dg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T;l=new he({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[qA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[jA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),f=new he({props:{class:"form-field",name:"smtp.username",$$slots:{default:[HA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new he({props:{class:"form-field",name:"smtp.password",$$slots:{default:[zA,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?BA:VA}let D=C(n),O=D(n),E=n[4]&&pg(n);return{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),g=M(),h=b("button"),O.c(),_=M(),E&&E.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(h,"type","button"),p(h,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,u),z(f,u,null),y(t,c),y(t,d),z(m,d,null),y(e,g),y(e,h),O.m(h,null),y(e,_),E&&E.m(e,null),S=!0,$||(T=K(h,"click",Ye(n[23])),$=!0)},p(L,R){const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),l.$set(P);const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),r.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),f.$set(N);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),D!==(D=C(L))&&(O.d(1),O=D(L),O&&(O.c(),O.m(h,null))),L[4]?E?(E.p(L,R),R[0]&16&&A(E,1)):(E=pg(L),E.c(),A(E,1),E.m(e,null)):E&&(re(),I(E,1,1,()=>{E=null}),ae())},i(L){S||(A(l.$$.fragment,L),A(r.$$.fragment,L),A(f.$$.fragment,L),A(m.$$.fragment,L),A(E),L&&Ke(()=>{S&&(k||(k=Le(e,et,{duration:150},!0)),k.run(1))}),S=!0)},o(L){I(l.$$.fragment,L),I(r.$$.fragment,L),I(f.$$.fragment,L),I(m.$$.fragment,L),I(E),L&&(k||(k=Le(e,et,{duration:150},!1)),k.run(0)),S=!1},d(L){L&&v(e),V(l),V(r),V(f),V(m),O.d(),E&&E.d(),L&&k&&k.end(),$=!1,T()}}}function qA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].smtp.host),r||(a=K(s,"input",n[19]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&ce(s,u[0].smtp.host)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function jA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].smtp.port),r||(a=K(s,"input",n[20]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&ut(s.value)!==u[0].smtp.port&&ce(s,u[0].smtp.port)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function HA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].smtp.username),r||(a=K(s,"input",n[21]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&ce(s,u[0].smtp.username)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function zA(n){let e,t,i,l,s,o,r;function a(f){n[22](f)}let u={id:n[34]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),s=new nu({props:u}),te.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=Y("Password"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function VA(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function BA(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function pg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new he({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[UA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[WA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[YA,({uniqueId:g})=>({34:g}),({uniqueId:g})=>[0,g?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),f=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(g,h){w(g,e,h),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),y(e,f),y(e,c),m=!0},p(g,h){const _={};h[0]&1|h[1]&24&&(_.$$scope={dirty:h,ctx:g}),i.$set(_);const k={};h[0]&1|h[1]&24&&(k.$$scope={dirty:h,ctx:g}),o.$set(k);const S={};h[0]&1|h[1]&24&&(S.$$scope={dirty:h,ctx:g}),u.$set(S)},i(g){m||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),g&&Ke(()=>{m&&(d||(d=Le(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(g){I(i.$$.fragment,g),I(o.$$.fragment,g),I(u.$$.fragment,g),g&&(d||(d=Le(e,et,{duration:150},!1)),d.run(0)),m=!1},d(g){g&&v(e),V(i),V(o),V(u),g&&d&&d.end()}}}function UA(n){let e,t,i,l,s,o,r;function a(f){n[24](f)}let u={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),s=new _i({props:u}),te.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("TLS encryption"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function WA(n){let e,t,i,l,s,o,r;function a(f){n[25](f)}let u={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),s=new _i({props:u}),te.push(()=>ge(s,"keyOfSelected",a)),{c(){e=b("label"),t=Y("AUTH method"),l=M(),B(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function YA(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),w(c,o,d),w(c,r,d),ce(r,n[0].smtp.localName),u||(f=[ve(Fe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),K(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&ce(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),u=!1,we(f)}}}function KA(n){let e,t,i;return{c(){e=b("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function JA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=[K(e,"click",n[27]),K(l,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f[0]&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function ZA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[PA,LA],S=[];function $(T,C){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[6]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[30])),h=!0)},p(T,C){(!g||C[0]&64)&&se(o,T[6]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function GA(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{default:[ZA]},$$scope:{ctx:n}}});let r={};return s=new IA({props:r}),n[31](s),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,a,u),o=!0},p(a,u){const f={};u[0]&127|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[31](null),V(s,a)}}}function XA(n,e,t){let i,l,s;We(n,Et,ee=>t(6,s=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];tn(Et,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1;g();async function g(){t(2,c=!0);try{const ee=await ue.settings.getAll()||{};_(ee)}catch(ee){ue.error(ee)}t(2,c=!1)}async function h(){if(!(d||!l)){t(3,d=!0);try{const ee=await ue.settings.update(j.filterRedactedProps(f));_(ee),Gt({}),It("Successfully saved mail settings.")}catch(ee){ue.error(ee)}t(3,d=!1)}}function _(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(11,u=JSON.parse(JSON.stringify(f)))}function k(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function T(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function C(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function D(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=ut(this.value),t(0,f)}function R(){f.smtp.username=this.value,t(0,f)}function P(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const F=()=>{t(4,m=!m)};function N(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function q(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function W(){f.smtp.localName=this.value,t(0,f)}const G=()=>k(),J=()=>h(),H=()=>a==null?void 0:a.show(),U=()=>h();function le(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(u)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(f))},[f,a,c,d,m,l,s,o,r,h,k,u,i,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J,H,U,le]}class QA extends be{constructor(e){super(),_e(this,e,XA,GA,me,{},null,[-1,-1])}}const xA=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),mg=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function eI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&se(s,u[4]),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function hg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D;return i=new he({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[tI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),o=new he({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[nI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[iI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),d=new he({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[lI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),h=new he({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[sI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),S=new he({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[oI,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),r=M(),a=b("div"),B(u.$$.fragment),f=M(),c=b("div"),B(d.$$.fragment),m=M(),g=b("div"),B(h.$$.fragment),_=M(),k=b("div"),B(S.$$.fragment),$=M(),T=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(k,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),y(e,r),y(e,a),z(u,a,null),y(e,f),y(e,c),z(d,c,null),y(e,m),y(e,g),z(h,g,null),y(e,_),y(e,k),z(S,k,null),y(e,$),y(e,T),D=!0},p(O,E){const L={};E&8&&(L.name=O[3]+".endpoint"),E&1081345&&(L.$$scope={dirty:E,ctx:O}),i.$set(L);const R={};E&8&&(R.name=O[3]+".bucket"),E&1081345&&(R.$$scope={dirty:E,ctx:O}),o.$set(R);const P={};E&8&&(P.name=O[3]+".region"),E&1081345&&(P.$$scope={dirty:E,ctx:O}),u.$set(P);const F={};E&8&&(F.name=O[3]+".accessKey"),E&1081345&&(F.$$scope={dirty:E,ctx:O}),d.$set(F);const N={};E&8&&(N.name=O[3]+".secret"),E&1081345&&(N.$$scope={dirty:E,ctx:O}),h.$set(N);const q={};E&8&&(q.name=O[3]+".forcePathStyle"),E&1081345&&(q.$$scope={dirty:E,ctx:O}),S.$set(q)},i(O){D||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(h.$$.fragment,O),A(S.$$.fragment,O),O&&Ke(()=>{D&&(C||(C=Le(e,et,{duration:150},!0)),C.run(1))}),D=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(u.$$.fragment,O),I(d.$$.fragment,O),I(h.$$.fragment,O),I(S.$$.fragment,O),O&&(C||(C=Le(e,et,{duration:150},!1)),C.run(0)),D=!1},d(O){O&&v(e),V(i),V(o),V(u),V(d),V(h),V(S),O&&C&&C.end()}}}function tI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].endpoint),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].endpoint&&ce(s,u[0].endpoint)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function nI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].bucket),r||(a=K(s,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].bucket&&ce(s,u[0].bucket)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function iI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].region),r||(a=K(s,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].region&&ce(s,u[0].region)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function lI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[0].accessKey),r||(a=K(s,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].accessKey&&ce(s,u[0].accessKey)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function sI(n){let e,t,i,l,s,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),s=new nu({props:u}),te.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=Y("Secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function oI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[14]),ve(Fe.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function rI(n){let e,t,i,l,s;e=new he({props:{class:"form-field form-field-toggle",$$slots:{default:[eI,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=vt(o,n,n[15],mg);let a=n[0].enabled&&hg(n);return{c(){B(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ke()},m(u,f){z(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,l,f),s=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&32775)&&St(r,o,u,u[15],s?wt(o,u[15],f,xA):Tt(u[15]),mg),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=hg(u),a.c(),A(a,1),a.m(l.parentNode,l)):a&&(re(),I(a,1,1,()=>{a=null}),ae())},i(u){s||(A(e.$$.fragment,u),A(r,u),A(a),s=!0)},o(u){I(e.$$.fragment,u),I(r,u),I(a),s=!1},d(u){u&&(v(t),v(i),v(l)),V(e,u),r&&r.d(u),a&&a.d(u)}}}const zr="s3_test_request";function aI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null;function g(O){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{h()},O)}async function h(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;ue.cancelRequest(zr),clearTimeout(d),d=setTimeout(()=>{ue.cancelRequest(zr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let O;try{await ue.settings.testS3(u,{$cancelKey:zr})}catch(E){O=E}return O!=null&&O.isAbort||(t(1,f=O),t(2,c=!1),clearTimeout(d)),f}Vt(()=>()=>{clearTimeout(d),clearTimeout(m)});function _(){o.enabled=this.checked,t(0,o)}function k(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function $(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function C(O){n.$$.not_equal(o.secret,O)&&(o.secret=O,t(0,o))}function D(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=O=>{"originalConfig"in O&&t(5,s=O.originalConfig),"config"in O&&t(0,o=O.config),"configKey"in O&&t(3,r=O.configKey),"toggleLabel"in O&&t(4,a=O.toggleLabel),"testFilesystem"in O&&t(6,u=O.testFilesystem),"testError"in O&&t(1,f=O.testError),"isTesting"in O&&t(2,c=O.isTesting),"$$scope"in O&&t(15,l=O.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&g(100),n.$$.dirty&9&&(o.enabled||ii(r))},[o,f,c,r,a,s,u,i,_,k,S,$,T,C,D,l]}class t0 extends be{constructor(e){super(),_e(this,e,aI,rI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function uI(n){var O;let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;function k(E){n[11](E)}function S(E){n[12](E)}function $(E){n[13](E)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[cI]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new t0({props:T}),te.push(()=>ge(e,"config",k)),te.push(()=>ge(e,"isTesting",S)),te.push(()=>ge(e,"testError",$));let C=((O=n[1].s3)==null?void 0:O.enabled)&&!n[6]&&!n[3]&&_g(n),D=n[6]&&bg(n);return{c(){B(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),u=M(),D&&D.c(),f=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(E,L){z(e,E,L),w(E,s,L),w(E,o,L),y(o,r),y(o,a),C&&C.m(o,null),y(o,u),D&&D.m(o,null),y(o,f),y(o,c),y(c,d),g=!0,h||(_=K(c,"click",n[15]),h=!0)},p(E,L){var P;const R={};L&1&&(R.originalConfig=E[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:E}),!t&&L&2&&(t=!0,R.config=E[1].s3,ye(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=E[4],ye(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=E[5],ye(()=>l=!1)),e.$set(R),(P=E[1].s3)!=null&&P.enabled&&!E[6]&&!E[3]?C?C.p(E,L):(C=_g(E),C.c(),C.m(o,u)):C&&(C.d(1),C=null),E[6]?D?D.p(E,L):(D=bg(E),D.c(),D.m(o,f)):D&&(D.d(1),D=null),(!g||L&72&&m!==(m=!E[6]||E[3]))&&(c.disabled=m),(!g||L&8)&&x(c,"btn-loading",E[3])},i(E){g||(A(e.$$.fragment,E),g=!0)},o(E){I(e.$$.fragment,E),g=!1},d(E){E&&(v(s),v(o)),V(e,E),C&&C.d(),D&&D.d(),h=!1,_()}}}function fI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function gg(n){var L;let e,t,i,l,s,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",m,g,h,_,k,S,$,T,C,D,O,E;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='',l=M(),s=b("div"),o=Y(`If you have existing uploaded files, you'll have to migrate them manually + from the + `),r=b("strong"),u=Y(a),f=Y(` + to the + `),c=b("strong"),m=Y(d),g=Y(`. + `),h=b("br"),_=Y(` + There are numerous command line tools that can help you, such as: + `),k=b("a"),k.textContent=`rclone + `,S=Y(`, + `),$=b("a"),$.textContent=`s5cmd + `,T=Y(", etc."),C=M(),D=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(R,P){w(R,e,P),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(r,u),y(s,f),y(s,c),y(c,m),y(s,g),y(s,h),y(s,_),y(s,k),y(s,S),y(s,$),y(s,T),y(e,C),y(e,D),E=!0},p(R,P){var F;(!E||P&1)&&a!==(a=(F=R[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&se(u,a),(!E||P&2)&&d!==(d=R[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(R){E||(R&&Ke(()=>{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(R){R&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(R){R&&v(e),R&&O&&O.end()}}}function cI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&gg(n);return{c(){t&&t.c(),e=ke()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&A(t,1)):(t=gg(l),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),I(t,1,1,()=>{t=null}),ae())},d(l){l&&v(e),t&&t.d(l)}}}function _g(n){let e;function t(s,o){return s[4]?mI:s[5]?pI:dI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function dI(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function pI(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=ve(t=Fe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function mI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bg(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function hI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[fI,uI],S=[];function $(T,C){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[7]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[16])),h=!0)},p(T,C){(!g||C&128)&&se(o,T[7]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function gI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[hI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}const _I="s3_test_request";function bI(n,e,t){let i,l,s;We(n,Et,D=>t(7,s=D)),tn(Et,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const D=await ue.settings.getAll()||{};g(D)}catch(D){ue.error(D)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{ue.cancelRequest(_I);const D=await ue.settings.update(j.filterRedactedProps(r));Gt({}),await g(D),Ea(),c?rv("Successfully saved but failed to establish S3 connection."):It("Successfully saved files storage settings.")}catch(D){ue.error(D)}t(3,u=!1)}}async function g(D={}){t(1,r={s3:(D==null?void 0:D.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(D){n.$$.not_equal(r.s3,D)&&(r.s3=D,t(1,r))}function k(D){f=D,t(4,f)}function S(D){c=D,t(5,c)}const $=()=>h(),T=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,h,i,_,k,S,$,T,C]}class yI extends be{constructor(e){super(),_e(this,e,bI,gI,me,{})}}function kI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function vI(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Y("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(f,c){w(f,e,c),y(e,t),w(f,l,c),w(f,s,c),ce(s,n[1].clientId),a||(u=K(s,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(s,"id",o),c&2&&r!==(r=f[1].enabled)&&(s.required=r),c&2&&s.value!==f[1].clientId&&ce(s,f[1].clientId)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function wI(n){let e,t,i,l,s,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),s=new nu({props:u}),te.push(()=>ge(s,"value",a)),{c(){e=b("label"),t=Y("Client secret"),l=M(),B(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),y(e,t),w(f,l,c),z(s,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,ye(()=>o=!1)),s.$set(d)},i(f){r||(A(s.$$.fragment,f),r=!0)},o(f){I(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),V(s,f)}}}function yg(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(u){n[14](u)}var r=n[3].optionsComponent;function a(u,f){let c={};if(f!==void 0&&f&8)c=pt(s,[{key:u[3].key},Ct(u[3].optionsComponentProps||{})]);else for(let d=0;dge(t,"config",o))),{c(){e=b("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&z(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(t=Dt(r,a(u,f)),te.push(()=>ge(t,"config",o)),B(t.$$.fragment),A(t.$$.fragment,1),z(t,e,null)):t=null}else if(r){const c=f&8?pt(s,[{key:u[3].key},Ct(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],ye(()=>i=!1)),t.$set(c)}},i(u){l||(t&&A(t.$$.fragment,u),l=!0)},o(u){t&&I(t.$$.fragment,u),l=!1},d(u){u&&v(e),t&&V(t)}}}function SI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new he({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[kI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[vI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}}),u=new he({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[wI,({uniqueId:h})=>({20:h}),({uniqueId:h})=>h?1048576:0]},$$scope:{ctx:n}}});let g=n[3].optionsComponent&&yg(n);return{c(){e=b("form"),t=b("div"),B(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='Clear all fields',o=M(),B(r.$$.fragment),a=M(),B(u.$$.fragment),f=M(),g&&g.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(h,_){w(h,e,_),y(e,t),z(i,t,null),y(t,l),y(t,s),y(e,o),z(r,e,null),y(e,a),z(u,e,null),y(e,f),g&&g.m(e,null),c=!0,d||(m=[K(s,"click",n[8]),K(e,"submit",Ye(n[15]))],d=!0)},p(h,_){const k={};_&8&&(k.name=h[3].key+".enabled"),_&3145730&&(k.$$scope={dirty:_,ctx:h}),i.$set(k);const S={};_&2&&(S.class="form-field "+(h[1].enabled?"required":"")),_&8&&(S.name=h[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:h}),r.$set(S);const $={};_&2&&($.class="form-field "+(h[1].enabled?"required":"")),_&8&&($.name=h[3].key+".clientSecret"),_&3145730&&($.$$scope={dirty:_,ctx:h}),u.$set($),h[3].optionsComponent?g?(g.p(h,_),_&8&&A(g,1)):(g=yg(h),g.c(),A(g,1),g.m(e,null)):g&&(re(),I(g,1,1,()=>{g=null}),ae())},i(h){c||(A(i.$$.fragment,h),A(r.$$.fragment,h),A(u.$$.fragment,h),A(g),c=!0)},o(h){I(i.$$.fragment,h),I(r.$$.fragment,h),I(u.$$.fragment,h),I(g),c=!1},d(h){h&&v(e),V(i),V(r),V(u),g&&g.d(),d=!1,we(m)}}}function TI(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=Y(t),l=Y(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),y(e,i),y(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&se(i,t)},d(s){s&&v(e)}}}function $I(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function CI(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[$I],header:[TI],default:[SI]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[16](null),V(e,l)}}}function MI(n,e,t){let i;const l=rt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(O,E){Gt({}),t(3,r=Object.assign({},O)),t(1,a=Object.assign({enabled:!0},E)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,u=!0);try{const O={};O[r.key]=j.filterRedactedProps(a);const E=await ue.settings.update(O);Gt({}),It("Successfully updated provider settings."),l("submit",E),d()}catch(O){ue.error(O)}t(4,u=!1)}function g(){for(let O in a)t(1,a[O]="",a);t(1,a.enabled=!1,a)}function h(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function k(O){n.$$.not_equal(a.clientSecret,O)&&(a.clientSecret=O,t(1,a))}function S(O){a=O,t(1,a)}const $=()=>m();function T(O){te[O?"unshift":"push"](()=>{o=O,t(2,o)})}function C(O){Ee.call(this,n,O)}function D(O){Ee.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,s,m,g,c,f,h,_,k,S,$,T,C,D]}class OI extends be{constructor(e){super(),_e(this,e,MI,CI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function kg(n){let e,t,i;return{c(){e=b("img"),nn(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!nn(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function vg(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function DI(n){let e,t,i,l,s=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,m,g,h,_,k,S,$,T,C=n[1].logo&&kg(n),D=n[0].enabled&&vg(),O={};return k=new OI({props:O}),n[4](k),k.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=Y(s),r=M(),a=b("em"),u=Y("("),c=Y(f),d=Y(")"),m=M(),D&&D.c(),g=M(),h=b("button"),h.innerHTML='',_=M(),B(k.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(h,"type","button"),p(h,"class","btn btn-circle btn-hint btn-transparent"),p(h,"aria-label","Provider settings"),p(e,"class","provider-card")},m(E,L){w(E,e,L),y(e,t),C&&C.m(t,null),y(e,i),y(e,l),y(l,o),y(e,r),y(e,a),y(a,u),y(a,c),y(a,d),y(e,m),D&&D.m(e,null),y(e,g),y(e,h),w(E,_,L),z(k,E,L),S=!0,$||(T=K(h,"click",n[3]),$=!0)},p(E,[L]){E[1].logo?C?C.p(E,L):(C=kg(E),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=E[1].title+"")&&se(o,s),(!S||L&2)&&f!==(f=E[1].key.slice(0,-4)+"")&&se(c,f),E[0].enabled?D||(D=vg(),D.c(),D.m(e,g)):D&&(D.d(1),D=null);const R={};k.$set(R)},i(E){S||(A(k.$$.fragment,E),S=!0)},o(E){I(k.$$.fragment,E),S=!1},d(E){E&&(v(e),v(_)),C&&C.d(),D&&D.d(),n[4](null),V(k,E),$=!1,T()}}}function EI(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{u.detail[i.key]&&t(0,l=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class n0 extends be{constructor(e){super(),_e(this,e,EI,DI,me,{provider:1,config:0})}}function wg(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Sg(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function AI(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,u,f=pe(n[3]);const c=h=>h[9].key;for(let h=0;h0&&n[2].length>0&&$g(),m=pe(n[2]);const g=h=>h[9].key;for(let h=0;h0&&h[2].length>0?d||(d=$g(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&5&&(m=pe(h[2]),re(),r=dt(r,_,g,1,h,m,a,o,Lt,Cg,null,wg),ae())},i(h){if(!u){for(let _=0;_ge(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),z(i,t,null),y(t,s),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!l&&f&9&&(l=!0,c.config=e[0][e[9].key],ye(()=>l=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i)}}}function $g(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Cg(n,e){let t,i,l,s,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new n0({props:a}),te.push(()=>ge(i,"config",r)),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),z(i,t,null),y(t,s),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!l&&f&5&&(l=!0,c.config=e[0][e[9].key],ye(()=>l=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){I(i.$$.fragment,u),o=!1},d(u){u&&v(t),V(i)}}}function LI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;const h=[II,AI],_=[];function k(S,$){return S[1]?0:1}return d=k(n),m=_[d]=h[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[4]),r=M(),a=b("div"),u=b("div"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,$){w(S,e,$),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(S,r,$),w(S,a,$),y(a,u),y(u,f),y(u,c),_[d].m(u,null),g=!0},p(S,$){(!g||$&16)&&se(o,S[4]);let T=d;d=k(S),d===T?_[d].p(S,$):(re(),I(_[T],1,1,()=>{_[T]=null}),ae(),m=_[d],m?m.p(S,$):(m=_[d]=h[d](S),m.c()),A(m,1),m.m(u,null))},i(S){g||(A(m),g=!0)},o(S){I(m),g=!1},d(S){S&&(v(e),v(r),v(a)),_[d].d()}}}function PI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[LI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function FI(n,e,t){let i,l,s;We(n,Et,d=>t(4,s=d)),tn(Et,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ue.settings.getAll()||{};u(d)}catch(d){ue.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const m of yo)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function f(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=yo.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=yo.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,f,c]}class NI extends be{constructor(e){super(),_e(this,e,FI,PI,me,{})}}function RI(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=Y(n[3]),i=Y(" duration (in seconds)"),s=M(),o=b("input"),a=M(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,g){w(m,e,g),y(e,t),y(e,i),w(m,s,g),w(m,o,g),ce(o,n[0]),w(m,a,g),w(m,u,g),y(u,f),c||(d=[K(o,"input",n[4]),K(f,"click",n[5])],c=!0)},p(m,g){g&8&&se(t,m[3]),g&64&&l!==(l=m[6])&&p(e,"for",l),g&64&&r!==(r=m[6])&&p(o,"id",r),g&1&&ut(o.value)!==m[0]&&ce(o,m[0]),g&2&&x(f,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(u)),c=!1,we(d)}}}function qI(n){let e,t;return e=new he({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[RI,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function jI(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=ut(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class i0 extends be{constructor(e){super(),_e(this,e,jI,qI,me,{key:2,label:3,duration:0,secret:1})}}function Mg(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Og(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function HI(n){let e,t,i=[],l=new Map,s,o,r,a,u,f=[],c=new Map,d,m,g,h,_,k,S,$,T,C,D,O=pe(n[5]);const E=F=>F[19].key;for(let F=0;FF[19].key;for(let F=0;Fge(i,"duration",r)),te.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),z(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ye(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ye(()=>s=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i,f)}}}function Eg(n,e){let t,i,l,s,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new i0({props:u}),te.push(()=>ge(i,"duration",r)),te.push(()=>ge(i,"secret",a)),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),z(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ye(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ye(()=>s=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){I(i.$$.fragment,f),o=!1},d(f){f&&v(t),V(i,f)}}}function Ag(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function VI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[zI,HI],S=[];function $(T,C){return T[1]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[4]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="

    Adjust common token options.

    ",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[7])),h=!0)},p(T,C){(!g||C&16)&&se(o,T[4]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function BI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[VI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function UI(n,e,t){let i,l,s;We(n,Et,D=>t(4,s=D));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];tn(Et,s="Token options",s);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const D=await ue.settings.getAll()||{};g(D)}catch(D){ue.error(D)}t(1,f=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const D=await ue.settings.update(j.filterRedactedProps(u));g(D),It("Successfully saved tokens options.")}catch(D){ue.error(D)}t(2,c=!1)}}function g(D){var E;D=D||{},t(0,u={});const O=o.concat(r);for(const L of O)t(0,u[L.key]={duration:((E=D[L.key])==null?void 0:E.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function h(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(D,O){n.$$.not_equal(u[O.key].duration,D)&&(u[O.key].duration=D,t(0,u))}function k(D,O){n.$$.not_equal(u[O.key].secret,D)&&(u[O.key].secret=D,t(0,u))}function S(D,O){n.$$.not_equal(u[O.key].duration,D)&&(u[O.key].duration=D,t(0,u))}function $(D,O){n.$$.not_equal(u[O.key].secret,D)&&(u[O.key].secret=D,t(0,u))}const T=()=>h(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(u))},[u,f,c,l,s,o,r,m,h,a,i,_,k,S,$,T,C]}class WI extends be{constructor(e){super(),_e(this,e,UI,BI,me,{})}}function YI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g;return o=new Vb({props:{content:n[2]}}),{c(){e=b("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in + another PocketBase environment.

    `,t=M(),i=b("div"),l=b("button"),l.innerHTML='Copy',s=M(),B(o.$$.fragment),r=M(),a=b("div"),u=b("div"),f=M(),c=b("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(h,_){w(h,e,_),w(h,t,_),w(h,i,_),y(i,l),y(i,s),z(o,i,null),n[8](i),w(h,r,_),w(h,a,_),y(a,u),y(a,f),y(a,c),d=!0,m||(g=[K(l,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(h,_){const k={};_&4&&(k.content=h[2]),o.$set(k)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){I(o.$$.fragment,h),d=!1},d(h){h&&(v(e),v(t),v(i),v(r),v(a)),V(o),n[8](null),m=!1,we(g)}}}function KI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function JI(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[KI,YI],g=[];function h(_,k){return _[1]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[3]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k&8)&&se(o,_[3]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function ZI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[JI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function GI(n,e,t){let i,l;We(n,Et,_=>t(3,l=_)),tn(Et,l="Export collections",l);const s="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ue.collections.getFullList(100,{$cancelKey:s,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){ue.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),$o("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const k=window.getSelection(),S=document.createRange();S.selectNodeContents(o),k.removeAllRanges(),k.addRange(S)}},h=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,l,f,c,r,d,m,g,h]}class XI extends be{constructor(e){super(),_e(this,e,GI,ZI,me,{})}}function Ig(n,e,t){const i=n.slice();return i[14]=e[t],i}function Lg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Pg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Fg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Ng(n,e,t){const i=n.slice();return i[14]=e[t],i}function Rg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function qg(n,e,t){const i=n.slice();return i[30]=e[t],i}function QI(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&jg(),a=n[0].name!==n[1].name&&Hg(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=Y(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),y(e,t),a&&a.m(e,null),y(e,i),y(e,l),y(l,o)},p(u,f){u[9]?r||(r=jg(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Hg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&se(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function xI(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=Y(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),y(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function eL(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=Y(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),y(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function jg(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Hg(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=Y(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),y(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function zg(n){var g,h;let e,t,i,l,s,o,r=n[12]((g=n[0])==null?void 0:g[n[30]])+"",a,u,f,c,d=n[12]((h=n[1])==null?void 0:h[n[30]])+"",m;return{c(){var _,k,S,$,T,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=Y(r),u=M(),f=b("td"),c=b("pre"),m=Y(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&mn((_=n[0])==null?void 0:_[n[30]],(k=n[1])==null?void 0:k[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),x(f,"changed-new-col",!n[5]&&mn((S=n[0])==null?void 0:S[n[30]],($=n[1])==null?void 0:$[n[30]])),x(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",mn((T=n[0])==null?void 0:T[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(_,k){w(_,e,k),y(e,t),y(t,i),y(e,l),y(e,s),y(s,o),y(o,a),y(e,u),y(e,f),y(f,c),y(c,m)},p(_,k){var S,$,T,C,D,O,E,L;k[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&se(a,r),k[0]&3075&&x(s,"changed-old-col",!_[10]&&mn(($=_[0])==null?void 0:$[_[30]],(T=_[1])==null?void 0:T[_[30]])),k[0]&1024&&x(s,"changed-none-col",_[10]),k[0]&2&&d!==(d=_[12]((C=_[1])==null?void 0:C[_[30]])+"")&&se(m,d),k[0]&2083&&x(f,"changed-new-col",!_[5]&&mn((D=_[0])==null?void 0:D[_[30]],(O=_[1])==null?void 0:O[_[30]])),k[0]&32&&x(f,"changed-none-col",_[5]),k[0]&2051&&x(e,"txt-primary",mn((E=_[0])==null?void 0:E[_[30]],(L=_[1])==null?void 0:L[_[30]]))},d(_){_&&v(e)}}}function Vg(n){let e,t=pe(n[6]),i=[];for(let l=0;lProps Old New',s=M(),o=b("tbody");for(let T=0;T!["schema","created","updated"].includes(k));function h(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find(S=>k.id==S.id))))}function _(k){return typeof k>"u"?"":j.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&h(),n.$$.dirty[0]&24&&t(6,c=u.filter(k=>!f.find(S=>k.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(k=>u.find(S=>S.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(S=>S.id==k.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,s,l,g,_]}class iL extends be{constructor(e){super(),_e(this,e,nL,tL,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Gg(n,e,t){const i=n.slice();return i[17]=e[t],i}function Xg(n){let e,t;return e=new iL({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lL(n){let e,t,i=pe(n[2]),l=[];for(let o=0;oI(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await ue.collections.import(o,a),It("Successfully imported collections configuration."),i("submit")}catch(T){ue.error(T)}t(4,u=!1),c()}}const h=()=>m(),_=()=>!u;function k(T){te[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Ee.call(this,n,T)}function $(T){Ee.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,h,_,k,S,$]}class uL extends be{constructor(e){super(),_e(this,e,aL,rL,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Qg(n,e,t){const i=n.slice();return i[32]=e[t],i}function xg(n,e,t){const i=n.slice();return i[35]=e[t],i}function e_(n,e,t){const i=n.slice();return i[32]=e[t],i}function fL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O;a=new he({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[dL,({uniqueId:N})=>({40:N}),({uniqueId:N})=>[0,N?512:0]]},$$scope:{ctx:n}}});let E=!1,L=n[6]&&n[1].length&&!n[7]&&n_(),R=n[6]&&n[1].length&&n[7]&&i_(n),P=n[13].length&&m_(n),F=!!n[0]&&h_(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=Y(`Paste below the collections configuration you want to import or + `),o=b("button"),o.innerHTML='Load from JSON file',r=M(),B(a.$$.fragment),u=M(),f=M(),L&&L.c(),c=M(),R&&R.c(),d=M(),P&&P.c(),m=M(),g=b("div"),F&&F.c(),h=M(),_=b("div"),k=M(),S=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p($,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=T=!n[14],p(g,"class","flex m-t-base")},m(N,q){w(N,e,q),n[19](e),w(N,t,q),w(N,i,q),y(i,l),y(l,s),y(l,o),w(N,r,q),z(a,N,q),w(N,u,q),w(N,f,q),L&&L.m(N,q),w(N,c,q),R&&R.m(N,q),w(N,d,q),P&&P.m(N,q),w(N,m,q),w(N,g,q),F&&F.m(g,null),y(g,h),y(g,_),y(g,k),y(g,S),y(S,$),C=!0,D||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],D=!0)},p(N,q){(!C||q[0]&4096)&&x(o,"btn-loading",N[12]);const W={};q[0]&64&&(W.class="form-field "+(N[6]?"":"field-error")),q[0]&65|q[1]&1536&&(W.$$scope={dirty:q,ctx:N}),a.$set(W),N[6]&&N[1].length&&!N[7]?L||(L=n_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),N[6]&&N[1].length&&N[7]?R?R.p(N,q):(R=i_(N),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),N[13].length?P?P.p(N,q):(P=m_(N),P.c(),P.m(m.parentNode,m)):P&&(P.d(1),P=null),N[0]?F?F.p(N,q):(F=h_(N),F.c(),F.m(g,h)):F&&(F.d(1),F=null),(!C||q[0]&16384&&T!==(T=!N[14]))&&(S.disabled=T)},i(N){C||(A(a.$$.fragment,N),A(E),C=!0)},o(N){I(a.$$.fragment,N),I(E),C=!1},d(N){N&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(g)),n[19](null),V(a,N),L&&L.d(N),R&&R.d(N),P&&P.d(N),F&&F.d(),D=!1,we(O)}}}function cL(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function t_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function dL(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&t_();return{c(){e=b("label"),t=Y("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(s,"id",o=n[40]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ce(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=K(s,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(s,"id",o),m[0]&1&&ce(s,d[0]),d[0]&&!d[6]?c||(c=t_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function n_(n){let e;return{c(){e=b("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function i_(n){let e,t,i,l,s,o=n[9].length&&l_(n),r=n[4].length&&r_(n),a=n[8].length&&c_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),y(i,l),r&&r.m(i,null),y(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=l_(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=r_(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=c_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function l_(n){let e=[],t=new Map,i,l=pe(n[9]);const s=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=M(),l=b("div"),l.innerHTML=`Some of the imported collections share the same name and/or fields but are + imported with different IDs. You can replace them in the import if you want + to.`,s=M(),o=b("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(l,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:Q,d(u){u&&v(e),r=!1,a()}}}function h_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function pL(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[cL,fL],g=[];function h(_,k){return _[5]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[15]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&se(o,_[15]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function mL(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{default:[pL]},$$scope:{ctx:n}}});let r={};return s=new uL({props:r}),n[27](s),s.$on("submit",n[28]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[27](null),V(s,a)}}}function hL(n,e,t){let i,l,s,o,r,a,u;We(n,Et,U=>t(15,u=U)),tn(Et,u="Import collections",u);let f,c,d="",m=!1,g=[],h=[],_=!0,k=[],S=!1;$();async function $(){t(5,S=!0);try{t(2,h=await ue.collections.getFullList(200));for(let U of h)delete U.created,delete U.updated}catch(U){ue.error(U)}t(5,S=!1)}function T(){if(t(4,k=[]),!!i)for(let U of g){const le=j.findByKey(h,"id",U.id);!(le!=null&&le.id)||!j.hasCollectionChanges(le,U,_)||k.push({new:U,old:le})}}function C(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=j.filterDuplicatesByKey(g)):t(1,g=[]);for(let U of g)delete U.created,delete U.updated,U.schema=j.filterDuplicatesByKey(U.schema)}function D(){var U,le;for(let ee of g){const oe=j.findByKey(h,"name",ee.name)||j.findByKey(h,"id",ee.id);if(!oe)continue;const Te=ee.id,je=oe.id;ee.id=je;const Ve=Array.isArray(oe.schema)?oe.schema:[],Qe=Array.isArray(ee.schema)?ee.schema:[];for(const tt of Qe){const Ge=j.findByKey(Ve,"name",tt.name);Ge&&Ge.id&&(tt.id=Ge.id)}for(let tt of g)if(Array.isArray(tt.schema))for(let Ge of tt.schema)(U=Ge.options)!=null&&U.collectionId&&((le=Ge.options)==null?void 0:le.collectionId)===Te&&(Ge.options.collectionId=je)}t(0,d=JSON.stringify(g,null,4))}function O(U){t(12,m=!0);const le=new FileReader;le.onload=async ee=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ee.target.result),await Qt(),g.length||(hi("Invalid collections configuration."),E())},le.onerror=ee=>{console.warn(ee),hi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},le.readAsText(U)}function E(){t(0,d=""),t(10,f.value="",f),Gt({})}function L(U){te[U?"unshift":"push"](()=>{f=U,t(10,f)})}const R=()=>{f.files.length&&O(f.files[0])},P=()=>{f.click()};function F(){d=this.value,t(0,d)}function N(){_=this.checked,t(3,_)}const q=()=>D(),W=()=>E(),G=()=>c==null?void 0:c.show(h,g,_);function J(U){te[U?"unshift":"push"](()=>{c=U,t(11,c)})}const H=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(U=>!!U.id&&!!U.name).length),n.$$.dirty[0]&78&&t(9,l=h.filter(U=>i&&_&&!j.findByKey(g,"id",U.id))),n.$$.dirty[0]&70&&t(8,s=g.filter(U=>i&&!j.findByKey(h,"id",U.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(l.length||s.length||k.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(U=>{let le=j.findByKey(h,"name",U.name)||j.findByKey(h,"id",U.id);if(!le)return!1;if(le.id!=U.id)return!0;const ee=Array.isArray(le.schema)?le.schema:[],oe=Array.isArray(U.schema)?U.schema:[];for(const Te of oe){if(j.findByKey(ee,"id",Te.id))continue;const Ve=j.findByKey(ee,"name",Te.name);if(Ve&&Te.id!=Ve.id)return!0}return!1}))},[d,g,h,_,k,S,i,o,s,l,f,c,m,a,r,u,D,O,E,L,R,P,F,N,q,W,G,J,H]}class gL extends be{constructor(e){super(),_e(this,e,hL,mL,me,{},null,[-1,-1])}}function _L(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ce(s,n[2]),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&ce(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function bL(n){let e,t,i,l,s,o,r;return l=new he({props:{class:"form-field m-0",name:"name",$$slots:{default:[_L,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the + database will be temporary "locked" (this usually happens only during the ZIP generation).

    If you are using S3 storage for the collections file upload, you'll have to backup them + separately since they are not locally stored and will not be included in the final backup!

    `,t=M(),i=b("form"),B(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),z(l,i,null),s=!0,o||(r=K(i,"submit",Ye(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(A(l.$$.fragment,a),s=!0)},o(a){I(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),V(l),o=!1,r()}}}function yL(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function kL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function vL(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[kL],header:[yL],default:[bL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function wL(n,e,t){const i=rt(),l="backup_create_"+j.randomString(5);let s,o="",r=!1,a;function u(S){Gt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await ue.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),It("Successfully generated new backup.")}catch(S){S.isAbort||ue.error(S)}clearTimeout(a),t(3,r=!1)}}Ts(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?($o("A backup has already been started, please wait."),!1):!0,g=()=>(r&&$o("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){te[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,g,h,_,k]}class SL extends be{constructor(e){super(),_e(this,e,wL,vL,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function TL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Backup name"),l=M(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[2]),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&ce(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function $L(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;return u=new rl({props:{value:n[1]}}),m=new he({props:{class:"form-field required m-0",name:"name",$$slots:{default:[TL,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`

    Please proceed with caution. +
    + Backup restore is still experimental and currently works only on UNIX based systems.

    The restore operation will attempt to replace your existing pb_data with the one from + the backup and will restart the application process.

    Nothing will happen if the backup file is invalid or incompatible.

    `,t=M(),i=b("div"),l=Y(`Type the backup name + `),s=b("div"),o=b("span"),r=Y(n[1]),a=M(),B(u.$$.fragment),f=Y(` + to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){w(k,e,S),w(k,t,S),w(k,i,S),y(i,l),y(i,s),y(s,o),y(o,r),y(s,a),z(u,s,null),y(i,f),w(k,c,S),w(k,d,S),z(m,d,null),g=!0,h||(_=K(d,"submit",Ye(n[7])),h=!0)},p(k,S){(!g||S&2)&&se(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){g||(A(u.$$.fragment,k),A(m.$$.fragment,k),g=!0)},o(k){I(u.$$.fragment,k),I(m.$$.fragment,k),g=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),V(u),V(m),h=!1,_()}}}function CL(n){let e,t,i,l;return{c(){e=b("h4"),t=Y("Restore "),i=b("strong"),l=Y(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),y(e,t),y(e,i),y(i,l)},p(s,o){o&2&&se(l,s[1])},d(s){s&&v(e)}}}function ML(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function OL(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[ML],header:[CL],default:[$L]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function DL(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Gt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await ue.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),hi(((S=$.response)==null?void 0:S.message)||$.message))}}}Ts(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const g=()=>!a;function h(S){te[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,g,h,_,k]}class EL extends be{constructor(e){super(),_e(this,e,DL,OL,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function g_(n,e,t){const i=n.slice();return i[22]=e[t],i}function __(n,e,t){const i=n.slice();return i[19]=e[t],i}function AL(n){let e=[],t=new Map,i,l,s=pe(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function y_(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=j.formattedFileSize(e[22].size)+"",g,h,_,k,S,$,T,C,D,O,E,L,R,P,F,N,q,W,G,J;function H(){return e[10](e[22])}function U(){return e[11](e[22])}function le(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=Y(r),f=M(),c=b("span"),d=Y("("),g=Y(m),h=Y(")"),_=M(),k=b("div"),S=b("button"),$=b("i"),C=M(),D=b("button"),O=b("i"),L=M(),R=b("button"),P=b("i"),N=M(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p($,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(O,"class","ri-restart-line"),p(D,"type","button"),p(D,"class","btn btn-sm btn-circle btn-hint btn-transparent"),D.disabled=E=e[6][e[22].key],p(D,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=F=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(k,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,oe){w(ee,t,oe),y(t,i),y(t,l),y(t,s),y(s,o),y(o,a),y(s,f),y(s,c),y(c,d),y(c,g),y(c,h),y(t,_),y(t,k),y(k,S),y(S,$),y(k,C),y(k,D),y(D,O),y(k,L),y(k,R),y(R,P),y(t,N),W=!0,G||(J=[ve(Fe.call(null,S,"Download")),K(S,"click",Ye(H)),ve(Fe.call(null,D,"Restore")),K(D,"click",Ye(U)),ve(Fe.call(null,R,"Delete")),K(R,"click",Ye(le))],G=!0)},p(ee,oe){e=ee,(!W||oe&8)&&r!==(r=e[22].key+"")&&se(a,r),(!W||oe&8&&u!==(u=e[22].key))&&p(o,"title",u),(!W||oe&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&se(g,m),(!W||oe&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!W||oe&40)&&x(S,"btn-loading",e[5][e[22].key]),(!W||oe&72&&E!==(E=e[6][e[22].key]))&&(D.disabled=E),(!W||oe&72&&F!==(F=e[6][e[22].key]))&&(R.disabled=F),(!W||oe&72)&&x(R,"btn-loading",e[6][e[22].key])},i(ee){W||(ee&&Ke(()=>{W&&(q||(q=Le(t,et,{duration:150},!0)),q.run(1))}),W=!0)},o(ee){ee&&(q||(q=Le(t,et,{duration:150},!1)),q.run(0)),W=!1},d(ee){ee&&v(t),ee&&q&&q.end(),G=!1,we(J)}}}function k_(n){let e;return{c(){e=b("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LL(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function PL(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function FL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h;const _=[IL,AL],k=[];function S(E,L){return E[4]?0:1}i=S(n),l=k[i]=_[i](n);function $(E,L){return E[7]?PL:LL}let T=$(n),C=T(n),D={};f=new SL({props:D}),n[14](f),f.$on("submit",n[15]);let O={};return d=new EL({props:O}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),u=M(),B(f.$$.fragment),c=M(),B(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(E,L){w(E,e,L),y(e,t),k[i].m(t,null),y(e,s),y(e,o),y(o,r),C.m(r,null),w(E,u,L),z(f,E,L),w(E,c,L),z(d,E,L),m=!0,g||(h=K(r,"click",n[13]),g=!0)},p(E,[L]){let R=i;i=S(E),i===R?k[i].p(E,L):(re(),I(k[R],1,1,()=>{k[R]=null}),ae(),l=k[i],l?l.p(E,L):(l=k[i]=_[i](E),l.c()),A(l,1),l.m(t,null)),T!==(T=$(E))&&(C.d(1),C=T(E),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=E[4]||!E[7]))&&(r.disabled=a);const P={};f.$set(P);const F={};d.$set(F)},i(E){m||(A(l),A(f.$$.fragment,E),A(d.$$.fragment,E),m=!0)},o(E){I(l),I(f.$$.fragment,E),I(d.$$.fragment,E),m=!1},d(E){E&&(v(e),v(u),v(c)),k[i].d(),C.d(),n[14](null),V(f,E),n[16](null),V(d,E),g=!1,h()}}}function NL(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,s=await ue.backups.getFullList()),s.sort((D,O)=>D.modifiedO.modified?-1:0),t(4,o=!1)}catch(D){D.isAbort||(ue.error(D),t(4,o=!1))}}async function c(D){if(!r[D]){t(5,r[D]=!0,r);try{const O=await ue.getAdminFileToken(),E=ue.backups.getDownloadUrl(O,D);j.download(E)}catch(O){O.isAbort||ue.error(O)}delete r[D],t(5,r)}}function d(D){an(`Do you really want to delete ${D}?`,()=>m(D))}async function m(D){if(!a[D]){t(6,a[D]=!0,a);try{await ue.backups.delete(D),j.removeByKey(s,"name",D),f(),It(`Successfully deleted ${D}.`)}catch(O){O.isAbort||ue.error(O)}delete a[D],t(6,a)}}async function g(){var D;try{const O=await ue.health.check({$autoCancel:!1}),E=u;t(7,u=((D=O==null?void 0:O.data)==null?void 0:D.canBackup)||!1),E!=u&&u&&f()}catch{}}Vt(()=>{let D=setInterval(()=>{g()},3e3);return()=>{clearInterval(D)}});const h=D=>c(D.key),_=D=>l.show(D.key),k=D=>d(D.key),S=()=>i==null?void 0:i.show();function $(D){te[D?"unshift":"push"](()=>{i=D,t(1,i)})}const T=()=>{f()};function C(D){te[D?"unshift":"push"](()=>{l=D,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,h,_,k,S,$,T,C]}class RL extends be{constructor(e){super(),_e(this,e,NL,FL,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function qL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){w(a,e,u),y(e,t),w(a,l,u),w(a,s,u),n[5](s),o||(r=[ve(Fe.call(null,e,"Upload backup")),K(e,"click",n[4]),K(s,"change",n[3])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,we(r)}}}const v_="upload_backup";function jL(n,e,t){const i=rt();let{class:l=""}=e,s,o=!1;async function r(f){var d,m,g,h,_;if(o||!((m=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await ue.backups.upload(c,{requestKey:v_}),t(2,o=!1),i("success"),It("Successfully uploaded a new backup.")}catch(k){k.isAbort||(t(2,o=!1),(_=(h=(g=k.response)==null?void 0:g.data)==null?void 0:h.file)!=null&&_.message?hi(k.response.data.file.message):ue.error(k))}}Ts(()=>{ue.cancelRequest(v_)});const a=()=>s==null?void 0:s.click();function u(f){te[f?"unshift":"push"](()=>{s=f,t(1,s)})}return n.$$set=f=>{"class"in f&&t(0,l=f.class)},[l,s,o,r,a,u]}class HL extends be{constructor(e){super(),_e(this,e,jL,qL,me,{class:0})}}function zL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function VL(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function w_(n){var W,G,J;let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O;t=new he({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[BL,({uniqueId:H})=>({31:H}),({uniqueId:H})=>[0,H?1:0]]},$$scope:{ctx:n}}});let E=n[2]&&S_(n);function L(H){n[24](H)}function R(H){n[25](H)}function P(H){n[26](H)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(W=n[0].backups)==null?void 0:W.s3};n[1].backups.s3!==void 0&&(F.config=n[1].backups.s3),n[7]!==void 0&&(F.isTesting=n[7]),n[8]!==void 0&&(F.testError=n[8]),r=new t0({props:F}),te.push(()=>ge(r,"config",L)),te.push(()=>ge(r,"isTesting",R)),te.push(()=>ge(r,"testError",P));let N=((J=(G=n[1].backups)==null?void 0:G.s3)==null?void 0:J.enabled)&&!n[9]&&!n[5]&&T_(n),q=n[9]&&$_(n);return{c(){e=b("form"),B(t.$$.fragment),i=M(),E&&E.c(),l=M(),s=b("div"),o=M(),B(r.$$.fragment),c=M(),d=b("div"),m=b("div"),g=M(),N&&N.c(),h=M(),q&&q.c(),_=M(),k=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(k,"type","submit"),p(k,"class","btn btn-expanded"),k.disabled=$=!n[9]||n[5],x(k,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(H,U){w(H,e,U),z(t,e,null),y(e,i),E&&E.m(e,null),y(e,l),y(e,s),y(e,o),z(r,e,null),y(e,c),y(e,d),y(d,m),y(d,g),N&&N.m(d,null),y(d,h),q&&q.m(d,null),y(d,_),y(d,k),y(k,S),C=!0,D||(O=[K(k,"click",n[28]),K(e,"submit",Ye(n[11]))],D=!0)},p(H,U){var oe,Te,je;const le={};U[0]&4|U[1]&3&&(le.$$scope={dirty:U,ctx:H}),t.$set(le),H[2]?E?(E.p(H,U),U[0]&4&&A(E,1)):(E=S_(H),E.c(),A(E,1),E.m(e,l)):E&&(re(),I(E,1,1,()=>{E=null}),ae());const ee={};U[0]&1&&(ee.originalConfig=(oe=H[0].backups)==null?void 0:oe.s3),!a&&U[0]&2&&(a=!0,ee.config=H[1].backups.s3,ye(()=>a=!1)),!u&&U[0]&128&&(u=!0,ee.isTesting=H[7],ye(()=>u=!1)),!f&&U[0]&256&&(f=!0,ee.testError=H[8],ye(()=>f=!1)),r.$set(ee),(je=(Te=H[1].backups)==null?void 0:Te.s3)!=null&&je.enabled&&!H[9]&&!H[5]?N?N.p(H,U):(N=T_(H),N.c(),N.m(d,h)):N&&(N.d(1),N=null),H[9]?q?q.p(H,U):(q=$_(H),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!C||U[0]&544&&$!==($=!H[9]||H[5]))&&(k.disabled=$),(!C||U[0]&32)&&x(k,"btn-loading",H[5])},i(H){C||(A(t.$$.fragment,H),A(E),A(r.$$.fragment,H),H&&Ke(()=>{C&&(T||(T=Le(e,et,{duration:150},!0)),T.run(1))}),C=!0)},o(H){I(t.$$.fragment,H),I(E),I(r.$$.fragment,H),H&&(T||(T=Le(e,et,{duration:150},!1)),T.run(0)),C=!1},d(H){H&&v(e),V(t),E&&E.d(),V(r),N&&N.d(),q&&q.d(),H&&T&&T.end(),D=!1,we(O)}}}function BL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function S_(n){let e,t,i,l,s,o,r,a,u;return l=new he({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[WL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new he({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[YL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(l.$$.fragment,f),A(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Le(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(l.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=Le(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),V(l),V(r),f&&a&&a.end()}}}function UL(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='Every day at 00:00h',t=M(),i=b("button"),i.innerHTML='Every sunday at 00:00h',l=M(),s=b("button"),s.innerHTML='Every Mon and Wed at 00:00h',o=M(),r=b("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[19]),K(i,"click",n[20]),K(s,"click",n[21]),K(r,"click",n[22])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function WL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R;return h=new En({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[UL]},$$scope:{ctx:n}}}),{c(){var P,F;e=b("label"),t=Y("Cron expression"),l=M(),s=b("input"),a=M(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),g=M(),B(h.$$.fragment),_=M(),k=b("div"),S=b("p"),$=Y(`Supports numeric list, steps, ranges or + `),T=b("span"),T.textContent="macros",C=Y(`. + `),D=b("br"),O=Y(` + The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((F=(P=n[0])==null?void 0:P.backups)!=null&&F.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(P,F){var N,q;w(P,e,F),y(e,t),w(P,l,F),w(P,s,F),ce(s,n[1].backups.cron),w(P,a,F),w(P,u,F),y(u,f),y(f,c),y(f,d),y(f,m),y(f,g),z(h,f,null),w(P,_,F),w(P,k,F),y(k,S),y(S,$),y(S,T),y(S,C),y(S,D),y(S,O),E=!0,(q=(N=n[0])==null?void 0:N.backups)!=null&&q.cron||s.focus(),L||(R=[K(s,"input",n[18]),ve(Fe.call(null,T,`@yearly +@annually +@monthly +@weekly +@daily +@midnight +@hourly`))],L=!0)},p(P,F){var q,W;(!E||F[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!E||F[1]&1&&o!==(o=P[31]))&&p(s,"id",o),(!E||F[0]&1&&r!==(r=!((W=(q=P[0])==null?void 0:q.backups)!=null&&W.cron)))&&(s.autofocus=r),F[0]&2&&s.value!==P[1].backups.cron&&ce(s,P[1].backups.cron);const N={};F[0]&2|F[1]&2&&(N.$$scope={dirty:F,ctx:P}),h.$set(N)},i(P){E||(A(h.$$.fragment,P),E=!0)},o(P){I(h.$$.fragment,P),E=!1},d(P){P&&(v(e),v(l),v(s),v(a),v(u),v(_),v(k)),V(h),L=!1,we(R)}}}function YL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ce(s,n[1].backups.cronMaxKeep),r||(a=K(s,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(s,"id",o),f[0]&2&&ut(s.value)!==u[1].backups.cronMaxKeep&&ce(s,u[1].backups.cronMaxKeep)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function T_(n){let e;function t(s,o){return s[7]?ZL:s[8]?JL:KL}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function KL(n){let e;return{c(){e=b("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JL(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=ve(t=Fe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function ZL(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $_(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),y(e,t),l||(s=K(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function GL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;m=new Qo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),h=new HL({props:{class:"btn-sm"}}),h.$on("success",n[13]);let F={};k=new RL({props:F}),n[15](k);function N(J,H){return J[6]?VL:zL}let q=N(n),W=q(n),G=n[6]&&!n[4]&&w_(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[10]),r=M(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),g=M(),B(h.$$.fragment),_=M(),B(k.$$.fragment),S=M(),$=b("hr"),T=M(),C=b("button"),D=b("span"),D.textContent="Backups options",O=M(),W.c(),E=M(),G&&G.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(D,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,H){w(J,e,H),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(J,r,H),w(J,a,H),y(a,u),y(u,f),y(f,c),y(f,d),z(m,f,null),y(f,g),z(h,f,null),y(u,_),z(k,u,null),y(u,S),y(u,$),y(u,T),y(u,C),y(C,D),y(C,O),W.m(C,null),y(u,E),G&&G.m(u,null),L=!0,R||(P=[K(C,"click",n[16]),K(u,"submit",Ye(n[11]))],R=!0)},p(J,H){(!L||H[0]&1024)&&se(o,J[10]);const U={};k.$set(U),q!==(q=N(J))&&(W.d(1),W=q(J),W&&(W.c(),W.m(C,null))),(!L||H[0]&16)&&(C.disabled=J[4]),(!L||H[0]&16)&&x(C,"btn-loading",J[4]),J[6]&&!J[4]?G?(G.p(J,H),H[0]&80&&A(G,1)):(G=w_(J),G.c(),A(G,1),G.m(u,null)):G&&(re(),I(G,1,1,()=>{G=null}),ae())},i(J){L||(A(m.$$.fragment,J),A(h.$$.fragment,J),A(k.$$.fragment,J),A(G),L=!0)},o(J){I(m.$$.fragment,J),I(h.$$.fragment,J),I(k.$$.fragment,J),I(G),L=!1},d(J){J&&(v(e),v(r),v(a)),V(m),V(h),n[15](null),V(k),W.d(),G&&G.d(),R=!1,we(P)}}}function XL(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[GL]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function QL(n,e,t){let i,l;We(n,Et,H=>t(10,l=H)),tn(Et,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,g=null;h();async function h(){t(4,a=!0);try{const H=await ue.settings.getAll()||{};k(H)}catch(H){ue.error(H)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const H=await ue.settings.update(j.filterRedactedProps(r));await $(),k(H),It("Successfully saved application settings.")}catch(H){ue.error(H)}t(5,u=!1)}}function k(H={}){t(1,r={backups:(H==null?void 0:H.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function $(){return s==null?void 0:s.loadBackups()}function T(H){te[H?"unshift":"push"](()=>{s=H,t(3,s)})}const C=()=>t(6,d=!d);function D(){c=this.checked,t(2,c)}function O(){r.backups.cron=this.value,t(1,r),t(2,c)}const E=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},P=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function F(){r.backups.cronMaxKeep=ut(this.value),t(1,r),t(2,c)}function N(H){n.$$.not_equal(r.backups.s3,H)&&(r.backups.s3=H,t(1,r),t(2,c))}function q(H){m=H,t(7,m)}function W(H){g=H,t(8,g)}const G=()=>S(),J=()=>_();return n.$$.update=()=>{var H;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(H=r==null?void 0:r.backups)!=null&&H.cron&&(ii("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,g,i,l,_,S,$,f,T,C,D,O,E,L,R,P,F,N,q,W,G,J]}class xL extends be{constructor(e){super(),_e(this,e,QL,XL,me,{},null,[-1,-1])}}const Ht=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?il("/"):!0}],eP={"/login":Nt({component:nA,conditions:Ht.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Nt({asyncComponent:()=>st(()=>import("./PageAdminRequestPasswordReset-b72b7a4a.js"),[],import.meta.url),conditions:Ht.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageAdminConfirmPasswordReset-84f4610d.js"),[],import.meta.url),conditions:Ht.concat([n=>!ue.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Nt({component:T8,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Nt({component:AT,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Nt({component:cA,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Nt({component:G8,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Nt({component:QA,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Nt({component:yI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Nt({component:NI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Nt({component:WI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Nt({component:XI,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Nt({component:gL,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Nt({component:xL,conditions:Ht.concat([n=>ue.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmPasswordReset-0229c5a8.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmPasswordReset-0229c5a8.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmVerification-6165faf3.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmVerification-6165faf3.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmEmailChange-02c3e953.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Nt({asyncComponent:()=>st(()=>import("./PageRecordConfirmEmailChange-02c3e953.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":Nt({asyncComponent:()=>st(()=>import("./PageOAuth2Redirect-999aaede.js"),[],import.meta.url),conditions:Ht,userData:{showAppSidebar:!1}}),"*":Nt({component:Pv,userData:{showAppSidebar:!1}})};function tP(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Xo}=i;return{delay:f,duration:$t(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,g)=>{const h=g*a,_=g*u,k=m+g*e.width/t.width,S=m+g*e.height/t.height;return`transform: ${s} translate(${h}px, ${_}px) scale(${k}, ${S});`}}}function C_(n,e,t){const i=n.slice();return i[2]=e[t],i}function nP(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function iP(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function lP(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sP(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function M_(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,g=Q,h,_,k;function S(D,O){return D[2].type==="info"?sP:D[2].type==="success"?lP:D[2].type==="warning"?iP:nP}let $=S(e),T=$(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),T.c(),l=M(),s=b("div"),r=Y(o),a=M(),u=b("button"),u.innerHTML='',f=M(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(D,O){w(D,t,O),y(t,i),T.m(i,null),y(t,l),y(t,s),y(s,r),y(t,a),y(t,u),y(t,f),h=!0,_||(k=K(u,"click",Ye(C)),_=!0)},p(D,O){e=D,$!==($=S(e))&&(T.d(1),T=$(e),T&&(T.c(),T.m(i,null))),(!h||O&1)&&o!==(o=e[2].message+"")&&se(r,o),(!h||O&1)&&x(t,"alert-info",e[2].type=="info"),(!h||O&1)&&x(t,"alert-success",e[2].type=="success"),(!h||O&1)&&x(t,"alert-danger",e[2].type=="error"),(!h||O&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){O0(t),g(),N_(t,m)},a(){g(),g=M0(t,m,tP,{duration:150})},i(D){h||(D&&Ke(()=>{h&&(d&&d.end(1),c=j_(t,et,{duration:150}),c.start())}),h=!0)},o(D){c&&c.invalidate(),D&&(d=ya(t,ds,{duration:150})),h=!1},d(D){D&&v(t),T.d(),D&&d&&d.end(),_=!1,k()}}}function oP(n){let e,t=[],i=new Map,l,s=pe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=s)),[i,s=>K1(s)]}class aP extends be{constructor(e){super(),_e(this,e,rP,oP,me,{})}}function uP(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=Y(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),y(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&se(i,t)},d(s){s&&v(e)}}}function fP(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),e.focus(),o||(r=[K(e,"click",n[4]),K(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,we(r)}}}function cP(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[fP],header:[uP]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[6](null),V(e,l)}}}function dP(n,e,t){let i;We(n,Ga,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){te[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Yb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class pP extends be{constructor(e){super(),_e(this,e,dP,cP,me,{})}}function O_(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S;return h=new En({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[mP]},$$scope:{ctx:n}}}),{c(){var $;e=b("aside"),t=b("a"),t.innerHTML='PocketBase logo',i=M(),l=b("nav"),s=b("a"),s.innerHTML='',o=M(),r=b("a"),r.innerHTML='',a=M(),u=b("a"),u.innerHTML='',f=M(),c=b("figure"),d=b("img"),g=M(),B(h.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),nn(d.src,m="./images/avatars/avatar"+((($=n[0])==null?void 0:$.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m($,T){w($,e,T),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),y(l,r),y(l,a),y(l,u),y(e,f),y(e,c),y(c,d),y(c,g),z(h,c,null),_=!0,k||(S=[ve(ln.call(null,t)),ve(ln.call(null,s)),ve(Pn.call(null,s,{path:"/collections/?.*",className:"current-route"})),ve(Fe.call(null,s,{text:"Collections",position:"right"})),ve(ln.call(null,r)),ve(Pn.call(null,r,{path:"/logs/?.*",className:"current-route"})),ve(Fe.call(null,r,{text:"Logs",position:"right"})),ve(ln.call(null,u)),ve(Pn.call(null,u,{path:"/settings/?.*",className:"current-route"})),ve(Fe.call(null,u,{text:"Settings",position:"right"}))],k=!0)},p($,T){var D;(!_||T&1&&!nn(d.src,m="./images/avatars/avatar"+(((D=$[0])==null?void 0:D.avatar)||0)+".svg"))&&p(d,"src",m);const C={};T&4096&&(C.$$scope={dirty:T,ctx:$}),h.$set(C)},i($){_||(A(h.$$.fragment,$),_=!0)},o($){I(h.$$.fragment,$),_=!1},d($){$&&v(e),V(h),k=!1,we(S)}}}function mP(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML=' Manage admins',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),o||(r=[ve(ln.call(null,e)),K(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,we(r)}}}function D_(n){let e,t,i;return t=new eu({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p:Q,i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function hP(n){var _;let e,t,i,l,s,o,r,a,u,f,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((_=n[0])==null?void 0:_.id)&&n[1]&&O_(n);o=new V0({props:{routes:eP}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new aP({}),f=new pP({});let h=n[1]&&!n[2]&&D_(n);return{c(){t=M(),i=b("div"),g&&g.c(),l=M(),s=b("div"),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),B(f.$$.fragment),c=M(),h&&h.c(),d=ke(),p(s,"class","app-body"),p(i,"class","app-layout")},m(k,S){w(k,t,S),w(k,i,S),g&&g.m(i,null),y(i,l),y(i,s),z(o,s,null),y(s,r),z(a,s,null),w(k,u,S),z(f,k,S),w(k,c,S),h&&h.m(k,S),w(k,d,S),m=!0},p(k,[S]){var $;(!m||S&24)&&e!==(e=j.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),($=k[0])!=null&&$.id&&k[1]?g?(g.p(k,S),S&3&&A(g,1)):(g=O_(k),g.c(),A(g,1),g.m(i,l)):g&&(re(),I(g,1,1,()=>{g=null}),ae()),k[1]&&!k[2]?h?(h.p(k,S),S&6&&A(h,1)):(h=D_(k),h.c(),A(h,1),h.m(d.parentNode,d)):h&&(re(),I(h,1,1,()=>{h=null}),ae())},i(k){m||(A(g),A(o.$$.fragment,k),A(a.$$.fragment,k),A(f.$$.fragment,k),A(h),m=!0)},o(k){I(g),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(h),m=!1},d(k){k&&(v(t),v(i),v(u),v(c),v(d)),g&&g.d(),V(o),V(a),V(f,k),h&&h.d(k)}}}function gP(n,e,t){let i,l,s,o;We(n,Ml,h=>t(10,i=h)),We(n,Oo,h=>t(3,l=h)),We(n,Ia,h=>t(0,s=h)),We(n,Et,h=>t(4,o=h));let r,a=!1,u=!1;function f(h){var _,k,S,$;((_=h==null?void 0:h.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(k=h==null?void 0:h.detail)==null?void 0:k.userData)!=null&&S.showAppSidebar)),r=($=h==null?void 0:h.detail)==null?void 0:$.location,tn(Et,o="",o),Gt({}),Yb())}function c(){il("/")}async function d(){var h,_;if(s!=null&&s.id)try{const k=await ue.settings.getAll({$cancelKey:"initialAppSettings"});tn(Oo,l=((h=k==null?void 0:k.meta)==null?void 0:h.appName)||"",l),tn(Ml,i=!!((_=k==null?void 0:k.meta)!=null&&_.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){ue.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,g]}class _P extends be{constructor(e){super(),_e(this,e,gP,hP,me,{})}}new _P({target:document.getElementById("app")});export{we as A,It as B,j as C,il as D,ke as E,Z1 as F,Wo as G,uo as H,Vt as I,We as J,zn as K,rt as L,te as M,Vb as N,pe as O,dt as P,Pi as Q,Lt as R,be as S,at as T,S0 as U,I as a,M as b,B as c,V as d,b as e,p as f,w as g,y as h,_e as i,ve as j,re as k,ln as l,z as m,ae as n,v as o,ue as p,he as q,x as r,me as s,A as t,K as u,Ye as v,Y as w,se as x,Q as y,ce as z}; diff --git a/ui/dist/assets/index-7d33ef4c.js b/ui/dist/assets/index-7d33ef4c.js deleted file mode 100644 index 9ed930e2..00000000 --- a/ui/dist/assets/index-7d33ef4c.js +++ /dev/null @@ -1,160 +0,0 @@ -var l0=Object.defineProperty;var o0=(n,e,t)=>e in n?l0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var sr=(n,e,t)=>(o0(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const Sl=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function r0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function b_(n){return n()}function du(){return Object.create(null)}function $e(n){n.forEach(b_)}function Et(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Rl;function fn(n,e){return n===e?!0:(Rl||(Rl=document.createElement("a")),Rl.href=e,n===Rl.href)}function a0(n){return Object.keys(n).length===0}function ga(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function u0(n){let e;return ga(n,t=>e=t)(),e}function Ge(n,e,t){n.$$.on_destroy.push(ga(e,t))}function Tt(n,e,t,i){if(n){const s=v_(n,e,t,i);return n[0](s)}}function v_(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function Ct(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),_a=y_?n=>requestAnimationFrame(n):x;const ks=new Set;function k_(n){ks.forEach(e=>{e.c(n)||(ks.delete(e),e.f())}),ks.size!==0&&_a(k_)}function jo(n){let e;return ks.size===0&&_a(k_),{promise:new Promise(t=>{ks.add(e={c:n,f:t})}),abort(){ks.delete(e)}}}function b(n,e){n.appendChild(e)}function w_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function f0(n){const e=v("style");return e.textContent="/* empty */",c0(w_(n),e),e.sheet}function c0(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function vt(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function Ze(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Sn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const d0=["width","height"];function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&d0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function p0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function yt(n){return n===""?null:+n}function h0(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.data!==e&&(n.data=e)}function de(n,e){n.value=e??""}function zr(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList.toggle(e,!!t)}function S_(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function Nt(n,e){return new n(e)}const go=new Map;let _o=0;function m0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function g0(n,e){const t={stylesheet:f0(e),rules:{}};return go.set(n,t),t}function cl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{ -`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}} -`}const f=u+`100% {${o(t,1-t)}} -}`,c=`__svelte_${m0(f)}_${r}`,d=w_(n),{stylesheet:h,rules:m}=go.get(d)||g0(d,n);m[c]||(m[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,_o+=1,c}function dl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),_o-=s,_o||_0())}function _0(){_a(()=>{_o||(go.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),go.clear())})}function b0(n,e,t,i){if(!e)return x;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return x;const{delay:l=0,duration:o=300,easing:r=Sl,start:a=qo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,m;function g(){c&&(m=cl(n,0,1,o,l,r,c)),l||(h=!0)}function _(){c&&dl(n,m),d=!1}return jo(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),g(),f(0,1),_}function v0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,T_(n,s)}}function T_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let pl;function wi(n){pl=n}function Tl(){if(!pl)throw new Error("Function called outside component initialization");return pl}function Kt(n){Tl().$$.on_mount.push(n)}function y0(n){Tl().$$.after_update.push(n)}function Cl(n){Tl().$$.on_destroy.push(n)}function pt(){const n=Tl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=S_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Re(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ys=[],te=[];let ws=[];const Br=[],C_=Promise.resolve();let Ur=!1;function $_(){Ur||(Ur=!0,C_.then(ba))}function ln(){return $_(),C_}function xe(n){ws.push(n)}function ve(n){Br.push(n)}const lr=new Set;let hs=0;function ba(){if(hs!==0)return;const n=pl;do{try{for(;hsn.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ws=e}let Vs;function va(){return Vs||(Vs=Promise.resolve(),Vs.then(()=>{Vs=null})),Vs}function ss(n,e,t){n.dispatchEvent(S_(`${e?"intro":"outro"}${t}`))}const oo=new Set;let ui;function re(){ui={r:0,c:[],p:ui}}function ae(){ui.r||$e(ui.c),ui=ui.p}function A(n,e){n&&n.i&&(oo.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(oo.has(n))return;oo.add(n),ui.c.push(()=>{oo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ya={duration:0};function M_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&dl(n,o)}function f(){const{delay:d=0,duration:h=300,easing:m=Sl,tick:g=x,css:_}=s||ya;_&&(o=cl(n,0,1,h,d,m,_,a++)),g(0,1);const y=qo()+d,S=y+h;r&&r.abort(),l=!0,xe(()=>ss(n,!0,"start")),r=jo(C=>{if(l){if(C>=S)return g(1,0),ss(n,!0,"end"),u(),l=!1;if(C>=y){const T=m((C-y)/h);g(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,dl(n),Et(s)?(s=s(i),va().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function ka(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=ui;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=Sl,tick:h=x,css:m}=s||ya;m&&(o=cl(n,1,0,c,f,d,m));const g=qo()+f,_=g+c;xe(()=>ss(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),jo(y=>{if(l){if(y>=_)return h(0,1),ss(n,!1,"end"),--r.r||$e(r.c),!1;if(y>=g){const S=d((y-g)/c);h(1-S,S)}}return l})}return Et(s)?va().then(()=>{s=s(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&s.tick&&s.tick(1,0),l&&(o&&dl(n,o),l=!1)}}}function He(n,e,t,i){let l=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&dl(n,u)}function d(m,g){const _=m.b-o;return g*=Math.abs(_),{a:o,b:m.b,d:_,duration:g,start:m.start,end:m.start+g,group:m.group}}function h(m){const{delay:g=0,duration:_=300,easing:y=Sl,tick:S=x,css:C}=l||ya,T={start:qo()+g,b:m};m||(T.group=ui,ui.r+=1),"inert"in n&&(m?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=T:(C&&(c(),u=cl(n,o,m,_,g,y,C)),m&&S(0,1),r=d(T,_),xe(()=>ss(n,m,"start")),jo($=>{if(a&&$>a.start&&(r=d(a,_),a=null,ss(n,r.b,"start"),C&&(c(),u=cl(n,o,r.b,r.duration,0,y,l.css))),r){if($>=r.end)S(o=r.b,1-o),ss(n,r.b,"end"),a||(r.b?c():--r.group.r||$e(r.group.c)),r=null;else if($>=r.start){const M=$-r.start;o=r.a+r.d*y(M/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(m){Et(l)?va().then(()=>{l=l({direction:m?"in":"out"}),h(m)}):h(m)},end(){c(),r=a=null}}}function hu(n,e){const t=e.token={};function i(s,l,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=s&&(e.current=s)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==l&&c&&(re(),L(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ae())}):e.block.d(1),u.c(),A(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[l]=u),f&&ba()}if(r0(n)){const s=Tl();if(n.then(l=>{wi(s),i(e.then,1,e.value,l),wi(null)},l=>{if(wi(s),i(e.catch,2,e.error,l),wi(null),!e.hasCatch)throw l}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function S0(n,e,t){const i=e.slice(),{resolved:s}=n;n.current===n.then&&(i[n.value]=s),n.current===n.catch&&(i[n.error]=s),n.block.p(i,t)}function pe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Ui(n,e){n.d(1),e.delete(n.key)}function qt(n,e){L(n,1,1,()=>{e.delete(n.key)})}function T0(n,e){n.f(),qt(n,e)}function gt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,m=d;const g={};for(;m--;)g[n[m].key]=m;const _=[],y=new Map,S=new Map,C=[];for(m=h;m--;){const O=c(s,l,m),D=t(O);let I=o.get(D);I?i&&C.push(()=>I.p(O,e)):(I=u(D,O),I.c()),y.set(D,_[m]=I),D in g&&S.set(D,Math.abs(m-g[D]))}const T=new Set,$=new Set;function M(O){A(O,1),O.m(r,f),o.set(O.key,O),f=O.first,h--}for(;d&&h;){const O=_[h-1],D=n[d-1],I=O.key,N=D.key;O===D?(f=O.first,d--,h--):y.has(N)?!o.has(I)||T.has(I)?M(O):$.has(N)?d--:S.get(I)>S.get(N)?($.add(I),M(O)):(T.add(N),d--):(a(D,o),d--)}for(;d--;){const O=n[d];y.has(O.key)||a(O,o)}for(;h;)M(_[h-1]);return $e(C),_}function _t(n,e){const t={},i={},s={$$scope:1};let l=n.length;for(;l--;){const o=n[l],r=e[l];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)s[a]||(t[a]=r[a],s[a]=1);n[l]=r}else for(const a in o)s[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Dt(n){return typeof n=="object"&&n!==null?n:{}}function he(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function H(n,e,t){const{fragment:i,after_update:s}=n.$$;i&&i.m(e,t),xe(()=>{const l=n.$$.on_mount.map(b_).filter(Et);n.$$.on_destroy?n.$$.on_destroy.push(...l):$e(l),n.$$.on_mount=[]}),s.forEach(xe)}function V(n,e){const t=n.$$;t.fragment!==null&&(w0(t.after_update),$e(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function C0(n,e){n.$$.dirty[0]===-1&&(ys.push(n),$_(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const m=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=m)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](m),f&&C0(n,c)),d}):[],u.update(),f=!0,$e(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=h0(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),H(n,e.target,e.anchor),ba()}wi(a)}class be{constructor(){sr(this,"$$");sr(this,"$$set")}$destroy(){V(this,1),this.$destroy=x}$on(e,t){if(!Et(t))return x;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}$set(e){this.$$set&&!a0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const $0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add($0);function jt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function E_(n,e,t){const i=!Array.isArray(n),s=i?[n]:n;if(!s.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return O_(t,(o,r)=>{let a=!1;const u=[];let f=0,c=x;const d=()=>{if(f)return;c();const m=e(i?u[0]:u,o,r);l?o(m):c=Et(m)?m:x},h=s.map((m,g)=>ga(m,_=>{u[g]=_,f&=~(1<{f|=1<{V(u,1)}),ae()}l?(e=Nt(l,o(r,a)),e.$on("routeEvent",r[7]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&4?_t(s,[Dt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function O0(n){let e,t,i;const s=[{params:n[1]},n[2]];var l=n[0];function o(r,a){let u={};if(a!==void 0&&a&6)u=_t(s,[a&2&&{params:r[1]},a&4&&Dt(r[2])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Nt(l,o(r,a)),e.$on("routeEvent",r[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a&6?_t(s,[a&2&&{params:r[1]},a&4&&Dt(r[2])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function E0(n){let e,t,i,s;const l=[O0,M0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function mu(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ho=O_(null,function(e){e(mu());const t=()=>{e(mu())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});E_(Ho,n=>n.location);const wa=E_(Ho,n=>n.querystring),gu=Ln(void 0);async function us(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ln();const e=(n.charAt(0)=="#"?"":"#")+n;try{const t={...history.state};delete t.__svelte_spa_router_scrollX,delete t.__svelte_spa_router_scrollY,window.history.replaceState(t,void 0,e)}catch{console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))}function dn(n,e){if(e=bu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with tags');return _u(n,e),{update(t){t=bu(t),_u(n,t)}}}function D0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function _u(n,e){let t=e.href||n.getAttribute("href");if(t&&t.charAt(0)=="/")t="#"+t;else if(!t||t.length<2||t.slice(0,2)!="#/")throw Error('Invalid value for "href" attribute: '+t);n.setAttribute("href",t),n.addEventListener("click",i=>{i.preventDefault(),e.disabled||A0(i.currentTarget.getAttribute("href"))})}function bu(n){return n&&typeof n=="string"?{href:n}:n||{}}function A0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function I0(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor($,M){if(!M||typeof M!="function"&&(typeof M!="object"||M._sveltesparouter!==!0))throw Error("Invalid component object");if(!$||typeof $=="string"&&($.length<1||$.charAt(0)!="/"&&$.charAt(0)!="*")||typeof $=="object"&&!($ instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:O,keys:D}=D_($);this.path=$,typeof M=="object"&&M._sveltesparouter===!0?(this.component=M.component,this.conditions=M.conditions||[],this.userData=M.userData,this.props=M.props||{}):(this.component=()=>Promise.resolve(M),this.conditions=[],this.props={}),this._pattern=O,this._keys=D}match($){if(s){if(typeof s=="string")if($.startsWith(s))$=$.substr(s.length)||"/";else return null;else if(s instanceof RegExp){const I=$.match(s);if(I&&I[0])$=$.substr(I[0].length)||"/";else return null}}const M=this._pattern.exec($);if(M===null)return null;if(this._keys===!1)return M;const O={};let D=0;for(;D{r.push(new o($,T))}):Object.keys(i).forEach(T=>{r.push(new o(T,i[T]))});let a=null,u=null,f={};const c=pt();async function d(T,$){await ln(),c(T,$)}let h=null,m=null;l&&(m=T=>{T.state&&(T.state.__svelte_spa_router_scrollY||T.state.__svelte_spa_router_scrollX)?h=T.state:h=null},window.addEventListener("popstate",m),y0(()=>{D0(h)}));let g=null,_=null;const y=Ho.subscribe(async T=>{g=T;let $=0;for(;${gu.set(u)});return}t(0,a=null),_=null,gu.set(void 0)});Cl(()=>{y(),m&&window.removeEventListener("popstate",m)});function S(T){Re.call(this,n,T)}function C(T){Re.call(this,n,T)}return n.$$set=T=>{"routes"in T&&t(3,i=T.routes),"prefix"in T&&t(4,s=T.prefix),"restoreScrollState"in T&&t(5,l=T.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,C]}class L0 extends be{constructor(e){super(),_e(this,e,I0,E0,me,{routes:3,prefix:4,restoreScrollState:5})}}const ro=[];let A_;function I_(n){const e=n.pattern.test(A_);vu(n,n.className,e),vu(n,n.inactiveClassName,!e)}function vu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ho.subscribe(n=>{A_=n.location+(n.querystring?"?"+n.querystring:""),ro.map(I_)});function zn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?D_(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return ro.push(i),I_(i),{destroy(){ro.splice(ro.indexOf(i),1)}}}const P0="modulepreload",N0=function(n,e){return new URL(n,e).href},yu={},ft=function(e,t,i){if(!t||t.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(t.map(l=>{if(l=N0(l,i),l in yu)return;yu[l]=!0;const o=l.endsWith(".css"),r=o?'[rel="stylesheet"]':"";if(!!i)for(let f=s.length-1;f>=0;f--){const c=s[f];if(c.href===l&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${r}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":P0,o||(u.as="script",u.crossOrigin=""),u.href=l,document.head.appendChild(u),o)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${l}`)))})})).then(()=>e()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})};function Zt(n,e,t,i){return new(t||(t=Promise))(function(s,l){function o(u){try{a(i.next(u))}catch(f){l(f)}}function r(u){try{a(i.throw(u))}catch(f){l(f)}}function a(u){u.done?s(u.value):function(c){return c instanceof t?c:new t(function(d){d(c)})}(u.value).then(o,r)}a((i=i.apply(n,e||[])).next())})}class Kn extends Error{constructor(e){var t,i,s,l;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Kn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof Kn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)===null||t===void 0?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":!((l=(s=(i=this.originalError)===null||i===void 0?void 0:i.cause)===null||s===void 0?void 0:s.message)===null||l===void 0)&&l.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return Object.assign({},this)}}const ql=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function F0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},e||{}).decode||R0;let s=0;for(;s0&&(!t.exp||t.exp-e>Date.now()/1e3))}L_=typeof atob=="function"?atob:n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,s=0,l=0,o="";i=e.charAt(l++);~i&&(t=s%4?64*t+i:i,s++%4)?o+=String.fromCharCode(255&t>>(-2*s&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o};const wu="pb_auth";class j0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!Sa(this.token)}get isAdmin(){return ao(this.token).type==="admin"}get isAuthRecord(){return ao(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=wu){const i=F0(e||"")[t]||"";let s={};try{s=JSON.parse(i),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.model||null)}exportToCookie(e,t=wu){var i,s;const l={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},o=ao(this.token);o!=null&&o.exp?l.expires=new Date(1e3*o.exp):l.expires=new Date("1970-01-01"),e=Object.assign({},l,e);const r={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let a=ku(t,JSON.stringify(r),e);const u=typeof Blob<"u"?new Blob([a]).size:a.length;if(r.model&&u>4096){r.model={id:(i=r==null?void 0:r.model)===null||i===void 0?void 0:i.id,email:(s=r==null?void 0:r.model)===null||s===void 0?void 0:s.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(r.model[c]=this.model[c]);a=ku(t,JSON.stringify(r),e)}return a}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class P_ extends j0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class fs{constructor(e){this.client=e}}class H0 extends fs{getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}generateAppleClientSecret(e,t,i,s,l,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:s,duration:l}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class Ta extends fs{decode(e){return e}getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(s=>{var l;return s.items=((l=s.items)===null||l===void 0?void 0:l.map(o=>this.decode(o)))||[],s})}getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var s;if(!(!((s=i==null?void 0:i.items)===null||s===void 0)&&s.length))throw new Kn({status:404,data:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}getOne(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(s=>this.decode(s))}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],s=l=>Zt(this,void 0,void 0,function*(){return this.getList(l,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?s(l+1):i})});return s(1)}}function En(n,e,t,i){const s=i!==void 0;return s||t!==void 0?s?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function or(n){var e,t;(t=(e=n)._resetAutoRefresh)===null||t===void 0||t.call(e)}class V0 extends Ta{get baseCrudPath(){return"/api/admins"}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)===s.id&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l;return i&&((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)===e&&((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}authWithPassword(e,t,i,s){return Zt(this,void 0,void 0,function*(){let l={method:"POST",body:{identity:e,password:t}};l=En("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",l,i,s);const o=l.autoRefreshThreshold;delete l.autoRefreshThreshold,l.autoRefresh||or(this.client);let r=yield this.client.send(this.baseCrudPath+"/auth-with-password",l);return r=this.authResponse(r),o&&function(u,f,c,d){or(u);const h=u.beforeSend,m=u.authStore.model,g=u.authStore.onChange((_,y)=>{(!_||(y==null?void 0:y.id)!=(m==null?void 0:m.id)||(y!=null&&y.collectionId||m!=null&&m.collectionId)&&(y==null?void 0:y.collectionId)!=(m==null?void 0:m.collectionId))&&or(u)});u._resetAutoRefresh=function(){g(),u.beforeSend=h,delete u._resetAutoRefresh},u.beforeSend=(_,y)=>Zt(this,void 0,void 0,function*(){var S;const C=u.authStore.token;if(!((S=y.query)===null||S===void 0)&&S.autoRefresh)return h?h(_,y):{url:_,sendOptions:y};let T=u.authStore.isValid;if(T&&Sa(u.authStore.token,f))try{yield c()}catch{T=!1}T||(yield d());const $=y.headers||{};for(let M in $)if(M.toLowerCase()=="authorization"&&C==$[M]&&u.authStore.token){$[M]=u.authStore.token;break}return y.headers=$,h?h(_,y):{url:_,sendOptions:y}})}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},l))),r})}authRefresh(e,t){let i={method:"POST"};return i=En("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=En("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}class N_ extends fs{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentTopics=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}subscribe(e,t){var i;return Zt(this,void 0,void 0,function*(){if(!e)throw new Error("topic must be set.");const s=function(l){const o=l;let r;try{r=JSON.parse(o==null?void 0:o.data)}catch{}t(r||{})};return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e].push(s),this.isConnected?this.subscriptions[e].length===1?yield this.submitSubscriptions():(i=this.eventSource)===null||i===void 0||i.addEventListener(e,s):yield this.connect(),()=>Zt(this,void 0,void 0,function*(){return this.unsubscribeByTopicAndListener(e,s)})})}unsubscribe(e){var t;return Zt(this,void 0,void 0,function*(){if(this.hasSubscriptionListeners(e)){if(e){for(let i of this.subscriptions[e])(t=this.eventSource)===null||t===void 0||t.removeEventListener(e,i);delete this.subscriptions[e]}else this.subscriptions={};this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect()}})}unsubscribeByPrefix(e){var t;return Zt(this,void 0,void 0,function*(){let i=!1;for(let s in this.subscriptions)if(s.startsWith(e)){i=!0;for(let l of this.subscriptions[s])(t=this.eventSource)===null||t===void 0||t.removeEventListener(s,l);delete this.subscriptions[s]}i&&(this.hasSubscriptionListeners()?yield this.submitSubscriptions():this.disconnect())})}unsubscribeByTopicAndListener(e,t){var i;return Zt(this,void 0,void 0,function*(){if(!Array.isArray(this.subscriptions[e])||!this.subscriptions[e].length)return;let s=!1;for(let l=this.subscriptions[e].length-1;l>=0;l--)this.subscriptions[e][l]===t&&(s=!0,delete this.subscriptions[e][l],this.subscriptions[e].splice(l,1),(i=this.eventSource)===null||i===void 0||i.removeEventListener(e,t));s&&(this.subscriptions[e].length||delete this.subscriptions[e],this.hasSubscriptionListeners()?this.hasSubscriptionListeners(e)||(yield this.submitSubscriptions()):this.disconnect())})}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!(!((t=this.subscriptions[e])===null||t===void 0)&&t.length);for(let s in this.subscriptions)if(!((i=this.subscriptions[s])===null||i===void 0)&&i.length)return!0;return!1}submitSubscriptions(){return Zt(this,void 0,void 0,function*(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentTopics=this.getNonEmptySubscriptionTopics(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentTopics},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getNonEmptySubscriptionTopics(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}connect(){return Zt(this,void 0,void 0,function*(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(()=>Zt(this,void 0,void 0,function*(){let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,yield this.submitSubscriptions()})).then(()=>{for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionTopics();if(e.length!=this.lastSentTopics.length)return!0;for(const t of e)if(!this.lastSentTopics.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new Kn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)===null||t===void 0||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class z0 extends Ta{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}subscribeOne(e,t){return Zt(this,void 0,void 0,function*(){return console.warn("PocketBase: subscribeOne(recordId, callback) is deprecated. Please replace it with subscribe(recordId, callback)."),this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t)})}subscribe(e,t){return Zt(this,void 0,void 0,function*(){if(typeof e=="function")return console.warn("PocketBase: subscribe(callback) is deprecated. Please replace it with subscribe('*', callback)."),this.client.realtime.subscribe(this.collectionIdOrName,e);if(!t)throw new Error("Missing subscription callback.");if(e==="")throw new Error("Missing topic.");let i=this.collectionIdOrName;return e!=="*"&&(i+="/"+e),this.client.realtime.subscribe(i,t)})}unsubscribe(e){return Zt(this,void 0,void 0,function*(){return e==="*"?this.client.realtime.unsubscribe(this.collectionIdOrName):e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)})}getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}getList(e=1,t=30,i){return super.getList(e,t,i)}getFirstListItem(e,t){return super.getFirstListItem(e,t)}getOne(e,t){return super.getOne(e,t)}create(e,t){return super.create(e,t)}update(e,t,i){return super.update(e,t,i).then(s=>{var l,o,r;return((l=this.client.authStore.model)===null||l===void 0?void 0:l.id)!==(s==null?void 0:s.id)||((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)===null||r===void 0?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,s),s})}delete(e,t){return super.delete(e,t).then(i=>{var s,l,o;return!i||((s=this.client.authStore.model)===null||s===void 0?void 0:s.id)!==e||((l=this.client.authStore.model)===null||l===void 0?void 0:l.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)===null||o===void 0?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}authWithPassword(e,t,i,s){let l={method:"POST",body:{identity:e,password:t}};return l=En("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/auth-with-password",l).then(o=>this.authResponse(o))}authWithOAuth2Code(e,t,i,s,l,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:s,createData:l}};return a=En("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){return Zt(this,void 0,void 0,function*(){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{},i=(yield this.listAuthMethods()).authProviders.find(a=>a.name===t.provider);if(!i)throw new Kn(new Error(`Missing or invalid provider "${t.provider}".`));const s=this.client.buildUrl("/api/oauth2-redirect"),l=new N_(this.client);let o=null;function r(){o==null||o.close(),l.unsubscribe()}return t.urlCallback||(o=Su(void 0)),new Promise((a,u)=>Zt(this,void 0,void 0,function*(){var f;try{yield l.subscribe("@oauth2",m=>Zt(this,void 0,void 0,function*(){const g=l.clientId;try{if(!m.state||g!==m.state)throw new Error("State parameters don't match.");const _=Object.assign({},t);delete _.provider,delete _.scopes,delete _.createData,delete _.urlCallback;const y=yield this.authWithOAuth2Code(i.name,m.code,i.codeVerifier,s,t.createData,_);a(y)}catch(_){u(new Kn(_))}r()}));const c={state:l.clientId};!((f=t.scopes)===null||f===void 0)&&f.length&&(c.scope=t.scopes.join(" "));const d=this._replaceQueryParams(i.authUrl+s,c);yield(t.urlCallback||function(m){o?o.location.href=m:o=Su(m)})(d)}catch(c){r(),u(new Kn(c))}}))})}authRefresh(e,t){let i={method:"POST"};return i=En("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(s=>this.authResponse(s))}requestPasswordReset(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then(()=>!0)}confirmPasswordReset(e,t,i,s,l){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=En("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,s,l),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}requestVerification(e,t,i){let s={method:"POST",body:{email:e}};return s=En("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-verification",s).then(()=>!0)}confirmVerification(e,t,i){let s={method:"POST",body:{token:e}};return s=En("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then(()=>!0)}requestEmailChange(e,t,i){let s={method:"POST",body:{newEmail:e}};return s=En("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",s).then(()=>!0)}confirmEmailChange(e,t,i,s){let l={method:"POST",body:{token:e,password:t}};return l=En("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",l,i,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",l).then(()=>!0)}listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,s="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),s=e.substring(e.indexOf("?")+1));const l={},o=s.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");l[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete l[r]:l[r]=t[r]);s="";for(let r in l)l.hasOwnProperty(r)&&(s!=""&&(s+="&"),s+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(l[r].replace(/%20/g,"+")));return s!=""?i+"?"+s:i}}function Su(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Kn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,s=window.innerHeight;e=e>i?i:e,t=t>s?s:t;let l=i/2-e/2,o=s/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+l+",resizable,menubar=no")}class B0 extends Ta{get baseCrudPath(){return"/api/collections"}import(e,t=!1,i){return Zt(this,void 0,void 0,function*(){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)})}}class U0 extends fs{getRequestsList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs/requests",i)}getRequest(e,t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/requests/"+encodeURIComponent(e),t)}getRequestsStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/requests/stats",e)}}class W0 extends fs{check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class Y0 extends fs{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(e.collectionId||e.collectionName)),s.push(encodeURIComponent(e.id)),s.push(encodeURIComponent(t));let l=this.client.buildUrl(s.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);l+=(l.includes("?")?"&":"?")+o}return l}getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class K0 extends fs{getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}const J0=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];class Vo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new P_,this.admins=new V0(this),this.collections=new B0(this),this.files=new Y0(this),this.logs=new U0(this),this.settings=new H0(this),this.realtime=new N_(this),this.health=new W0(this),this.backups=new K0(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new z0(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var t;let i=this.baseUrl;return typeof window>"u"||!window.location||i.startsWith("https://")||i.startsWith("http://")||(i=!((t=window.location.origin)===null||t===void 0)&&t.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(i+=window.location.pathname||"/",i+=i.endsWith("/")?"":"/"),i+=this.baseUrl),e&&(i+=i.endsWith("/")?"":"/",i+=e.startsWith("/")?e.substring(1):e),i}send(e,t){return Zt(this,void 0,void 0,function*(){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const s=Object.assign({},yield this.beforeSend(i,t));s.url!==void 0||s.options!==void 0?(i=s.url||i,t=s.options||t):Object.keys(s).length&&(t=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const s=this.serializeQueryParams(t.query);s&&(i+=(i.includes("?")?"&":"?")+s),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(s=>Zt(this,void 0,void 0,function*(){let l={};try{l=yield s.json()}catch{}if(this.afterSend&&(l=yield this.afterSend(s,l)),s.status>=400)throw new Kn({url:s.url,status:s.status,data:l});return l})).catch(s=>{throw new Kn(s)})})}initSendOptions(e,t){(t=Object.assign({method:"GET"},t)).query=t.query||{},t.body=this.convertToFormDataIfNeeded(t.body);for(let i in t)J0.includes(i)||(t.query[i]=t[i],delete t[i]);if(t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const s=new AbortController;this.cancelControllers[i]=s,t.signal=s.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(let i in e){const s=Array.isArray(e[i])?e[i]:[e[i]];for(let l of s)t.append(i,l)}return t}hasBlobField(e){for(let t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(let s of i)if(typeof Blob<"u"&&s instanceof Blob||typeof File<"u"&&s instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(const o of s)t.push(l+"="+encodeURIComponent(o));else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")}}class cs extends Error{}class G0 extends cs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Z0 extends cs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class X0 extends cs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class xs extends cs{}class F_ extends cs{constructor(e){super(`Invalid unit ${e}`)}}class Un extends cs{}class Ii extends cs{constructor(){super("Zone is an abstract class")}}const Le="numeric",si="short",In="long",Wr={year:Le,month:Le,day:Le},R_={year:Le,month:si,day:Le},Q0={year:Le,month:si,day:Le,weekday:si},q_={year:Le,month:In,day:Le},j_={year:Le,month:In,day:Le,weekday:In},H_={hour:Le,minute:Le},V_={hour:Le,minute:Le,second:Le},z_={hour:Le,minute:Le,second:Le,timeZoneName:si},B_={hour:Le,minute:Le,second:Le,timeZoneName:In},U_={hour:Le,minute:Le,hourCycle:"h23"},W_={hour:Le,minute:Le,second:Le,hourCycle:"h23"},Y_={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:si},K_={hour:Le,minute:Le,second:Le,hourCycle:"h23",timeZoneName:In},J_={year:Le,month:Le,day:Le,hour:Le,minute:Le},G_={year:Le,month:Le,day:Le,hour:Le,minute:Le,second:Le},Z_={year:Le,month:si,day:Le,hour:Le,minute:Le},X_={year:Le,month:si,day:Le,hour:Le,minute:Le,second:Le},x0={year:Le,month:si,day:Le,weekday:si,hour:Le,minute:Le},Q_={year:Le,month:In,day:Le,hour:Le,minute:Le,timeZoneName:si},x_={year:Le,month:In,day:Le,hour:Le,minute:Le,second:Le,timeZoneName:si},eb={year:Le,month:In,day:Le,weekday:In,hour:Le,minute:Le,timeZoneName:In},tb={year:Le,month:In,day:Le,weekday:In,hour:Le,minute:Le,second:Le,timeZoneName:In};function rt(n){return typeof n>"u"}function ls(n){return typeof n=="number"}function zo(n){return typeof n=="number"&&n%1===0}function ev(n){return typeof n=="string"}function tv(n){return Object.prototype.toString.call(n)==="[object Date]"}function nb(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function nv(n){return Array.isArray(n)?n:[n]}function Tu(n,e,t){if(n.length!==0)return n.reduce((i,s)=>{const l=[e(s),s];return i&&t(i[0],l[0])===i[0]?i:l},null)[1]}function iv(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Os(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Si(n,e,t){return zo(n)&&n>=e&&n<=t}function sv(n,e){return n-e*Math.floor(n/e)}function Gt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Pi(n){if(!(rt(n)||n===null||n===""))return parseInt(n,10)}function Ki(n){if(!(rt(n)||n===null||n===""))return parseFloat(n)}function Ca(n){if(!(rt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function $a(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function $l(n){return n%4===0&&(n%100!==0||n%400===0)}function il(n){return $l(n)?366:365}function bo(n,e){const t=sv(e-1,12)+1,i=n+(e-t)/12;return t===2?$l(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Ma(n){let e=Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second,n.millisecond);return n.year<100&&n.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function vo(n){const e=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7,t=n-1,i=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7;return e===4||i===3?53:52}function Yr(n){return n>99?n:n>60?1900+n:2e3+n}function ib(n,e,t,i=null){const s=new Date(n),l={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(l.timeZone=i);const o={timeZoneName:e,...l},r=new Intl.DateTimeFormat(t,o).formatToParts(s).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Bo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,s=t<0||Object.is(t,-0)?-i:i;return t*60+s}function sb(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Un(`Invalid unit value ${n}`);return e}function yo(n,e){const t={};for(const i in n)if(Os(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=sb(s)}return t}function sl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),s=n>=0?"+":"-";switch(e){case"short":return`${s}${Gt(t,2)}:${Gt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Gt(t,2)}${Gt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Uo(n){return iv(n,["hour","minute","second","millisecond"])}const lb=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,lv=["January","February","March","April","May","June","July","August","September","October","November","December"],ob=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ov=["J","F","M","A","M","J","J","A","S","O","N","D"];function rb(n){switch(n){case"narrow":return[...ov];case"short":return[...ob];case"long":return[...lv];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ab=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ub=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],rv=["M","T","W","T","F","S","S"];function fb(n){switch(n){case"narrow":return[...rv];case"short":return[...ub];case"long":return[...ab];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const cb=["AM","PM"],av=["Before Christ","Anno Domini"],uv=["BC","AD"],fv=["B","A"];function db(n){switch(n){case"narrow":return[...fv];case"short":return[...uv];case"long":return[...av];default:return null}}function cv(n){return cb[n.hour<12?0:1]}function dv(n,e){return fb(e)[n.weekday-1]}function pv(n,e){return rb(e)[n.month-1]}function hv(n,e){return db(e)[n.year<0?0:1]}function mv(n,e,t="always",i=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&l){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${s[n][0]}`;case-1:return c?"yesterday":`last ${s[n][0]}`;case 0:return c?"today":`this ${s[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=s[n],f=i?a?u[1]:u[2]||u[1]:a?s[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Cu(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const gv={D:Wr,DD:R_,DDD:q_,DDDD:j_,t:H_,tt:V_,ttt:z_,tttt:B_,T:U_,TT:W_,TTT:Y_,TTTT:K_,f:J_,ff:Z_,fff:Q_,ffff:eb,F:G_,FF:X_,FFF:x_,FFFF:tb};class wn{static create(e,t={}){return new wn(e,t)}static parseFormat(e){let t=null,i="",s=!1;const l=[];for(let o=0;o0&&l.push({literal:s,val:i}),t=null,i="",s=!s):s||r===t?i+=r:(i.length>0&&l.push({literal:!1,val:i}),i=r,t=r)}return i.length>0&&l.push({literal:s,val:i}),l}static macroTokenToFormatOpts(e){return gv[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return Gt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,m)=>this.loc.extract(e,h,m),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?cv(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,m)=>i?pv(e,h):l(m?{month:h}:{month:h,day:"numeric"},"month"),u=(h,m)=>i?dv(e,h):l(m?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const m=wn.macroTokenToFormatOpts(h);return m?this.formatWithSystemDefault(e,m):h},c=h=>i?hv(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(h)}};return Cu(wn.parseFormat(t),d)}formatDurationFromString(e,t){const i=a=>{switch(a[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},s=a=>u=>{const f=i(u);return f?this.num(a.get(f),u.length):u},l=wn.parseFormat(t),o=l.reduce((a,{literal:u,val:f})=>u?a:a.concat(f),[]),r=e.shiftTo(...o.map(i).filter(a=>a));return Cu(l,s(r))}}class ti{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ml{get type(){throw new Ii}get name(){throw new Ii}get ianaName(){return this.name}get isUniversal(){throw new Ii}offsetName(e,t){throw new Ii}formatOffset(e,t){throw new Ii}offset(e){throw new Ii}equals(e){throw new Ii}get isValid(){throw new Ii}}let rr=null;class Oa extends Ml{static get instance(){return rr===null&&(rr=new Oa),rr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return ib(e,t,i)}formatOffset(e,t){return sl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let uo={};function _v(n){return uo[n]||(uo[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),uo[n]}const bv={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function vv(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,s,l,o,r,a,u,f]=i;return[o,s,l,r,a,u,f]}function yv(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s=0?m:1e3+m,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let ar=null;class bn extends Ml{static get utcInstance(){return ar===null&&(ar=new bn(0)),ar}static instance(e){return e===0?bn.utcInstance:new bn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new bn(Bo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return sl(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class kv extends Ml{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Fi(n,e){if(rt(n)||n===null)return e;if(n instanceof Ml)return n;if(ev(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?bn.utcInstance:bn.parseSpecifier(t)||Ti.create(n)}else return ls(n)?bn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new kv(n)}let $u=()=>Date.now(),Mu="system",Ou=null,Eu=null,Du=null,Au;class tn{static get now(){return $u}static set now(e){$u=e}static set defaultZone(e){Mu=e}static get defaultZone(){return Fi(Mu,Oa.instance)}static get defaultLocale(){return Ou}static set defaultLocale(e){Ou=e}static get defaultNumberingSystem(){return Eu}static set defaultNumberingSystem(e){Eu=e}static get defaultOutputCalendar(){return Du}static set defaultOutputCalendar(e){Du=e}static get throwOnInvalid(){return Au}static set throwOnInvalid(e){Au=e}static resetCaches(){Rt.resetCache(),Ti.resetCache()}}let Iu={};function wv(n,e={}){const t=JSON.stringify([n,e]);let i=Iu[t];return i||(i=new Intl.ListFormat(n,e),Iu[t]=i),i}let Kr={};function Jr(n,e={}){const t=JSON.stringify([n,e]);let i=Kr[t];return i||(i=new Intl.DateTimeFormat(n,e),Kr[t]=i),i}let Gr={};function Sv(n,e={}){const t=JSON.stringify([n,e]);let i=Gr[t];return i||(i=new Intl.NumberFormat(n,e),Gr[t]=i),i}let Zr={};function Tv(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Zr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Zr[s]=l),l}let el=null;function Cv(){return el||(el=new Intl.DateTimeFormat().resolvedOptions().locale,el)}function $v(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Jr(n).resolvedOptions()}catch{t=Jr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function Mv(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Ov(n){const e=[];for(let t=1;t<=12;t++){const i=Ye.utc(2016,t,1);e.push(n(i))}return e}function Ev(n){const e=[];for(let t=1;t<=7;t++){const i=Ye.utc(2016,11,13+t);e.push(n(i))}return e}function Hl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function Dv(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class Av{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Sv(e,r)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}else{const t=this.floor?Math.floor(e):$a(e,3);return Gt(t,this.padTo)}}}class Iv{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&Ti.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Ye.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Jr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Lv{constructor(e,t,i){this.opts={style:"long",...i},!t&&nb()&&(this.rtf=Tv(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):mv(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Rt{static fromOpts(e){return Rt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||tn.defaultLocale,o=l||(s?"en-US":Cv()),r=t||tn.defaultNumberingSystem,a=i||tn.defaultOutputCalendar;return new Rt(o,r,a,l)}static resetCache(){el=null,Kr={},Gr={},Zr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Rt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=$v(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=Mv(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Dv(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Rt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,i=!0){return Hl(this,e,i,rb,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=Ov(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Hl(this,e,i,fb,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=Ev(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Hl(this,void 0,e,()=>cb,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ye.utc(2016,11,13,9),Ye.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Hl(this,e,t,db,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ye.utc(-40,1,1),Ye.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Av(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Iv(e,this.intl,t)}relFormatter(e={}){return new Lv(this.intl,this.isEnglish(),e)}listFormatter(e={}){return wv(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Ps(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ns(...n){return e=>n.reduce(([t,i,s],l)=>{const[o,r,a]=l(e,s);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Fs(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const s=t.exec(n);if(s)return i(s)}return[null,null]}function pb(...n){return(e,t)=>{const i={};let s;for(s=0;sh!==void 0&&(m||h&&f)?-h:h;return[{years:d(Ki(t)),months:d(Ki(i)),weeks:d(Ki(s)),days:d(Ki(l)),hours:d(Ki(o)),minutes:d(Ki(r)),seconds:d(Ki(a),a==="-0"),milliseconds:d(Ca(u),c)}]}const Yv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Aa(n,e,t,i,s,l,o){const r={year:e.length===2?Yr(Pi(e)):Pi(e),month:ob.indexOf(t)+1,day:Pi(i),hour:Pi(s),minute:Pi(l)};return o&&(r.second=Pi(o)),n&&(r.weekday=n.length>3?ab.indexOf(n)+1:ub.indexOf(n)+1),r}const Kv=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Jv(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=Aa(e,s,i,t,l,o,r);let h;return a?h=Yv[a]:u?h=0:h=Bo(f,c),[d,new bn(h)]}function Gv(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Zv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Xv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Qv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Lu(n){const[,e,t,i,s,l,o,r]=n;return[Aa(e,s,i,t,l,o,r),bn.utcInstance]}function xv(n){const[,e,t,i,s,l,o,r]=n;return[Aa(e,r,t,i,s,l,o),bn.utcInstance]}const ey=Ps(Nv,Da),ty=Ps(Fv,Da),ny=Ps(Rv,Da),iy=Ps(mb),_b=Ns(zv,Rs,Ol,El),sy=Ns(qv,Rs,Ol,El),ly=Ns(jv,Rs,Ol,El),oy=Ns(Rs,Ol,El);function ry(n){return Fs(n,[ey,_b],[ty,sy],[ny,ly],[iy,oy])}function ay(n){return Fs(Gv(n),[Kv,Jv])}function uy(n){return Fs(n,[Zv,Lu],[Xv,Lu],[Qv,xv])}function fy(n){return Fs(n,[Uv,Wv])}const cy=Ns(Rs);function dy(n){return Fs(n,[Bv,cy])}const py=Ps(Hv,Vv),hy=Ps(gb),my=Ns(Rs,Ol,El);function gy(n){return Fs(n,[py,_b],[hy,my])}const _y="Invalid Duration",bb={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},by={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...bb},qn=146097/400,gs=146097/4800,vy={years:{quarters:4,months:12,weeks:qn/7,days:qn,hours:qn*24,minutes:qn*24*60,seconds:qn*24*60*60,milliseconds:qn*24*60*60*1e3},quarters:{months:3,weeks:qn/28,days:qn/4,hours:qn*24/4,minutes:qn*24*60/4,seconds:qn*24*60*60/4,milliseconds:qn*24*60*60*1e3/4},months:{weeks:gs/7,days:gs,hours:gs*24,minutes:gs*24*60,seconds:gs*24*60*60,milliseconds:gs*24*60*60*1e3},...bb},xi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],yy=xi.slice(0).reverse();function Ji(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy};return new ct(i)}function ky(n){return n<0?Math.floor(n):Math.ceil(n)}function vb(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?ky(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function wy(n,e){yy.reduce((t,i)=>rt(e[i])?t:(t&&vb(n,e,t,e,i),i),null)}class ct{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Rt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?vy:by,this.isLuxonDuration=!0}static fromMillis(e,t){return ct.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Un(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new ct({values:yo(e,ct.normalizeUnit),loc:Rt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ls(e))return ct.fromMillis(e);if(ct.isDuration(e))return e;if(typeof e=="object")return ct.fromObject(e);throw new Un(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=fy(e);return i?ct.fromObject(i,t):ct.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=dy(e);return i?ct.fromObject(i,t):ct.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the Duration is invalid");const i=e instanceof ti?e:new ti(e,t);if(tn.throwOnInvalid)throw new X0(i);return new ct({invalid:i})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!t)throw new F_(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const i={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?wn.create(this.loc,i).formatDurationFromString(this,e):_y}toHuman(e={}){const t=xi.map(i=>{const s=this.values[i];return rt(s)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:i.slice(0,-1)}).format(s)}).filter(i=>i);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=$a(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const i=this.shiftTo("hours","minutes","seconds","milliseconds");let s=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||i.seconds!==0||i.milliseconds!==0)&&(s+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||i.milliseconds!==0)&&(s+=".SSS"));let l=i.toFormat(s);return e.includePrefix&&(l="T"+l),l}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=ct.fromDurationLike(e),i={};for(const s of xi)(Os(t.values,s)||Os(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Ji(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=ct.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const i of Object.keys(this.values))t[i]=sb(e(this.values[i],i));return Ji(this,{values:t},!0)}get(e){return this[ct.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...yo(e,ct.normalizeUnit)};return Ji(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t}),l={loc:s};return i&&(l.conversionAccuracy=i),Ji(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return wy(this.matrix,e),Ji(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>ct.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of xi)if(e.indexOf(o)>=0){l=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;ls(s[o])&&(r+=s[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3;for(const u in s)xi.indexOf(u)>xi.indexOf(o)&&vb(this.matrix,s,u,t,o)}else ls(s[o])&&(i[o]=s[o]);for(const o in i)i[o]!==0&&(t[l]+=o===l?i[o]:i[o]/this.matrix[l][o]);return Ji(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Ji(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,s){return i===void 0||i===0?s===void 0||s===0:i===s}for(const i of xi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const zs="Invalid Interval";function Sy(n,e){return!n||!n.isValid?Ht.invalid("missing or invalid start"):!e||!e.isValid?Ht.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:t}={}){return this.isValid?Ht.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Ws).filter(o=>this.contains(o)).sort(),i=[];let{s}=this,l=0;for(;s+this.e?this.e:o;i.push(Ht.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=ct.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,s=1,l;const o=[];for(;ia*s));l=+r>+this.e?this.e:r,o.push(Ht.fromDateTimes(i,l)),i=l,s+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,i=this.e=i?null:Ht.fromDateTimes(t,i)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ht.fromDateTimes(t,i)}static merge(e){const[t,i]=e.sort((s,l)=>s.s-l.s).reduce(([s,l],o)=>l?l.overlaps(o)||l.abutsStart(o)?[s,l.union(o)]:[s.concat([l]),o]:[s,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const s=[],l=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...l),r=o.sort((a,u)=>a.time-u.time);for(const a of r)i+=a.type==="s"?1:-1,i===1?t=a.time:(t&&+t!=+a.time&&s.push(Ht.fromDateTimes(t,a.time)),t=null);return Ht.merge(s)}difference(...e){return Ht.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:zs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:zs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:zs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:zs}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:zs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):ct.invalid(this.invalidReason)}mapEndpoints(e){return Ht.fromDateTimes(e(this.s),e(this.e))}}class Vl{static hasDST(e=tn.defaultZone){const t=Ye.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Ti.isValidZone(e)}static normalizeZone(e){return Fi(e,tn.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Rt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Rt.create(t,null,"gregory").eras(e)}static features(){return{relative:nb()}}}function Pu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(ct.fromMillis(i).as("days"))}function Ty(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=Pu(r,a);return(u-u%7)/7}],["days",Pu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function Cy(n,e,t,i){let[s,l,o,r]=Ty(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o0?ct.fromMillis(a,i).shiftTo(...u).plus(f):f}const Ia={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Nu={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},$y=Ia.hanidec.replace(/[\[|\]]/g,"").split("");function My(n){let e=parseInt(n,10);if(isNaN(e)){e="";for(let t=0;t=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function xn({numberingSystem:n},e=""){return new RegExp(`${Ia[n||"latn"]}${e}`)}const Oy="missing Intl.DateTimeFormat.formatToParts support";function ht(n,e=t=>t){return{regex:n,deser:([t])=>e(My(t))}}const Ey=String.fromCharCode(160),yb=`[ ${Ey}]`,kb=new RegExp(yb,"g");function Dy(n){return n.replace(/\./g,"\\.?").replace(kb,yb)}function Fu(n){return n.replace(/\./g,"").replace(kb," ").toLowerCase()}function ei(n,e){return n===null?null:{regex:RegExp(n.map(Dy).join("|")),deser:([t])=>n.findIndex(i=>Fu(t)===Fu(i))+e}}function Ru(n,e){return{regex:n,deser:([,t,i])=>Bo(t,i),groups:e}}function ur(n){return{regex:n,deser:([e])=>e}}function Ay(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Iy(n,e){const t=xn(e),i=xn(e,"{2}"),s=xn(e,"{3}"),l=xn(e,"{4}"),o=xn(e,"{6}"),r=xn(e,"{1,2}"),a=xn(e,"{1,3}"),u=xn(e,"{1,6}"),f=xn(e,"{1,9}"),c=xn(e,"{2,4}"),d=xn(e,"{4,6}"),h=_=>({regex:RegExp(Ay(_.val)),deser:([y])=>y,literal:!0}),g=(_=>{if(n.literal)return h(_);switch(_.val){case"G":return ei(e.eras("short",!1),0);case"GG":return ei(e.eras("long",!1),0);case"y":return ht(u);case"yy":return ht(c,Yr);case"yyyy":return ht(l);case"yyyyy":return ht(d);case"yyyyyy":return ht(o);case"M":return ht(r);case"MM":return ht(i);case"MMM":return ei(e.months("short",!0,!1),1);case"MMMM":return ei(e.months("long",!0,!1),1);case"L":return ht(r);case"LL":return ht(i);case"LLL":return ei(e.months("short",!1,!1),1);case"LLLL":return ei(e.months("long",!1,!1),1);case"d":return ht(r);case"dd":return ht(i);case"o":return ht(a);case"ooo":return ht(s);case"HH":return ht(i);case"H":return ht(r);case"hh":return ht(i);case"h":return ht(r);case"mm":return ht(i);case"m":return ht(r);case"q":return ht(r);case"qq":return ht(i);case"s":return ht(r);case"ss":return ht(i);case"S":return ht(a);case"SSS":return ht(s);case"u":return ur(f);case"uu":return ur(r);case"uuu":return ht(t);case"a":return ei(e.meridiems(),0);case"kkkk":return ht(l);case"kk":return ht(c,Yr);case"W":return ht(r);case"WW":return ht(i);case"E":case"c":return ht(t);case"EEE":return ei(e.weekdays("short",!1,!1),1);case"EEEE":return ei(e.weekdays("long",!1,!1),1);case"ccc":return ei(e.weekdays("short",!0,!1),1);case"cccc":return ei(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ru(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Ru(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return ur(/[a-z_+-/]{1,256}?/i);default:return h(_)}})(n)||{invalidReason:Oy};return g.token=n,g}const Ly={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function Py(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=Ly[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function Ny(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Fy(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Os(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(s[r.token.val[0]]=r.deser(i.slice(l,l+a))),l+=a}return[i,s]}else return[i,{}]}function Ry(n){const e=l=>{switch(l){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let t=null,i;return rt(n.z)||(t=Ti.create(n.z)),rt(n.Z)||(t||(t=new bn(n.Z)),i=n.Z),rt(n.q)||(n.M=(n.q-1)*3+1),rt(n.h)||(n.h<12&&n.a===1?n.h+=12:n.h===12&&n.a===0&&(n.h=0)),n.G===0&&n.y&&(n.y=-n.y),rt(n.u)||(n.S=Ca(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let fr=null;function qy(){return fr||(fr=Ye.fromMillis(1555555555555)),fr}function jy(n,e){if(n.literal)return n;const t=wn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=wn.create(e,t).formatDateTimeParts(qy()).map(o=>Py(o,e,t));return l.includes(void 0)?n:l}function Hy(n,e){return Array.prototype.concat(...n.map(t=>jy(t,e)))}function wb(n,e,t){const i=Hy(wn.parseFormat(t),n),s=i.map(o=>Iy(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=Ny(s),a=RegExp(o,"i"),[u,f]=Fy(e,a,r),[c,d,h]=f?Ry(f):[null,null,void 0];if(Os(f,"a")&&Os(f,"H"))throw new xs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:i,regex:a,rawMatches:u,matches:f,result:c,zone:d,specificOffset:h}}}function Vy(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=wb(n,e,t);return[i,s,l,o]}const Sb=[0,31,59,90,120,151,181,212,243,273,304,334],Tb=[0,31,60,91,121,152,182,213,244,274,305,335];function Yn(n,e){return new ti("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Cb(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const s=i.getUTCDay();return s===0?7:s}function $b(n,e,t){return t+($l(n)?Tb:Sb)[e-1]}function Mb(n,e){const t=$l(n)?Tb:Sb,i=t.findIndex(l=>lvo(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Uo(n)}}function qu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Cb(e,1,4),l=il(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=il(r)):o>l?(r=e+1,o-=il(e)):r=e;const{month:a,day:u}=Mb(r,o);return{year:r,month:a,day:u,...Uo(n)}}function cr(n){const{year:e,month:t,day:i}=n,s=$b(e,t,i);return{year:e,ordinal:s,...Uo(n)}}function ju(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Mb(e,t);return{year:e,month:i,day:s,...Uo(n)}}function zy(n){const e=zo(n.weekYear),t=Si(n.weekNumber,1,vo(n.weekYear)),i=Si(n.weekday,1,7);return e?t?i?!1:Yn("weekday",n.weekday):Yn("week",n.week):Yn("weekYear",n.weekYear)}function By(n){const e=zo(n.year),t=Si(n.ordinal,1,il(n.year));return e?t?!1:Yn("ordinal",n.ordinal):Yn("year",n.year)}function Ob(n){const e=zo(n.year),t=Si(n.month,1,12),i=Si(n.day,1,bo(n.year,n.month));return e?t?i?!1:Yn("day",n.day):Yn("month",n.month):Yn("year",n.year)}function Eb(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=Si(e,0,23)||e===24&&t===0&&i===0&&s===0,o=Si(t,0,59),r=Si(i,0,59),a=Si(s,0,999);return l?o?r?a?!1:Yn("millisecond",s):Yn("second",i):Yn("minute",t):Yn("hour",e)}const dr="Invalid DateTime",Hu=864e13;function zl(n){return new ti("unsupported zone",`the zone "${n.name}" is not supported`)}function pr(n){return n.weekData===null&&(n.weekData=Xr(n.c)),n.weekData}function Bs(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Ye({...t,...e,old:t})}function Db(n,e,t){let i=n-e*60*1e3;const s=t.offset(i);if(e===s)return[i,e];i-=(s-e)*60*1e3;const l=t.offset(i);return s===l?[i,s]:[n-Math.min(s,l)*60*1e3,Math.max(s,l)]}function Vu(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function fo(n,e,t){return Db(Ma(n),e,t)}function zu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),s=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,l={...n.c,year:i,month:s,day:Math.min(n.c.day,bo(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=ct.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),r=Ma(l);let[a,u]=Db(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Us(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Ye.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Ye.invalid(new ti("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Bl(n,e,t=!0){return n.isValid?wn.create(Rt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function hr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Gt(n.c.year,t?6:4),e?(i+="-",i+=Gt(n.c.month),i+="-",i+=Gt(n.c.day)):(i+=Gt(n.c.month),i+=Gt(n.c.day)),i}function Bu(n,e,t,i,s,l){let o=Gt(n.c.hour);return e?(o+=":",o+=Gt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Gt(n.c.minute),(n.c.second!==0||!t)&&(o+=Gt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Gt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Gt(Math.trunc(-n.o/60)),o+=":",o+=Gt(Math.trunc(-n.o%60))):(o+="+",o+=Gt(Math.trunc(n.o/60)),o+=":",o+=Gt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Ab={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Uy={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Wy={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ib=["year","month","day","hour","minute","second","millisecond"],Yy=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ky=["year","ordinal","hour","minute","second","millisecond"];function Uu(n){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[n.toLowerCase()];if(!e)throw new F_(n);return e}function Wu(n,e){const t=Fi(e.zone,tn.defaultZone),i=Rt.fromObject(e),s=tn.now();let l,o;if(rt(n.year))l=s;else{for(const u of Ib)rt(n[u])&&(n[u]=Ab[u]);const r=Ob(n)||Eb(n);if(r)return Ye.invalid(r);const a=t.offset(s);[l,o]=fo(n,a,t)}return new Ye({ts:l,zone:t,loc:i,o})}function Yu(n,e,t){const i=rt(t.round)?!0:t.round,s=(o,r)=>(o=$a(o,i||t.calendary?0:2,!0),e.loc.clone(t).relFormatter(t).format(o,r)),l=o=>t.calendary?e.hasSame(n,o)?0:e.startOf(o).diff(n.startOf(o),o).get(o):e.diff(n,o).get(o);if(t.unit)return s(l(t.unit),t.unit);for(const o of t.units){const r=l(o);if(Math.abs(r)>=1)return s(r,o)}return s(n>e?-0:0,t.units[t.units.length-1])}function Ku(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Ye{constructor(e){const t=e.zone||tn.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new ti("invalid input"):null)||(t.isValid?null:zl(t));this.ts=rt(e.ts)?tn.now():e.ts;let s=null,l=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[s,l]=[e.old.c,e.old.o];else{const r=t.offset(this.ts);s=Vu(this.ts,r),i=Number.isNaN(s.year)?new ti("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Rt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Ye({})}static local(){const[e,t]=Ku(arguments),[i,s,l,o,r,a,u]=t;return Wu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Ku(arguments),[i,s,l,o,r,a,u]=t;return e.zone=bn.utcInstance,Wu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=tv(e)?e.valueOf():NaN;if(Number.isNaN(i))return Ye.invalid("invalid input");const s=Fi(t.zone,tn.defaultZone);return s.isValid?new Ye({ts:i,zone:s,loc:Rt.fromObject(t)}):Ye.invalid(zl(s))}static fromMillis(e,t={}){if(ls(e))return e<-Hu||e>Hu?Ye.invalid("Timestamp out of range"):new Ye({ts:e,zone:Fi(t.zone,tn.defaultZone),loc:Rt.fromObject(t)});throw new Un(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ls(e))return new Ye({ts:e*1e3,zone:Fi(t.zone,tn.defaultZone),loc:Rt.fromObject(t)});throw new Un("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Fi(t.zone,tn.defaultZone);if(!i.isValid)return Ye.invalid(zl(i));const s=tn.now(),l=rt(t.specificOffset)?i.offset(s):t.specificOffset,o=yo(e,Uu),r=!rt(o.ordinal),a=!rt(o.year),u=!rt(o.month)||!rt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Rt.fromObject(t);if((f||r)&&c)throw new xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new xs("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let m,g,_=Vu(s,l);h?(m=Yy,g=Uy,_=Xr(_)):r?(m=Ky,g=Wy,_=cr(_)):(m=Ib,g=Ab);let y=!1;for(const D of m){const I=o[D];rt(I)?y?o[D]=g[D]:o[D]=_[D]:y=!0}const S=h?zy(o):r?By(o):Ob(o),C=S||Eb(o);if(C)return Ye.invalid(C);const T=h?qu(o):r?ju(o):o,[$,M]=fo(T,l,i),O=new Ye({ts:$,zone:i,o:M,loc:d});return o.weekday&&f&&e.weekday!==O.weekday?Ye.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${O.toISO()}`):O}static fromISO(e,t={}){const[i,s]=ry(e);return Us(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=ay(e);return Us(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=uy(e);return Us(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(rt(e)||rt(t))throw new Un("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=Vy(o,e,t);return f?Ye.invalid(f):Us(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Ye.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=gy(e);return Us(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Un("need to specify a reason the DateTime is invalid");const i=e instanceof ti?e:new ti(e,t);if(tn.throwOnInvalid)throw new G0(i);return new Ye({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?pr(this).weekYear:NaN}get weekNumber(){return this.isValid?pr(this).weekNumber:NaN}get weekday(){return this.isValid?pr(this).weekday:NaN}get ordinal(){return this.isValid?cr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Vl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Vl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Vl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Vl.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return $l(this.year)}get daysInMonth(){return bo(this.year,this.month)}get daysInYear(){return this.isValid?il(this.year):NaN}get weeksInWeekYear(){return this.isValid?vo(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=wn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(bn.instance(e),t)}toLocal(){return this.setZone(tn.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Fi(e,tn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let s=this.ts;if(t||i){const l=e.offset(this.ts),o=this.toObject();[s]=fo(o,l,e)}return Bs(this,{ts:s,zone:e})}else return Ye.invalid(zl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Bs(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=yo(e,Uu),i=!rt(t.weekYear)||!rt(t.weekNumber)||!rt(t.weekday),s=!rt(t.ordinal),l=!rt(t.year),o=!rt(t.month)||!rt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new xs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new xs("Can't mix ordinal dates with month/day");let u;i?u=qu({...Xr(this.c),...t}):rt(t.ordinal)?(u={...this.toObject(),...t},rt(t.day)&&(u.day=Math.min(bo(u.year,u.month),u.day))):u=ju({...cr(this.c),...t});const[f,c]=fo(u,this.o,this.zone);return Bs(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=ct.fromDurationLike(e);return Bs(this,zu(this,t))}minus(e){if(!this.isValid)return this;const t=ct.fromDurationLike(e).negate();return Bs(this,zu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=ct.normalizeUnit(e);switch(i){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0;break}if(i==="weeks"&&(t.weekday=1),i==="quarters"){const s=Math.ceil(this.month/3);t.month=(s-1)*3+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?wn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):dr}toLocaleString(e=Wr,t={}){return this.isValid?wn.create(this.loc.clone(t),e).formatDateTime(this):dr}toLocaleParts(e={}){return this.isValid?wn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=hr(this,o);return r+="T",r+=Bu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?hr(this,e==="extended"):null}toISOWeekDate(){return Bl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:s=!1,extendedZone:l=!1,format:o="extended"}={}){return this.isValid?(s?"T":"")+Bu(this,o==="extended",t,e,i,l):null}toRFC2822(){return Bl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Bl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?hr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),Bl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():dr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return ct.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=nv(t).map(ct.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Cy(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Ye.now(),e,t)}until(e){return this.isValid?Ht.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ye.fromObject({},{zone:this.zone}),i=e.padding?thist.valueOf(),Math.min)}static max(...e){if(!e.every(Ye.isDateTime))throw new Un("max requires all arguments be DateTimes");return Tu(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return wb(o,e,t)}static fromStringExplain(e,t,i={}){return Ye.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Wr}static get DATE_MED(){return R_}static get DATE_MED_WITH_WEEKDAY(){return Q0}static get DATE_FULL(){return q_}static get DATE_HUGE(){return j_}static get TIME_SIMPLE(){return H_}static get TIME_WITH_SECONDS(){return V_}static get TIME_WITH_SHORT_OFFSET(){return z_}static get TIME_WITH_LONG_OFFSET(){return B_}static get TIME_24_SIMPLE(){return U_}static get TIME_24_WITH_SECONDS(){return W_}static get TIME_24_WITH_SHORT_OFFSET(){return Y_}static get TIME_24_WITH_LONG_OFFSET(){return K_}static get DATETIME_SHORT(){return J_}static get DATETIME_SHORT_WITH_SECONDS(){return G_}static get DATETIME_MED(){return Z_}static get DATETIME_MED_WITH_SECONDS(){return X_}static get DATETIME_MED_WITH_WEEKDAY(){return x0}static get DATETIME_FULL(){return Q_}static get DATETIME_FULL_WITH_SECONDS(){return x_}static get DATETIME_HUGE(){return eb}static get DATETIME_HUGE_WITH_SECONDS(){return tb}}function Ws(n){if(Ye.isDateTime(n))return n;if(n&&n.valueOf&&ls(n.valueOf()))return Ye.fromJSDate(n);if(n&&typeof n=="object")return Ye.fromObject(n);throw new Un(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const Jy=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],Gy=[".mp4",".avi",".mov",".3gp",".wmv"],Zy=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],Xy=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01 00:00:00.000Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||j.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||(e==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=j.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!j.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=(t||"").split(i),o=l.pop();for(const r of l)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):j.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||j.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,l.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let s="";for(let l=0;ll.replaceAll("{_PB_ESCAPED_}",t));for(let l of s)l=l.trim(),j.isEmpty(l)||i.push(l);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],s=t.length>1?t.trim():t;for(let l of e)l=typeof l=="string"?l.trim():"",j.isEmpty(l)||i.push(l.replaceAll(s,"\\"+s));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return Ye.fromFormat(e,i,{zone:"UTC"})}return Ye.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.click(),i.remove()}static downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2));t=t.endsWith(".json")?t:t+".json",j.download(i,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!Jy.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!Gy.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!Zy.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!Xy.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(s=>{let l=new FileReader;l.onload=function(o){let r=new Image;r.onload=function(){let a=document.createElement("canvas"),u=a.getContext("2d"),f=r.width,c=r.height;return a.width=t,a.height=i,u.drawImage(r,f>c?(f-c)/2:0,0,f>c?c:f,f>c?c:f,0,0,t,i),s(a.toDataURL(e.type))},r.src=o.target.result},l.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)j.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,h,m;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",s=(e==null?void 0:e.type)==="view",l={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(l.username="username123",l.verified=!1,l.emailVisibility=!0,l.email="test@example.com"),(!s||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(l.created="2022-01-01 01:00:00.123Z"),(!s||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(l.updated="2022-01-01 23:59:59.456Z");for(const g of t){let _=null;g.type==="number"?_=123:g.type==="date"?_="2022-01-01 10:00:00.123Z":g.type==="bool"?_=!0:g.type==="email"?_="test@example.com":g.type==="url"?_="https://example.com":g.type==="json"?_="JSON":g.type==="file"?(_="filename.jpg",((f=g.options)==null?void 0:f.maxSelect)!==1&&(_=[_])):g.type==="select"?(_=(d=(c=g.options)==null?void 0:c.values)==null?void 0:d[0],((h=g.options)==null?void 0:h.maxSelect)!==1&&(_=[_])):g.type==="relation"?(_="RELATION_RECORD_ID",((m=g.options)==null?void 0:m.maxSelect)!==1&&(_=[_])):_="test",l[g.name]=_}return l}static dummyCollectionSchemaData(e){var s,l,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(l=(s=a.options)==null?void 0:s.values)==null?void 0:l[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=j.isObject(u)&&j.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],s=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):s.push(o);function l(o,r){return o.name>r.name?1:o.name{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(s){let l=s.parentNode;for(;s.firstChild;)l.insertBefore(s.firstChild,s);l.removeChild(s)}function i(s){if(s){for(const l of s.children)i(l);e.includes(s.tagName)?(s.removeAttribute("style"),s.removeAttribute("class")):t(s)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(s,l)=>{i(l.node)},file_picker_types:"image",file_picker_callback:(s,l,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,h=f.result.split(",")[1],m=d.create(c,u,h);d.add(m),s(m.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:s=>{s.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&s.formElement&&(o.preventDefault(),o.stopPropagation(),s.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const l="tinymce_last_direction";s.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(l);!s.isDirty()&&s.getContent()==""&&o=="rtl"&&s.execCommand("mceDirectionRTL")}),s.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"ltr"),s.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(l,"rtl"),s.execCommand("mceDirectionRTL")}}])}}),s.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{s.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{s.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let s=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),s.push(r))}if(s.length>0)return s.join(", ");const l=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of l){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A"){if(j.isEmpty(e))return t;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e)||t;if(Array.isArray(e))return e.join(",");if(typeof e=="object")try{return j.truncate(JSON.stringify(e))||t}catch{return t}return""+e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),s=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],l=[];for(let r of s){const a=r.trim().split(" ").pop();a!=""&&a!=t&&l.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return l}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let l of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+l);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const s=e.schema||[];for(const l of s)j.pushUnique(i,t+l.name);return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},s=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((s==null?void 0:s.length)!=7)return t;const l=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=s[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=s[2])==null?void 0:u.trim());const o=(s[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(l,""),t.indexName=o[1].replace(l,"")):(t.schemaName="",t.indexName=o[0].replace(l,"")),t.tableName=(s[4]||"").replace(l,"");const r=(s[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let h of r){h=h.trim().replaceAll("{PB_TEMP}",",");const g=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(h);if((g==null?void 0:g.length)!=4)continue;const _=(c=(f=g[1])==null?void 0:f.trim())==null?void 0:c.replace(l,"");_&&t.columns.push({name:_,collate:g[2]||"",sort:((d=g[3])==null?void 0:d.toUpperCase())||""})}return t.where=s[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(s=>!!(s!=null&&s.name));return i.length>1&&(t+=` - `),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`, - `),i.length>1&&(t+=` -`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=j.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?j.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const s=i.indexOf("?");s>-1&&(t=i.substring(s+1),i=i.substring(0,s));const l=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?l.delete(a):l.set(a,u)}t=l.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Wo=Ln([]);function ko(n,e=4e3){return Yo(n,"info",e)}function zt(n,e=3e3){return Yo(n,"success",e)}function Ci(n,e=4500){return Yo(n,"error",e)}function Qy(n,e=4500){return Yo(n,"warning",e)}function Yo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Lb(i)},t)};Wo.update(s=>(Pa(s,i.message),j.pushOrReplaceByKey(s,i,"message"),s))}function Lb(n){Wo.update(e=>(Pa(e,n),e))}function La(){Wo.update(n=>{for(let e of n)Pa(n,e);return[]})}function Pa(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const Mi=Ln({});function on(n){Mi.set(n||{})}function pi(n){Mi.update(e=>(j.deleteByPath(e,n),e))}const Na=Ln({});function Qr(n){Na.set(n||{})}const Zn=Ln([]),hi=Ln({}),wo=Ln(!1),Pb=Ln({});function xy(n){Zn.update(e=>{const t=j.findByKey(e,"id",n);return t?hi.set(t):e.length&&hi.set(e[0]),e})}function ek(n){hi.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Zn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Fa(),j.sortCollections(e)))}function tk(n){Zn.update(e=>(j.removeByKey(e,"id",n.id),hi.update(t=>t.id===n.id?e[0]:t),Fa(),e))}async function nk(n=null){wo.set(!0);try{let e=await ce.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Zn.set(e);const t=n&&j.findByKey(e,"id",n);t?hi.set(t):e.length&&hi.set(e[0]),Fa()}catch(e){ce.error(e)}wo.set(!1)}function Fa(){Pb.update(n=>(Zn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const mr="pb_admin_file_token";Vo.prototype.logout=function(n=!0){this.authStore.clear(),n&&us("/login")};Vo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Ci(l),j.isEmpty(s.data)||on(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),us("/")};Vo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=u0(Pb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(mr)||"";return(!t||Sa(t,10))&&(t&&localStorage.removeItem(mr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(mr,t),this._adminFileTokenRequest=null),t};class ik extends P_{save(e,t){super.save(e,t),t&&!t.collectionId&&Qr(t)}clear(){super.clear(),Qr(null)}}const ce=new Vo("../",new ik("pb_admin_auth"));ce.authStore.model&&!ce.authStore.model.collectionId&&Qr(ce.authStore.model);const sk=n=>({}),Ju=n=>({});function lk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;const m=n[3].default,g=Tt(m,n,n[2],null),_=n[3].footer,y=Tt(_,n,n[2],Ju);return{c(){e=v("div"),t=v("main"),g&&g.c(),i=E(),s=v("footer"),y&&y.c(),l=E(),o=v("a"),o.innerHTML=' Docs',r=E(),a=v("span"),a.textContent="|",u=E(),f=v("a"),c=v("span"),c.textContent="PocketBase v0.20.0-rc3",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(s,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(S,C){w(S,e,C),b(e,t),g&&g.m(t,null),b(e,i),b(e,s),y&&y.m(s,null),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(s,f),b(f,c),h=!0},p(S,[C]){g&&g.p&&(!h||C&4)&&$t(g,m,S,S[2],h?Ct(m,S[2],C,null):Mt(S[2]),null),y&&y.p&&(!h||C&4)&&$t(y,_,S,S[2],h?Ct(_,S[2],C,sk):Mt(S[2]),Ju),(!h||C&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!h||C&3)&&Q(e,"center-content",S[0])},i(S){h||(A(g,S),A(y,S),h=!0)},o(S){L(g,S),L(y,S),h=!1},d(S){S&&k(e),g&&g.d(S),y&&y.d(S)}}}function ok(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Tn extends be{constructor(e){super(),_e(this,e,ok,lk,me,{center:0,class:1})}}function Gu(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',t=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function rk(n){let e,t,i,s=!n[0]&&Gu();const l=n[1].default,o=Tt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Gu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&$t(o,l,r,r[2],i?Ct(l,r[2],a,null):Mt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function ak(n){let e,t;return e=new Tn({props:{class:"full-page",center:!0,$$slots:{default:[rk]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function uk(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Nb extends be{constructor(e){super(),_e(this,e,uk,ak,me,{nobranding:0})}}function Ko(n){const e=n-1;return e*e*e+1}function hl(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function mi(n,{delay:e=0,duration:t=400,easing:i=Ko,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=pu(s),[h,m]=pu(l);return{delay:e,duration:t,easing:i,css:(g,_)=>` - transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*h}${m}); - opacity: ${a-f*_}`}}function lt(n,{delay:e=0,duration:t=400,easing:i=Ko,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),h=parseFloat(l[`margin${f[0]}`]),m=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*h}px;margin-${u[1]}: ${y*m}px;border-${u[0]}-width: ${y*g}px;border-${u[1]}-width: ${y*_}px;`}}function Qt(n,{delay:e=0,duration:t=400,easing:i=Ko,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>` - transform: ${a} scale(${1-u*d}); - opacity: ${r-f*d} - `}}let xr,Gi;const ea="app-tooltip";function Zu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Hi(){return Gi=Gi||document.querySelector("."+ea),Gi||(Gi=document.createElement("div"),Gi.classList.add(ea),document.body.appendChild(Gi)),Gi}function Fb(n,e){let t=Hi();if(!t.classList.contains("active")||!(e!=null&&e.text)){ta();return}t.textContent=e.text,t.className=ea+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function ta(){clearTimeout(xr),Hi().classList.remove("active"),Hi().activeNode=void 0}function fk(n,e){Hi().activeNode=n,clearTimeout(xr),xr=setTimeout(()=>{Hi().classList.add("active"),Fb(n,e)},isNaN(e.delay)?0:e.delay)}function Be(n,e){let t=Zu(e);function i(){fk(n,t)}function s(){ta()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",s),Hi(),{update(l){var o,r;t=Zu(l),(r=(o=Hi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Fb(n,t)},destroy(){var l,o;(o=(l=Hi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ta(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Xu(n,e,t){const i=n.slice();return i[12]=e[t],i}const ck=n=>({}),Qu=n=>({uniqueId:n[4]});function dk(n){let e,t,i=pe(n[3]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{l&&(s||(s=He(t,Qt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=He(t,Qt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function xu(n){let e,t,i=So(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=W(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=So(a[12])+"")&&le(s,i)},i(a){r||(a&&xe(()=>{r&&(o||(o=He(e,lt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=He(e,lt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function hk(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Tt(a,n,n[8],Qu),f=[pk,dk],c=[];function d(h,m){return h[0]&&h[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(h,m){w(h,e,m),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(h,[m]){u&&u.p&&(!l||m&256)&&$t(u,a,h,h[8],l?Ct(a,h[8],m,ck):Mt(h[8]),Qu);let g=i;i=d(h),i===g?c[i].p(h,m):(re(),L(c[g],1,1,()=>{c[g]=null}),ae(),s=c[i],s?s.p(h,m):(s=c[i]=f[i](h),s.c()),A(s,1),s.m(e,null)),(!l||m&2)&&p(e,"class",h[1]),(!l||m&10)&&Q(e,"error",h[3].length)},i(h){l||(A(u,h),A(s),l=!0)},o(h){L(u,h),L(s),l=!1},d(h){h&&k(e),u&&u.d(h),c[i].d(),n[11](null),o=!1,r()}}}const ef="Invalid value";function So(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||ef:n||ef}function mk(n,e,t){let i;Ge(n,Mi,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){pi(r)}Kt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function h(g){Re.call(this,n,g)}function m(g){te[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,h,m]}class ge extends be{constructor(e){super(),_e(this,e,mk,hk,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function gk(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Email"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&de(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function _k(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Password"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[1]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&de(l,c[1])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function bk(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Password confirm"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&de(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function vk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new ge({props:{class:"form-field required",name:"email",$$slots:{default:[gk,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field required",name:"password",$$slots:{default:[_k,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),a=new ge({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[bk,({uniqueId:m})=>({9:m}),({uniqueId:m})=>m?512:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Create your first admin account in order to continue

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("button"),f.innerHTML='Create and login ',p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(m,g){w(m,e,g),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),H(a,e,null),b(e,u),b(e,f),c=!0,d||(h=Y(e,"submit",Ze(n[4])),d=!0)},p(m,[g]){const _={};g&1537&&(_.$$scope={dirty:g,ctx:m}),s.$set(_);const y={};g&1538&&(y.$$scope={dirty:g,ctx:m}),o.$set(y);const S={};g&1540&&(S.$$scope={dirty:g,ctx:m}),a.$set(S),(!c||g&8)&&Q(f,"btn-disabled",m[3]),(!c||g&8)&&Q(f,"btn-loading",m[3])},i(m){c||(A(s.$$.fragment,m),A(o.$$.fragment,m),A(a.$$.fragment,m),c=!0)},o(m){L(s.$$.fragment,m),L(o.$$.fragment,m),L(a.$$.fragment,m),c=!1},d(m){m&&k(e),V(s),V(o),V(a),d=!1,h()}}}function yk(n,e,t){const i=pt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ce.admins.create({email:s,password:l,passwordConfirm:o}),await ce.admins.authWithPassword(s,l),i("submit")}catch(d){ce.error(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class kk extends be{constructor(e){super(),_e(this,e,yk,vk,me,{})}}function tf(n){let e,t;return e=new Nb({props:{$$slots:{default:[wk]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function wk(n){let e,t;return e=new kk({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Sk(n){let e,t,i=n[0]&&tf(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=tf(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),L(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function Tk(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ce.logout(!1),t(0,i=!0);return}ce.authStore.isValid?us("/collections"):ce.logout()}return[i,async()=>{t(0,i=!1),await ln(),window.location.search=""}]}class Ck extends be{constructor(e){super(),_e(this,e,Tk,Sk,me,{})}}const Ft=Ln(""),To=Ln(""),Es=Ln(!1);function $k(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),de(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&de(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function Mk(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=Nt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){re();const f=e;L(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Nt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ve(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function nf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Search',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,mi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function sf(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[15]),s=!0)},p:x,i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,mi,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Ok(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[Mk,$k],h=[];function m(y,S){return y[4]&&!y[5]?0:1}l=m(n),o=h[l]=d[l](n);let g=(n[0].length||n[7].length)&&n[7]!=n[0]&&nf(),_=(n[0].length||n[7].length)&&sf(n);return{c(){e=v("form"),t=v("label"),i=v("i"),s=E(),o.c(),r=E(),g&&g.c(),a=E(),_&&_.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),b(e,t),b(t,i),b(e,s),h[l].m(e,null),b(e,r),g&&g.m(e,null),b(e,a),_&&_.m(e,null),u=!0,f||(c=[Y(e,"click",Sn(n[11])),Y(e,"submit",Ze(n[10]))],f=!0)},p(y,[S]){let C=l;l=m(y),l===C?h[l].p(y,S):(re(),L(h[C],1,1,()=>{h[C]=null}),ae(),o=h[l],o?o.p(y,S):(o=h[l]=d[l](y),o.c()),A(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?g?S&129&&A(g,1):(g=nf(),g.c(),A(g,1),g.m(e,a)):g&&(re(),L(g,1,1,()=>{g=null}),ae()),y[0].length||y[7].length?_?(_.p(y,S),S&129&&A(_,1)):(_=sf(y),_.c(),A(_,1),_.m(e,null)):_&&(re(),L(_,1,1,()=>{_=null}),ae())},i(y){u||(A(o),A(g),A(_),u=!0)},o(y){L(o),L(g),L(_),u=!1},d(y){y&&k(e),h[l].d(),g&&g.d(),_&&_.d(),f=!1,$e(c)}}}function Ek(n,e,t){const i=pt(),s="search_"+j.randomString(7);let{value:l=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h($=!0){t(7,d=""),$&&(c==null||c.focus()),i("clear")}function m(){t(0,l=d),i("submit",l)}async function g(){u||f||(t(5,f=!0),t(4,u=(await ft(()=>import("./FilterAutocompleteInput-288f3849.js"),["./FilterAutocompleteInput-288f3849.js","./index-30dee195.js"],import.meta.url)).default),t(5,f=!1))}Kt(()=>{g()});function _($){Re.call(this,n,$)}function y($){d=$,t(7,d),t(0,l)}function S($){te[$?"unshift":"push"](()=>{c=$,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const T=()=>{h(!1),m()};return n.$$set=$=>{"value"in $&&t(0,l=$.value),"placeholder"in $&&t(1,o=$.placeholder),"autocompleteCollection"in $&&t(2,r=$.autocompleteCollection),"extraAutocompleteKeys"in $&&t(3,a=$.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,m,_,y,S,C,T]}class Dl extends be{constructor(e){super(),_e(this,e,Ek,Ok,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Dk(n){let e,t,i,s,l,o;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),Q(e,"refreshing",n[2])},m(r,a){w(r,e,a),b(e,t),l||(o=[Ce(s=Be.call(null,e,n[0])),Y(e,"click",n[3])],l=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),s&&Et(s.update)&&a&1&&s.update.call(null,r[0]),a&6&&Q(e,"refreshing",r[2])},i:x,o:x,d(r){r&&k(e),l=!1,$e(o)}}}function Ak(n,e,t){const i=pt();let{tooltip:s={text:"Refresh",position:"right"}}=e,{class:l=""}=e,o=null;function r(){i("refresh");const a=s;t(0,s=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,s=a)},150))}return Kt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,s=a.tooltip),"class"in a&&t(1,l=a.class)},[s,l,o,r]}class Jo extends be{constructor(e){super(),_e(this,e,Ak,Dk,me,{tooltip:0,class:1})}}function Ik(n){let e,t,i,s,l;const o=n[6].default,r=Tt(o,n,n[5],null);return{c(){e=v("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),Q(e,"col-sort-disabled",n[3]),Q(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),Q(e,"sort-desc",n[0]==="-"+n[2]),Q(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"click",n[7]),Y(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&$t(r,o,a,a[5],i?Ct(o,a[5],u,null):Mt(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&Q(e,"col-sort-disabled",a[3]),(!i||u&7)&&Q(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&Q(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&Q(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function Lk(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{name:o}=e,{sort:r=""}=e,{disable:a=!1}=e;function u(){a||("-"+o===r?t(0,r="+"+o):t(0,r="-"+o))}const f=()=>u(),c=d=>{(d.code==="Enter"||d.code==="Space")&&(d.preventDefault(),u())};return n.$$set=d=>{"class"in d&&t(1,l=d.class),"name"in d&&t(2,o=d.name),"sort"in d&&t(0,r=d.sort),"disable"in d&&t(3,a=d.disable),"$$scope"in d&&t(5,s=d.$$scope)},[r,l,o,a,u,s,i,f,c]}class hn extends be{constructor(e){super(),_e(this,e,Lk,Ik,me,{class:1,name:2,sort:0,disable:3})}}function Pk(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Nk(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("div"),t=v("div"),i=W(n[2]),s=E(),l=v("div"),o=W(n[1]),r=W(" UTC"),p(t,"class","date"),p(l,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(l,r),a||(u=Ce(Be.call(null,e,n[3])),a=!0)},p(f,c){c&4&&le(i,f[2]),c&2&&le(o,f[1])},d(f){f&&k(e),a=!1,u()}}}function Fk(n){let e;function t(l,o){return l[0]?Nk:Pk}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function Rk(n,e,t){let i,s,{date:l=""}=e;const o={get text(){return j.formatToLocalDate(l)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,l=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=l?l.substring(0,10):null),n.$$.dirty&1&&t(1,s=l?l.substring(10,19):null)},[l,s,i,o]}class $i extends be{constructor(e){super(),_e(this,e,Rk,Fk,me,{date:0})}}const qk=n=>({}),lf=n=>({}),jk=n=>({}),of=n=>({});function Hk(n){let e,t,i,s,l,o,r,a;const u=n[11].before,f=Tt(u,n,n[10],of),c=n[11].default,d=Tt(c,n,n[10],null),h=n[11].after,m=Tt(h,n,n[10],lf);return{c(){e=v("div"),f&&f.c(),t=E(),i=v("div"),d&&d.c(),l=E(),m&&m.c(),p(i,"class",s="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(g,_){w(g,e,_),f&&f.m(e,null),b(e,t),b(e,i),d&&d.m(i,null),n[12](i),b(e,l),m&&m.m(e,null),o=!0,r||(a=[Y(window,"resize",n[1]),Y(i,"scroll",n[1])],r=!0)},p(g,[_]){f&&f.p&&(!o||_&1024)&&$t(f,u,g,g[10],o?Ct(u,g[10],_,jk):Mt(g[10]),of),d&&d.p&&(!o||_&1024)&&$t(d,c,g,g[10],o?Ct(c,g[10],_,null):Mt(g[10]),null),(!o||_&9&&s!==(s="scroller "+g[0]+" "+g[3]+" svelte-3a0gfs"))&&p(i,"class",s),m&&m.p&&(!o||_&1024)&&$t(m,h,g,g[10],o?Ct(h,g[10],_,qk):Mt(g[10]),lf)},i(g){o||(A(f,g),A(d,g),A(m,g),o=!0)},o(g){L(f,g),L(d,g),L(m,g),o=!1},d(g){g&&k(e),f&&f.d(g),d&&d.d(g),n[12](null),m&&m.d(g),r=!1,$e(a)}}}function Vk(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,h,m,g,_,y;function S(){f&&t(2,f.scrollTop=0,f)}function C(){f&&t(2,f.scrollLeft=0,f)}function T(){f&&(t(3,c=""),g=f.clientWidth+2,_=f.clientHeight+2,h=f.scrollWidth-g,m=f.scrollHeight-_,m>0?(t(3,c+=" v-scroll"),r>=_&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),l("vScrollStart")),f.scrollTop+r>=m&&(t(3,c+=" v-scroll-end"),l("vScrollEnd"))):u&&l("vScrollEnd"),h>0?(t(3,c+=" h-scroll"),a>=g&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),l("hScrollStart")),f.scrollLeft+a>=h&&(t(3,c+=" h-scroll-end"),l("hScrollEnd"))):u&&l("hScrollEnd"))}function $(){d||(d=setTimeout(()=>{T(),d=null},150))}Kt(()=>($(),y=new MutationObserver($),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function M(O){te[O?"unshift":"push"](()=>{f=O,t(2,f)})}return n.$$set=O=>{"class"in O&&t(0,o=O.class),"vThreshold"in O&&t(4,r=O.vThreshold),"hThreshold"in O&&t(5,a=O.hThreshold),"dispatchOnNoScroll"in O&&t(6,u=O.dispatchOnNoScroll),"$$scope"in O&&t(10,s=O.$$scope)},[o,$,f,c,r,a,u,S,C,T,s,i,M]}class Go extends be{constructor(e){super(),_e(this,e,Vk,Hk,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function rf(n,e,t){const i=n.slice();return i[23]=e[t],i}function zk(n){let e;return{c(){e=v("div"),e.innerHTML=' Method',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Bk(n){let e;return{c(){e=v("div"),e.innerHTML=` URL`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Uk(n){let e;return{c(){e=v("div"),e.innerHTML=` Referer`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Wk(n){let e;return{c(){e=v("div"),e.innerHTML=` User IP`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Yk(n){let e;return{c(){e=v("div"),e.innerHTML=` Status`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Kk(n){let e;return{c(){e=v("div"),e.innerHTML=` Created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function af(n){let e;function t(l,o){return l[6]?Gk:Jk}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function Jk(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&uf(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=uf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Gk(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function uf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function ff(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function cf(n,e){var Me,Je,dt;let t,i,s,l=((Me=e[23].method)==null?void 0:Me.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,h,m,g,_,y,S=(e[23].referer||"N/A")+"",C,T,$,M,O,D=(e[23].userIp||"N/A")+"",I,N,P,F,R,q=e[23].status+"",B,Z,X,J,U,oe,ee,se,Ee,qe,Ve=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((dt=e[23].meta)==null?void 0:dt.errorData))&&ff();J=new $i({props:{date:e[23].created}});function We(){return e[17](e[23])}function ke(...Se){return e[18](e[23],...Se)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=W(l),a=E(),u=v("td"),f=v("span"),d=W(c),m=E(),Ve&&Ve.c(),g=E(),_=v("td"),y=v("span"),C=W(S),$=E(),M=v("td"),O=v("span"),I=W(D),P=E(),F=v("td"),R=v("span"),B=W(q),Z=E(),X=v("td"),z(J.$$.fragment),U=E(),oe=v("td"),oe.innerHTML='',ee=E(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",T=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(_,"class","col-type-text col-field-referer"),p(O,"class","txt txt-ellipsis"),p(O,"title",N=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),p(M,"class","col-type-number col-field-userIp"),p(R,"class","label"),Q(R,"label-danger",e[23].status>=400),p(F,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(oe,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Se,we){w(Se,t,we),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,m),Ve&&Ve.m(u,null),b(t,g),b(t,_),b(_,y),b(y,C),b(t,$),b(t,M),b(M,O),b(O,I),b(t,P),b(t,F),b(F,R),b(R,B),b(t,Z),b(t,X),H(J,X,null),b(t,U),b(t,oe),b(t,ee),se=!0,Ee||(qe=[Y(t,"click",We),Y(t,"keydown",ke)],Ee=!0)},p(Se,we){var nt,ne,Ne;e=Se,(!se||we&8)&&l!==(l=((nt=e[23].method)==null?void 0:nt.toUpperCase())+"")&&le(o,l),(!se||we&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!se||we&8)&&c!==(c=e[23].url+"")&&le(d,c),(!se||we&8&&h!==(h=e[23].url))&&p(f,"title",h),(ne=e[23].meta)!=null&&ne.errorMessage||(Ne=e[23].meta)!=null&&Ne.errorData?Ve||(Ve=ff(),Ve.c(),Ve.m(u,null)):Ve&&(Ve.d(1),Ve=null),(!se||we&8)&&S!==(S=(e[23].referer||"N/A")+"")&&le(C,S),(!se||we&8&&T!==(T=e[23].referer))&&p(y,"title",T),(!se||we&8)&&Q(y,"txt-hint",!e[23].referer),(!se||we&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&le(I,D),(!se||we&8&&N!==(N=e[23].userIp))&&p(O,"title",N),(!se||we&8)&&Q(O,"txt-hint",!e[23].userIp),(!se||we&8)&&q!==(q=e[23].status+"")&&le(B,q),(!se||we&8)&&Q(R,"label-danger",e[23].status>=400);const Ue={};we&8&&(Ue.date=e[23].created),J.$set(Ue)},i(Se){se||(A(J.$$.fragment,Se),se=!0)},o(Se){L(J.$$.fragment,Se),se=!1},d(Se){Se&&k(t),Ve&&Ve.d(),V(J),Ee=!1,$e(qe)}}}function Zk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O,D,I=[],N=new Map,P;function F(ke){n[11](ke)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[zk]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new hn({props:R}),te.push(()=>he(s,"sort",F));function q(ke){n[12](ke)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Bk]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new hn({props:B}),te.push(()=>he(r,"sort",q));function Z(ke){n[13](ke)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Uk]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new hn({props:X}),te.push(()=>he(f,"sort",Z));function J(ke){n[14](ke)}let U={disable:!0,class:"col-type-number col-field-userIp",name:"userIp",$$slots:{default:[Wk]},$$scope:{ctx:n}};n[1]!==void 0&&(U.sort=n[1]),h=new hn({props:U}),te.push(()=>he(h,"sort",J));function oe(ke){n[15](ke)}let ee={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Yk]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),_=new hn({props:ee}),te.push(()=>he(_,"sort",oe));function se(ke){n[16](ke)}let Ee={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Kk]},$$scope:{ctx:n}};n[1]!==void 0&&(Ee.sort=n[1]),C=new hn({props:Ee}),te.push(()=>he(C,"sort",se));let qe=pe(n[3]);const Ve=ke=>ke[23].id;for(let ke=0;kel=!1)),s.$set(Je);const dt={};Me&67108864&&(dt.$$scope={dirty:Me,ctx:ke}),!a&&Me&2&&(a=!0,dt.sort=ke[1],ve(()=>a=!1)),r.$set(dt);const Se={};Me&67108864&&(Se.$$scope={dirty:Me,ctx:ke}),!c&&Me&2&&(c=!0,Se.sort=ke[1],ve(()=>c=!1)),f.$set(Se);const we={};Me&67108864&&(we.$$scope={dirty:Me,ctx:ke}),!m&&Me&2&&(m=!0,we.sort=ke[1],ve(()=>m=!1)),h.$set(we);const Ue={};Me&67108864&&(Ue.$$scope={dirty:Me,ctx:ke}),!y&&Me&2&&(y=!0,Ue.sort=ke[1],ve(()=>y=!1)),_.$set(Ue);const nt={};Me&67108864&&(nt.$$scope={dirty:Me,ctx:ke}),!T&&Me&2&&(T=!0,nt.sort=ke[1],ve(()=>T=!1)),C.$set(nt),Me&841&&(qe=pe(ke[3]),re(),I=gt(I,Me,Ve,1,ke,qe,N,D,qt,cf,null,rf),ae(),!qe.length&&We?We.p(ke,Me):qe.length?We&&(We.d(1),We=null):(We=af(ke),We.c(),We.m(D,null))),(!P||Me&64)&&Q(e,"table-loading",ke[6])},i(ke){if(!P){A(s.$$.fragment,ke),A(r.$$.fragment,ke),A(f.$$.fragment,ke),A(h.$$.fragment,ke),A(_.$$.fragment,ke),A(C.$$.fragment,ke);for(let Me=0;Me{if(N<=1&&g(),t(6,d=!1),t(5,f=F.page),t(4,c=F.totalItems),s("load",u.concat(F.items)),P){const R=++h;for(;F.items.length&&h==R;)t(3,u=u.concat(F.items.splice(0,10))),await j.yieldToMain()}else t(3,u=u.concat(F.items))}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),g(),ce.error(F,(F==null?void 0:F.status)!=400))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function _(N){a=N,t(1,a)}function y(N){a=N,t(1,a)}function S(N){a=N,t(1,a)}function C(N){a=N,t(1,a)}function T(N){a=N,t(1,a)}function $(N){a=N,t(1,a)}const M=N=>s("select",N),O=(N,P)=>{P.code==="Enter"&&(P.preventDefault(),s("select",N))},D=()=>t(0,o=""),I=()=>m(f+1);return n.$$set=N=>{"filter"in N&&t(0,o=N.filter),"presets"in N&&t(10,r=N.presets),"sort"in N&&t(1,a=N.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),m(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,m,u,c,f,d,i,s,l,r,_,y,S,C,T,$,M,O,D,I]}class xk extends be{constructor(e){super(),_e(this,e,Qk,Xk,me,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*! - * Chart.js v3.9.1 - * https://www.chartjs.org - * (c) 2022 Chart.js Contributors - * Released under the MIT License - */function bi(){}const e2=function(){let n=0;return function(){return n++}}();function bt(n){return n===null||typeof n>"u"}function Pt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function st(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Yt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Hn(n,e){return Yt(n)?n:e}function at(n,e){return typeof n>"u"?e:n}const t2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Rb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function kt(n,e,t,i){let s,l,o;if(Pt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;sn,x:n=>n.x,y:n=>n.y};function zi(n,e){return(hf[e]||(hf[e]=s2(e)))(n)}function s2(n){const e=l2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function l2(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Ra(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Jn=n=>typeof n<"u",Bi=n=>typeof n=="function",mf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function o2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,wt=2*Ut,r2=wt+Ut,Mo=Number.POSITIVE_INFINITY,a2=Ut/180,Bt=Ut/2,Ys=Ut/4,gf=Ut*2/3,Wn=Math.log10,ci=Math.sign;function _f(n){const e=Math.round(n);n=ol(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Wn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function u2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;is-l).pop(),e}function Ds(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ol(n,e,t){return Math.abs(n-e)=n}function jb(n,e,t){let i,s,l;for(i=0,s=n.length;ia&&u=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ja(n,e,t){t=t||(o=>n[o]1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const is=(n,e,t,i)=>ja(n,t,i?s=>n[s][e]<=t:s=>n[s][e]ja(n,t,i=>n[i][e]>=t);function h2(n,e,t){let i=0,s=n.length;for(;ii&&n[s-1]>t;)s--;return i>0||s{const i="_onData"+Ra(t),s=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...l){const o=s.apply(this,l);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...l)}),o}})})}function vf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,s=i.indexOf(e);s!==-1&&i.splice(s,1),!(i.length>0)&&(Vb.forEach(l=>{delete n[l]}),delete n._chartjs)}function zb(n){const e=new Set;let t,i;for(t=0,i=n.length;t"u"?function(n){return n()}:window.requestAnimationFrame}();function Ub(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,Bb.call(window,()=>{s=!1,n.apply(e,l)}))}}function g2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const _2=n=>n==="start"?"left":n==="end"?"right":"center",yf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Wb(n,e,t){const i=e.length;let s=0,l=i;if(n._sorted){const{iScale:o,_parsed:r}=n,a=o.axis,{min:u,max:f,minDefined:c,maxDefined:d}=o.getUserBounds();c&&(s=mn(Math.min(is(r,o.axis,u).lo,t?i:is(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=mn(Math.max(is(r,o.axis,f,!0).hi+1,t?0:is(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Yb(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const Ul=n=>n===0||n===1,kf=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*wt/t)),wf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*wt/t)+1,rl={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Bt)+1,easeOutSine:n=>Math.sin(n*Bt),easeInOutSine:n=>-.5*(Math.cos(Ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ul(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ul(n)?n:kf(n,.075,.3),easeOutElastic:n=>Ul(n)?n:wf(n,.075,.3),easeInOutElastic(n){return Ul(n)?n:n<.5?.5*kf(n*2,.1125,.45):.5+.5*wf(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-rl.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?rl.easeInBounce(n*2)*.5:rl.easeOutBounce(n*2-1)*.5+.5};/*! - * @kurkle/color v0.2.1 - * https://github.com/kurkle/color#readme - * (c) 2022 Jukka Kurkela - * Released under the MIT License - */function Al(n){return n+.5|0}const Ri=(n,e,t)=>Math.max(Math.min(n,t),e);function tl(n){return Ri(Al(n*2.55),0,255)}function Vi(n){return Ri(Al(n*255),0,255)}function ki(n){return Ri(Al(n/2.55)/100,0,1)}function Sf(n){return Ri(Al(n*100),0,100)}const jn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ia=[..."0123456789ABCDEF"],b2=n=>ia[n&15],v2=n=>ia[(n&240)>>4]+ia[n&15],Wl=n=>(n&240)>>4===(n&15),y2=n=>Wl(n.r)&&Wl(n.g)&&Wl(n.b)&&Wl(n.a);function k2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&jn[n[1]]*17,g:255&jn[n[2]]*17,b:255&jn[n[3]]*17,a:e===5?jn[n[4]]*17:255}:(e===7||e===9)&&(t={r:jn[n[1]]<<4|jn[n[2]],g:jn[n[3]]<<4|jn[n[4]],b:jn[n[5]]<<4|jn[n[6]],a:e===9?jn[n[7]]<<4|jn[n[8]]:255})),t}const w2=(n,e)=>n<255?e(n):"";function S2(n){var e=y2(n)?b2:v2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+w2(n.a,e):void 0}const T2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Kb(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function C2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function $2(n,e,t){const i=Kb(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function M2(n,e,t,i,s){return n===s?(e-t)/i+(e.5?f/(2-l-o):f/(l+o),a=M2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Va(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Vi)}function za(n,e,t){return Va(Kb,n,e,t)}function O2(n,e,t){return Va($2,n,e,t)}function E2(n,e,t){return Va(C2,n,e,t)}function Jb(n){return(n%360+360)%360}function D2(n){const e=T2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?tl(+e[5]):Vi(+e[5]));const s=Jb(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=O2(s,l,o):e[1]==="hsv"?i=E2(s,l,o):i=za(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function A2(n,e){var t=Ha(n);t[0]=Jb(t[0]+e),t=za(t),n.r=t[0],n.g=t[1],n.b=t[2]}function I2(n){if(!n)return;const e=Ha(n),t=e[0],i=Sf(e[1]),s=Sf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ki(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Tf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Cf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function L2(){const n={},e=Object.keys(Cf),t=Object.keys(Tf);let i,s,l,o,r;for(i=0;i>16&255,l>>8&255,l&255]}return n}let Yl;function P2(n){Yl||(Yl=L2(),Yl.transparent=[0,0,0,0]);const e=Yl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const N2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function F2(n){const e=N2.exec(n);let t=255,i,s,l;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?tl(o):Ri(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?tl(i):Ri(i,0,255)),s=255&(e[4]?tl(s):Ri(s,0,255)),l=255&(e[6]?tl(l):Ri(l,0,255)),{r:i,g:s,b:l,a:t}}}function R2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ki(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const gr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,_s=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function q2(n,e,t){const i=_s(ki(n.r)),s=_s(ki(n.g)),l=_s(ki(n.b));return{r:Vi(gr(i+t*(_s(ki(e.r))-i))),g:Vi(gr(s+t*(_s(ki(e.g))-s))),b:Vi(gr(l+t*(_s(ki(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Kl(n,e,t){if(n){let i=Ha(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=za(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Gb(n,e){return n&&Object.assign(e||{},n)}function $f(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Vi(n[3]))):(e=Gb(n,{r:0,g:0,b:0,a:1}),e.a=Vi(e.a)),e}function j2(n){return n.charAt(0)==="r"?F2(n):D2(n)}class Oo{constructor(e){if(e instanceof Oo)return e;const t=typeof e;let i;t==="object"?i=$f(e):t==="string"&&(i=k2(e)||P2(e)||j2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Gb(this._rgb);return e&&(e.a=ki(e.a)),e}set rgb(e){this._rgb=$f(e)}rgbString(){return this._valid?R2(this._rgb):void 0}hexString(){return this._valid?S2(this._rgb):void 0}hslString(){return this._valid?I2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,s=e.rgb;let l;const o=t===l?.5:t,r=2*o-1,a=i.a-s.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;l=1-u,i.r=255&u*i.r+l*s.r+.5,i.g=255&u*i.g+l*s.g+.5,i.b=255&u*i.b+l*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=q2(this._rgb,e._rgb,t)),this}clone(){return new Oo(this.rgb)}alpha(e){return this._rgb.a=Vi(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Al(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Kl(this._rgb,2,e),this}darken(e){return Kl(this._rgb,2,-e),this}saturate(e){return Kl(this._rgb,1,e),this}desaturate(e){return Kl(this._rgb,1,-e),this}rotate(e){return A2(this._rgb,e),this}}function Zb(n){return new Oo(n)}function Xb(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Mf(n){return Xb(n)?n:Zb(n)}function _r(n){return Xb(n)?n:Zb(n).saturate(.5).darken(.1).hexString()}const as=Object.create(null),sa=Object.create(null);function al(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;it.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>_r(i.backgroundColor),this.hoverBorderColor=(t,i)=>_r(i.borderColor),this.hoverColor=(t,i)=>_r(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return br(this,e,t)}get(e){return al(this,e)}describe(e,t){return br(sa,e,t)}override(e,t){return br(as,e,t)}route(e,t,i,s){const l=al(this,e),o=al(this,i),r="_"+t;Object.defineProperties(l,{[r]:{value:l[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[s];return st(a)?Object.assign({},u,a):at(a,u)},set(a){this[r]=a}}})}}var ut=new H2({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function V2(n){return!n||bt(n.size)||bt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Eo(n,e,t,i,s){let l=e[s];return l||(l=e[s]=n.measureText(s).width,t.push(s)),l>i&&(i=l),i}function z2(n,e,t,i){i=i||{};let s=i.data=i.data||{},l=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(s=i.data={},l=i.garbageCollect=[],i.font=e),n.save(),n.font=e;let o=0;const r=t.length;let a,u,f,c,d;for(a=0;at.length){for(a=0;a0&&n.stroke()}}function bl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.xe.top-t&&n.y0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,Y2(n,l),a=0;a+n||0;function Wa(n,e){const t={},i=st(e),s=i?Object.keys(e):e,l=st(n)?i?o=>at(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=X2(l(o));return t}function Qb(n){return Wa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ts(n){return Wa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Gn(n){const e=Qb(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function An(n,e){n=n||{},e=e||ut.font;let t=at(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=at(n.style,e.style);i&&!(""+i).match(G2)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:at(n.family,e.family),lineHeight:Z2(at(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:at(n.weight,e.weight),string:""};return s.string=V2(s),s}function Jl(n,e,t,i){let s=!0,l,o,r;for(l=0,o=n.length;lt&&r===0?0:r+a;return{min:o(i,-Math.abs(l)),max:o(s,l)}}function Wi(n,e){return Object.assign(Object.create(n),e)}function Ya(n,e=[""],t=n,i,s=()=>n[0]){Jn(i)||(i=n1("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ya([o,...n],e,t,i)};return new Proxy(l,{deleteProperty(o,r){return delete o[r],delete o._keys,delete n[0][r],!0},get(o,r){return e1(o,r,()=>ow(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return Df(o).includes(r)},ownKeys(o){return Df(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function As(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:xb(n,i),setContext:l=>As(n,l,t,i),override:l=>As(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return e1(l,o,()=>ew(l,o,r))},getOwnPropertyDescriptor(l,o){return l._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(l,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(l,o,r){return n[o]=r,delete l[o],!0}})}function xb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Bi(t)?t:()=>t,isIndexable:Bi(i)?i:()=>i}}const x2=(n,e)=>n?n+Ra(e):e,Ka=(n,e)=>st(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function e1(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function ew(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Bi(r)&&o.isScriptable(e)&&(r=tw(e,r,n,t)),Pt(r)&&r.length&&(r=nw(e,r,n,o.isIndexable)),Ka(e,r)&&(r=As(r,s,l&&l[e],o)),r}function tw(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);return r.add(n),e=e(l,o||i),r.delete(n),Ka(n,e)&&(e=Ja(s._scopes,s,n,e)),e}function nw(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Jn(l.index)&&i(n))e=e[l.index%e.length];else if(st(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ja(u,s,n,f);e.push(As(c,l,o&&o[n],r))}}return e}function t1(n,e,t){return Bi(n)?n(e,t):n}const iw=(n,e)=>n===!0?e:typeof n=="string"?zi(e,n):void 0;function sw(n,e,t,i,s){for(const l of e){const o=iw(t,l);if(o){n.add(o);const r=t1(o._fallback,t,s);if(Jn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Jn(i)&&t!==i)return null}return!1}function Ja(n,e,t,i){const s=e._rootScopes,l=t1(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Ef(r,o,t,l||t,i);return a===null||Jn(l)&&l!==t&&(a=Ef(r,o,l,a,i),a===null)?!1:Ya(Array.from(r),[""],s,l,()=>lw(e,t,i))}function Ef(n,e,t,i,s){for(;t;)t=sw(n,e,t,i,s);return t}function lw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Pt(s)&&st(t)?t:s}function ow(n,e,t,i){let s;for(const l of e)if(s=n1(x2(l,n),t),Jn(s))return Ka(n,s)?Ja(t,i,n,s):s}function n1(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Jn(i))return i}}function Df(n){let e=n._keys;return e||(e=n._keys=rw(n._scopes)),e}function rw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(s=>!s.startsWith("_")))e.add(i);return Array.from(e)}function i1(n,e,t,i){const{iScale:s}=n,{key:l="r"}=this._parsing,o=new Array(i);let r,a,u,f;for(r=0,a=i;ren==="x"?"y":"x";function uw(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=na(l,s),a=na(o,l);let u=r/(r+a),f=a/(r+a);u=isNaN(u)?0:u,f=isNaN(f)?0:f;const c=i*u,d=i*f;return{previous:{x:l.x-c*(o.x-s.x),y:l.y-c*(o.y-s.y)},next:{x:l.x+d*(o.x-s.x),y:l.y+d*(o.y-s.y)}}}function fw(n,e,t){const i=n.length;let s,l,o,r,a,u=Is(n,0);for(let f=0;f!u.skip)),e.cubicInterpolationMode==="monotone")dw(n,s);else{let u=i?n[n.length-1]:n[0];for(l=0,o=n.length;lwindow.getComputedStyle(n,null);function mw(n,e){return Zo(n).getPropertyValue(e)}const gw=["top","right","bottom","left"];function os(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=gw[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const _w=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function bw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(_w(s,l,n.target))r=s,a=l;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function es(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Zo(t),l=s.boxSizing==="border-box",o=os(s,"padding"),r=os(s,"border","width"),{x:a,y:u,box:f}=bw(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:m}=e;return l&&(h-=o.width+r.width,m-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/m*t.height/i)}}function vw(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Ga(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Zo(l),a=os(r,"border","width"),u=os(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Io(r.maxWidth,l,"clientWidth"),s=Io(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||Mo,maxHeight:s||Mo}}const vr=n=>Math.round(n*10)/10;function yw(n,e,t,i){const s=Zo(n),l=os(s,"margin"),o=Io(s.maxWidth,n,"clientWidth")||Mo,r=Io(s.maxHeight,n,"clientHeight")||Mo,a=vw(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=os(s,"border","width"),d=os(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=vr(Math.min(u,o,a.maxWidth)),f=vr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=vr(u/2)),{width:u,height:f}}function Af(n,e,t){const i=e||1,s=Math.floor(n.height*i),l=Math.floor(n.width*i);n.height=s/i,n.width=l/i;const o=n.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==l?(n.currentDevicePixelRatio=i,o.height=s,o.width=l,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const kw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return n}();function If(n,e){const t=mw(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function ts(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function ww(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:i==="middle"?t<.5?n.y:e.y:i==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Sw(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=ts(n,s,t),r=ts(s,l,t),a=ts(l,e,t),u=ts(o,r,t),f=ts(r,a,t);return ts(u,f,t)}const Lf=new Map;function Tw(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Lf.get(t);return i||(i=new Intl.NumberFormat(n,e),Lf.set(t,i)),i}function Il(n,e,t){return Tw(e,t).format(n)}const Cw=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},$w=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function yr(n,e,t){return n?Cw(e,t):$w()}function Mw(n,e){let t,i;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=i)}function Ow(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function o1(n){return n==="angle"?{between:gl,compare:c2,normalize:Dn}:{between:_l,compare:(e,t)=>e-t,normalize:e=>e}}function Pf({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function Ew(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=o1(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;da(s,C,y)&&r(s,C)!==0,$=()=>r(l,y)===0||a(l,C,y),M=()=>g||T(),O=()=>!g||$();for(let D=f,I=f;D<=c;++D)S=e[D%o],!S.skip&&(y=u(S[i]),y!==C&&(g=a(y,s,l),_===null&&M()&&(_=r(y,s)===0?D:I),_!==null&&O()&&(m.push(Pf({start:_,end:D,loop:d,count:o,style:h})),_=null),I=D,C=y));return _!==null&&m.push(Pf({start:_,end:c,loop:d,count:o,style:h})),m}function a1(n,e){const t=[],i=n.segments;for(let s=0;ss&&n[l%e].skip;)l--;return l%=e,{start:s,end:l}}function Aw(n,e,t,i){const s=n.length,l=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%s];u.skip||u.stop?r.skip||(i=!1,l.push({start:e%s,end:(a-1)%s,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&l.push({start:e%s,end:o%s,loop:i}),l}function Iw(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=Dw(t,s,l,i);if(i===!0)return Nf(n,[{start:o,end:r,loop:l}],t,e);const a=rr({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Bb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var vi=new Nw;const Rf="transparent",Fw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Mf(n||Rf),s=i.valid&&Mf(e||Rf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Rw{constructor(e,t,i,s){const l=t[i];s=Jl([e.to,s,l,e.from]);const o=Jl([e.from,l,s]);this._active=!0,this._fn=e.fn||Fw[e.type||typeof o],this._easing=rl[e.easing]||rl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Jl([e.to,t,s,e.from]),this._from=Jl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;sn!=="onProgress"&&n!=="onComplete"&&n!=="fn"});ut.set("animations",{colors:{type:"color",properties:jw},numbers:{type:"number",properties:qw}});ut.describe("animations",{_fallback:"animation"});ut.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class u1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!st(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!st(s))return;const l={};for(const o of Hw)l[o]=s[o];(Pt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=zw(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&Vw(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){s.push(...this._animateOptions(e,t));continue}const f=t[u];let c=l[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new Rw(d,e,u,f),s.push(c)}return s}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return vi.add(this._chart,i),!0}}function Vw(n,e){const t=[],i=Object.keys(e);for(let s=0;s0||!t&&l<0)return s.index}return null}function zf(n,e){const{chart:t,_cachedMeta:i}=n,s=t._stacks||(t._stacks={}),{iScale:l,vScale:o,index:r}=i,a=l.axis,u=o.axis,f=Yw(l,o,i),c=e.length;let d;for(let h=0;ht[i].axis===e).shift()}function Gw(n,e){return Wi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Zw(n,e,t){return Wi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ks(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const wr=n=>n==="reset"||n==="none",Bf=(n,e)=>e?n:Object.assign({},n),Xw=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:f1(t,!0),values:null};class li{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Hf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Ks(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,m)=>c==="x"?d:c==="r"?m:h,l=t.xAxisID=at(i.xAxisID,kr(e,"x")),o=t.yAxisID=at(i.yAxisID,kr(e,"y")),r=t.rAxisID=at(i.rAxisID,kr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&vf(this._data,this),e._stacked&&Ks(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(st(t))this._data=Ww(t);else if(i!==t){if(i){vf(i,this);const s=this._cachedMeta;Ks(s),s._parsed=[]}t&&Object.isExtensible(t)&&m2(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const l=t._stacked;t._stacked=Hf(t.vScale,t),t.stack!==i.stack&&(s=!0,Ks(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&zf(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:s}=this,{iScale:l,_stacked:o}=i,r=l.axis;let a=e===0&&t===s.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{Pt(s[e])?d=this.parseArrayData(i,s,e,t):st(s[e])?d=this.parseObjectData(i,s,e,t):d=this.parsePrimitiveData(i,s,e,t);const h=()=>c[r]===null||u&&c[r]g||c=0;--d)if(!m()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s=0&&ethis.getContext(i,s),g=u.resolveNamedOptions(d,h,m,c);return g.$shared&&(g.$shared=a,l[o]=Object.freeze(Bf(g,a))),g}_resolveAnimations(e,t,i){const s=this.chart,l=this._cachedDataOpts,o=`animation-${t}`,r=l[o];if(r)return r;let a;if(s.options.animation!==!1){const f=this.chart.config,c=f.datasetAnimationScopeKeys(this._type,t),d=f.getOptionScopes(this.getDataset(),c);a=f.createResolver(d,this.getContext(e,i,t))}const u=new u1(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||wr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){wr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!wr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;rs-l))}return n._cache.$bar}function xw(n){const e=n.iScale,t=Qw(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Jn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s0?s[n-1]:null,r=nMath.abs(r)&&(a=r,u=o),e[t.axis]=u,e._custom={barStart:a,barEnd:u,start:s,end:l,min:o,max:r}}function c1(n,e,t,i){return Pt(n)?n3(n,e,t,i):e[t.axis]=t.parse(n,i),e}function Uf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u=t?1:-1)}function s3(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.basea.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(bt(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;dgl(C,r,a,!0)?1:Math.max(T,T*t,$,$*t),m=(C,T,$)=>gl(C,r,a,!0)?-1:Math.min(T,T*t,$,$*t),g=h(0,u,c),_=h(Bt,f,d),y=m(Ut,u,c),S=m(Ut+Bt,f,d);i=(g-y)/2,s=(_-S)/2,l=-(g+y)/2,o=-(_+S)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Ll extends li{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let l=a=>+i[a];if(st(i[e])){const{key:a="value"}=this._parsing;l=u=>+zi(i[u],a)}let o,r;for(o=e,r=e+t;o0&&!isNaN(e)?wt*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e],i.options.locale);return{label:s[e]||"",value:l}}getMaxBorderWidth(e){let t=0;const i=this.chart;let s,l,o,r,a;if(!e){for(s=0,l=i.data.datasets.length;sn!=="spacing",_indexable:n=>n!=="spacing"};Ll.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){let e=n.label;const t=": "+n.formattedValue;return Pt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Xo extends li{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:s=[],_dataset:l}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=Wb(t,s,o);this._drawStart=r,this._drawCount=a,Yb(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:m,segment:g}=this.options,_=Ds(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let S=t>0&&this.getParsed(t-1);for(let C=t;C0&&Math.abs($[d]-S[d])>_,g&&(M.parsed=$,M.raw=u.data[C]),c&&(M.options=f||this.resolveDataElementOptions(C,T.active?"active":s)),y||this.updateElement(T,C,M,s),S=$}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Xo.id="line";Xo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Xo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Qa extends li{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=Il(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return i1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,s)=>{const l=this.getParsed(s).r;!isNaN(l)&&this.chart.getDataVisibility(s)&&(lt.max&&(t.max=l))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,s=Math.min(t.right-t.left,t.bottom-t.top),l=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?l/100*i.cutoutPercentage:1,0),r=(l-o)/e.getVisibleDatasetCount();this.outerRadius=l-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,i,s){const l=s==="reset",o=this.chart,a=o.options.animation,u=this._cachedMeta.rScale,f=u.xCenter,c=u.yCenter,d=u.getIndexAngle(0)-.5*Ut;let h=d,m;const g=360/this.countVisibleElements();for(m=0;m{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?ni(this.resolveDataElementOptions(e,t).angle||i):0}}Qa.id="polarArea";Qa.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Qa.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class d1 extends Ll{}d1.id="pie";d1.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class xa extends li{getLabelAndValue(e){const t=this._cachedMeta.vScale,i=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(i[t.axis])}}parseObjectData(e,t,i,s){return i1.bind(this)(e,t,i,s)}update(e){const t=this._cachedMeta,i=t.dataset,s=t.data||[],l=t.iScale.getLabels();if(i.points=s,e!=="resize"){const o=this.resolveDatasetElementOptions(e);this.options.showLine||(o.borderWidth=0);const r={_loop:!0,_fullLoop:l.length===s.length,options:o};this.updateElement(i,void 0,r,e)}this.updateElements(s,0,s.length,e)}updateElements(e,t,i,s){const l=this._cachedMeta.rScale,o=s==="reset";for(let r=t;r{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}};Oi.defaults={};Oi.defaultRoutes=void 0;const p1={values(n){return Pt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let s,l=n;if(t.length>1){const u=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(u<1e-4||u>1e15)&&(s="scientific"),l=u3(n,t)}const o=Wn(Math.abs(l)),r=Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),Il(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(Wn(n)));return i===1||i===2||i===5?p1.numeric.call(this,n,e,t):""}};function u3(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Qo={formatters:p1};ut.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Qo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});ut.route("scale.ticks","color","","color");ut.route("scale.grid","color","","borderColor");ut.route("scale.grid","borderColor","","borderColor");ut.route("scale.title","color","","color");ut.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});ut.describe("scales",{_fallback:"scale"});ut.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function f3(n,e){const t=n.options.ticks,i=t.maxTicksLimit||c3(n),s=t.major.enabled?p3(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return h3(e,a,s,l/i),a;const u=d3(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Zl(e,a,u,bt(d)?0:o-d,o),f=0,c=l-1;fs)return a}return Math.max(s,1)}function p3(n){const e=[];let t,i;for(t=0,i=n.length;tn==="left"?"right":n==="right"?"left":n,Kf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Jf(n,e){const t=[],i=n.length/e,s=n.length;let l=0;for(;lo+r)))return a}function b3(n,e){kt(n,t=>{const i=t.gc,s=i.length/2;let l;if(s>e){for(l=0;li?i:t,i=s&&t>i?t:i,{min:Hn(t,Hn(i,t)),max:Hn(i,Hn(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Vt(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:s,grace:l,ticks:o}=this.options,r=o.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Q2(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r=l||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,h=mn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Js(e.grid)-t.padding-Gf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=qa(Math.min(Math.asin(mn((f.highest.height+6)/r,-1,1)),Math.asin(mn(a/u,-1,1))-Math.asin(mn(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Vt(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:s,grid:l}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=Gf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Js(l)+a):(e.height=this.maxHeight,e.width=Js(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,m=ni(this.labelRotation),g=Math.cos(m),_=Math.sin(m);if(r){const y=i.mirror?0:_*c.width+g*d.height;e.height=Math.min(this.maxHeight,e.height+y+h)}else{const y=i.mirror?0:g*c.width+_*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}this._calculatePadding(u,f,_,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;l==="start"?(f=0,c=e.height):l==="end"&&(f=t.height,c=0),this.paddingTop=f+o,this.paddingBottom=c+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Vt(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t({width:l[O]||0,height:o[O]||0});return{first:M(0),last:M(t-1),widest:M(T),highest:M($),widths:l,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return d2(this._alignToPixels?Zi(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&er*s?r/i:a/s:a*s0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Js(l),d=[],h=l.setContext(this.getContext()),m=h.drawBorder?h.borderWidth:0,g=m/2,_=function(B){return Zi(i,B,m)};let y,S,C,T,$,M,O,D,I,N,P,F;if(o==="top")y=_(this.bottom),M=this.bottom-c,D=y-g,N=_(e.top)+g,F=e.bottom;else if(o==="bottom")y=_(this.top),N=e.top,F=_(e.bottom)-g,M=y+g,D=this.top+c;else if(o==="left")y=_(this.right),$=this.right-c,O=y-g,I=_(e.left)+g,P=e.right;else if(o==="right")y=_(this.left),I=e.left,P=_(e.right)-g,$=y+g,O=this.left+c;else if(t==="x"){if(o==="center")y=_((e.top+e.bottom)/2+.5);else if(st(o)){const B=Object.keys(o)[0],Z=o[B];y=_(this.chart.scales[B].getPixelForValue(Z))}N=e.top,F=e.bottom,M=y+g,D=M+c}else if(t==="y"){if(o==="center")y=_((e.left+e.right)/2);else if(st(o)){const B=Object.keys(o)[0],Z=o[B];y=_(this.chart.scales[B].getPixelForValue(Z))}$=y-g,O=$-c,I=e.left,P=e.right}const R=at(s.ticks.maxTicksLimit,f),q=Math.max(1,Math.ceil(f/R));for(S=0;Sl.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let l,o;for(l=0,o=t.length;l{const i=t.split("."),s=i.pop(),l=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");ut.route(l,s,a,r)})}function C3(n){return"id"in n&&"defaults"in n}class $3{constructor(){this.controllers=new Xl(li,"datasets",!0),this.elements=new Xl(Oi,"elements"),this.plugins=new Xl(Object,"plugins"),this.scales=new Xl(ds,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(s=>{const l=i||this._getRegistryForType(s);i||l.isForType(s)||l===this.plugins&&s.id?this._exec(e,l,s):kt(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Ra(e);Vt(i["before"+s],[],i),t[e](i),Vt(i["after"+s],[],i)}_getRegistryForType(e){for(let t=0;t0&&this.getParsed(t-1);for(let T=t;T0&&Math.abs(M[h]-C[h])>y,_&&(O.parsed=M,O.raw=u.data[T]),d&&(O.options=c||this.resolveDataElementOptions(T,$.active?"active":s)),S||this.updateElement($,T,O,s),C=M}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}eu.id="scatter";eu.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};eu.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Xi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class oa{constructor(e){this.options=e||{}}init(e){}formats(){return Xi()}parse(e,t){return Xi()}format(e,t){return Xi()}add(e,t,i){return Xi()}diff(e,t,i){return Xi()}startOf(e,t,i){return Xi()}endOf(e,t){return Xi()}}oa.override=function(n){Object.assign(oa.prototype,n)};var h1={_date:oa};function M3(n,e,t,i){const{controller:s,data:l,_sorted:o}=n,r=s._cachedMeta.iScale;if(r&&e===r.axis&&e!=="r"&&o&&l.length){const a=r._reversePixels?p2:is;if(i){if(s._sharedOptions){const u=l[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const c=a(l,e,t-f),d=a(l,e,t+f);return{lo:c.lo,hi:d.hi}}}}else return a(l,e,t)}return{lo:0,hi:l.length-1}}function Pl(n,e,t,i,s){const l=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=l.length;r{a[o](e[t],s)&&(l.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,s))}),i&&!r?[]:l}var A3={evaluateInteractionItems:Pl,modes:{index(n,e,t,i){const s=es(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?Tr(n,s,l,i,o):Cr(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=es(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?Tr(n,s,l,i,o):Cr(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;ft.pos===e)}function Xf(n,e){return n.filter(t=>m1.indexOf(t.pos)===-1&&t.box.axis===e)}function Zs(n,e){return n.sort((t,i)=>{const s=e?i:t,l=e?t:i;return s.weight===l.weight?s.index-l.index:s.weight-l.weight})}function I3(n){const e=[];let t,i,s,l,o,r;for(t=0,i=(n||[]).length;tu.box.fullSize),!0),i=Zs(Gs(e,"left"),!0),s=Zs(Gs(e,"right")),l=Zs(Gs(e,"top"),!0),o=Zs(Gs(e,"bottom")),r=Xf(e,"x"),a=Xf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Gs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Qf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function g1(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function F3(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!st(s)){t.size&&(n[s]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?l.height:l.width),t.size=c.size/c.count,n[s]+=t.size}l.getPadding&&g1(o,l.getPadding());const r=Math.max(0,e.outerWidth-Qf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Qf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function R3(n){const e=n.maxPadding;function t(i){const s=Math.max(e[i]-n[i],0);return n[i]+=s,s}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function q3(n,e){const t=e.maxPadding;function i(s){const l={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{l[o]=Math.max(e[o],t[o])}),l}return i(n?["left","right"]:["top","bottom"])}function nl(n,e,t,i){const s=[];let l,o,r,a,u,f;for(l=0,o=n.length,u=0;l{typeof g.beforeLayout=="function"&&g.beforeLayout()});const f=a.reduce((g,_)=>_.box.options&&_.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:s,availableWidth:l,availableHeight:o,vBoxMaxWidth:l/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},s);g1(d,Gn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),m=P3(a.concat(u),c);nl(r.fullSize,h,c,m),nl(a,h,c,m),nl(u,h,c,m)&&nl(a,h,c,m),R3(h),xf(r.leftAndTop,h,c,m),h.x+=h.w,h.y+=h.h,xf(r.rightAndBottom,h,c,m),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},kt(r.chartArea,g=>{const _=g.box;Object.assign(_,n.chartArea),_.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class _1{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,s){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,s?Math.floor(t/s):i)}}isAttached(e){return!0}updateConfig(e){}}class j3 extends _1{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const co="$chartjs",H3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ec=n=>n===null||n==="";function V3(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[co]={initial:{height:i,width:s,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",ec(s)){const l=If(n,"width");l!==void 0&&(n.width=l)}if(ec(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=If(n,"height");l!==void 0&&(n.height=l)}return n}const b1=kw?{passive:!0}:!1;function z3(n,e,t){n.addEventListener(e,t,b1)}function B3(n,e,t){n.canvas.removeEventListener(e,t,b1)}function U3(n,e){const t=H3[n.type]||n.type,{x:i,y:s}=es(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Lo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function W3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Lo(r.addedNodes,i),o=o&&!Lo(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function Y3(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Lo(r.removedNodes,i),o=o&&!Lo(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const vl=new Map;let tc=0;function v1(){const n=window.devicePixelRatio;n!==tc&&(tc=n,vl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function K3(n,e){vl.size||window.addEventListener("resize",v1),vl.set(n,e)}function J3(n){vl.delete(n),vl.size||window.removeEventListener("resize",v1)}function G3(n,e,t){const i=n.canvas,s=i&&Ga(i);if(!s)return;const l=Ub((r,a)=>{const u=s.clientWidth;t(r,a),u{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||l(u,f)});return o.observe(s),K3(n,l),o}function $r(n,e,t){t&&t.disconnect(),e==="resize"&&J3(n)}function Z3(n,e,t){const i=n.canvas,s=Ub(l=>{n.ctx!==null&&t(U3(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return z3(i,e,s),s}class X3 extends _1{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(V3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[co])return!1;const i=t[co].initial;["height","width"].forEach(l=>{const o=i[l];bt(o)?t.removeAttribute(l):t.setAttribute(l,o)});const s=i.style||{};return Object.keys(s).forEach(l=>{t.style[l]=s[l]}),t.width=t.width,delete t[co],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:W3,detach:Y3,resize:G3}[t]||Z3;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:$r,detach:$r,resize:$r}[t]||B3)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return yw(e,t,i,s)}isAttached(e){const t=Ga(e);return!!(t&&t.isConnected)}}function Q3(n){return!l1()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?j3:X3}class x3{constructor(){this._init=[]}notify(e,t,i,s){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const l=s?this._descriptors(e).filter(s):this._descriptors(e),o=this._notify(l,e,t,i);return t==="afterDestroy"&&(this._notify(l,e,"stop"),this._notify(this._init,e,"uninstall")),o}_notify(e,t,i,s){s=s||{};for(const l of e){const o=l.plugin,r=o[i],a=[t,s,l.options];if(Vt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){bt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,s=at(i.options&&i.options.plugins,{}),l=eS(i);return s===!1&&!t?[]:nS(e,l,s,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,s=(l,o)=>l.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(s(t,i),e,"stop"),this._notify(s(i,t),e,"start")}}function eS(n){const e={},t=[],i=Object.keys(fi.plugins.items);for(let l=0;l{const a=i[r];if(!st(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const u=aa(r,a),f=lS(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=ll(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||ra(a,e),c=(as[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=sS(d,u),m=r[h+"AxisID"]||l[h]||h;o[m]=o[m]||Object.create(null),ll(o[m],[{axis:h},i[m],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];ll(a,[ut.scales[a.type],ut.scale])}),o}function y1(n){const e=n.options||(n.options={});e.plugins=at(e.plugins,{}),e.scales=rS(n,e)}function k1(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function aS(n){return n=n||{},n.data=k1(n.data),y1(n),n}const nc=new Map,w1=new Set;function eo(n,e){let t=nc.get(n);return t||(t=e(),nc.set(n,t),w1.add(t)),t}const Xs=(n,e,t)=>{const i=zi(e,t);i!==void 0&&n.add(i)};class uS{constructor(e){this._config=aS(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=k1(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),y1(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return eo(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return eo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return eo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return eo(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let s=i.get(e);return(!s||t)&&(s=new Map,i.set(e,s)),s}getOptionScopes(e,t,i){const{options:s,type:l}=this,o=this._cachedScopes(e,i),r=o.get(t);if(r)return r;const a=new Set;t.forEach(f=>{e&&(a.add(e),f.forEach(c=>Xs(a,e,c))),f.forEach(c=>Xs(a,s,c)),f.forEach(c=>Xs(a,as[l]||{},c)),f.forEach(c=>Xs(a,ut,c)),f.forEach(c=>Xs(a,sa,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),w1.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,as[t]||{},ut.datasets[t]||{},{type:t},ut,sa]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=ic(this._resolverCache,e,s);let a=o;if(cS(o,t)){l.$shared=!1,i=Bi(i)?i():i;const u=this.createResolver(e,i,r);a=As(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=ic(this._resolverCache,e,i);return st(t)?As(l,t,void 0,s):l}}function ic(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const s=t.join();let l=i.get(s);return l||(l={resolver:Ya(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const fS=n=>st(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Bi(n[t]),!1);function cS(n,e){const{isScriptable:t,isIndexable:i}=xb(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Bi(r)||fS(r))||o&&Pt(r))return!0}return!1}var dS="3.9.1";const pS=["top","bottom","left","right","chartArea"];function sc(n,e){return n==="top"||n==="bottom"||pS.indexOf(n)===-1&&e==="x"}function lc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function oc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Vt(t&&t.onComplete,[n],e)}function hS(n){const e=n.chart,t=e.options.animation;Vt(t&&t.onProgress,[n],e)}function S1(n){return l1()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Po={},T1=n=>{const e=S1(n);return Object.values(Po).filter(t=>t.canvas===e).pop()};function mS(n,e,t){const i=Object.keys(n);for(const s of i){const l=+s;if(l>=e){const o=n[s];delete n[s],(t>0||l>e)&&(n[l+t]=o)}}}function gS(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class No{constructor(e,t){const i=this.config=new uS(t),s=S1(e),l=T1(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Q3(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=e2(),this.ctx=r,this.canvas=a,this.width=f,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new x3,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=g2(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Po[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}vi.listen(this,"complete",oc),vi.listen(this,"progress",hS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return bt(e)?t&&l?l:s?i/s:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Af(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Of(this.canvas,this.ctx),this}stop(){return vi.stop(this),this}resize(e,t){vi.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,s=this.canvas,l=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,e,t,l),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Af(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Vt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};kt(t,(i,s)=>{i.id=s})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,s=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let l=[];t&&(l=l.concat(Object.keys(t).map(o=>{const r=t[o],a=aa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),kt(l,o=>{const r=o.options,a=r.id,u=aa(a,r),f=at(r.type,o.dtype);(r.position===void 0||sc(r.position,u)!==sc(o.dposition))&&(r.position=o.dposition),s[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=fi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),kt(s,(o,r)=>{o||delete i[r]}),kt(i,o=>{xl.configure(this,o,o.options),xl.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((s,l)=>s.index-l.index),i>t){for(let s=t;st.length&&delete this._stacks,e.forEach((i,s)=>{t.filter(l=>l===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=t.length;i{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const l=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let u=0,f=this.data.datasets.length;u{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(lc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){kt(this.scales,e=>{xl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!mf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:l}of t){const o=i==="_removeElements"?-l:l;mS(e,s,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=l=>new Set(e.filter(o=>o[0]===l).map((o,r)=>r+","+o.splice(1).join(","))),s=i(0);for(let l=1;ll.split(",")).map(l=>({method:l[1],start:+l[2],count:+l[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],kt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&Ba(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&Ua(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return bl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=A3.modes[t];return typeof l=="function"?l(this,e,i,s):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let s=i.filter(l=>l&&l._dataset===t).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Wi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const s=i?"show":"hide",l=this.getDatasetMeta(e),o=l.controller._resolveAnimations(void 0,s);Jn(t)?(l.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(l,{visible:i}),this.update(r=>r.datasetIndex===e?s:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),vi.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,l,o),e[l]=o},s=(l,o,r)=>{l.offsetX=o,l.offsetY=r,this._eventHandler(l)};kt(this.options.events,l=>i(l,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},s=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},l=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",l),i("detach",o)};o=()=>{this.attached=!1,s("resize",l),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){kt(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},kt(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const s=i?"set":"remove";let l,o,r,a;for(t==="dataset"&&(l=this.getDatasetMeta(e[0].datasetIndex),l.controller["_"+s+"DatasetHoverStyle"]()),r=0,a=e.length;r{const r=this.getDatasetMeta(l);if(!r)throw new Error("No dataset found at index "+l);return{datasetIndex:l,element:r.data[o],index:o}});!Co(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}_updateHoverStyles(e,t,i){const s=this.options.hover,l=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=l(t,e),r=i?e:l(e,t);o.length&&this.updateHoverStyle(o,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},s=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const l=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(l||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:s=[],options:l}=this,o=t,r=this._getActiveElements(e,s,i,o),a=o2(e),u=gS(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Vt(l.onHover,[e,r,this],this),a&&Vt(l.onClick,[e,r,this],this));const f=!Co(r,s);return(f||t)&&(this._active=r,this._updateHoverStyles(r,s,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,s){if(e.type==="mouseout")return[];if(!i)return t;const l=this.options.hover;return this.getElementsAtEventForMode(e,l.mode,l,s)}}const rc=()=>kt(No.instances,n=>n._plugins.invalidate()),Li=!0;Object.defineProperties(No,{defaults:{enumerable:Li,value:ut},instances:{enumerable:Li,value:Po},overrides:{enumerable:Li,value:as},registry:{enumerable:Li,value:fi},version:{enumerable:Li,value:dS},getChart:{enumerable:Li,value:T1},register:{enumerable:Li,value:(...n)=>{fi.add(...n),rc()}},unregister:{enumerable:Li,value:(...n)=>{fi.remove(...n),rc()}}});function C1(n,e,t){const{startAngle:i,pixelMargin:s,x:l,y:o,outerRadius:r,innerRadius:a}=e;let u=s/r;n.beginPath(),n.arc(l,o,r,i-u,t+u),a>s?(u=s/a,n.arc(l,o,a,t+u,i-u,!0)):n.arc(l,o,s,t+Bt,i-Bt),n.closePath(),n.clip()}function _S(n){return Wa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function bS(n,e,t,i){const s=_S(n.options.borderRadius),l=(t-e)/2,o=Math.min(l,i*e/2),r=a=>{const u=(t-Math.min(l,a))*i/2;return mn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:mn(s.innerStart,0,o),innerEnd:mn(s.innerEnd,0,o)}}function bs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function ua(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const m=s-a;if(i){const B=f>0?f-i:0,Z=c>0?c-i:0,X=(B+Z)/2,J=X!==0?m*X/(X+i):m;h=(m-J)/2}const g=Math.max(.001,m*c-t/Ut)/c,_=(m-g)/2,y=a+_+h,S=s-_-h,{outerStart:C,outerEnd:T,innerStart:$,innerEnd:M}=bS(e,d,c,S-y),O=c-C,D=c-T,I=y+C/O,N=S-T/D,P=d+$,F=d+M,R=y+$/P,q=S-M/F;if(n.beginPath(),l){if(n.arc(o,r,c,I,N),T>0){const X=bs(D,N,o,r);n.arc(X.x,X.y,T,N,S+Bt)}const B=bs(F,S,o,r);if(n.lineTo(B.x,B.y),M>0){const X=bs(F,q,o,r);n.arc(X.x,X.y,M,S+Bt,q+Math.PI)}if(n.arc(o,r,d,S-M/d,y+$/d,!0),$>0){const X=bs(P,R,o,r);n.arc(X.x,X.y,$,R+Math.PI,y-Bt)}const Z=bs(O,y,o,r);if(n.lineTo(Z.x,Z.y),C>0){const X=bs(O,I,o,r);n.arc(X.x,X.y,C,y-Bt,I)}}else{n.moveTo(o,r);const B=Math.cos(I)*c+o,Z=Math.sin(I)*c+r;n.lineTo(B,Z);const X=Math.cos(N)*c+o,J=Math.sin(N)*c+r;n.lineTo(X,J)}n.closePath()}function vS(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){ua(n,e,t,i,o+wt,s);for(let u=0;u=wt||gl(l,r,a),g=_l(o,u+d,f+d);return m&&g}getCenterPoint(e){const{x:t,y:i,startAngle:s,endAngle:l,innerRadius:o,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],e),{offset:a,spacing:u}=this.options,f=(s+l)/2,c=(o+r+u+a)/2;return{x:t+Math.cos(f)*c,y:i+Math.sin(f)*c}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:t,circumference:i}=this,s=(t.offset||0)/2,l=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>wt?Math.floor(i/wt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Ut&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=vS(e,this,r,l,o);kS(e,this,r,l,a,o),e.restore()}}tu.id="arc";tu.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};tu.defaultRoutes={backgroundColor:"backgroundColor"};function $1(n,e,t=e){n.lineCap=at(t.borderCapStyle,e.borderCapStyle),n.setLineDash(at(t.borderDash,e.borderDash)),n.lineDashOffset=at(t.borderDashOffset,e.borderDashOffset),n.lineJoin=at(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=at(t.borderWidth,e.borderWidth),n.strokeStyle=at(t.borderColor,e.borderColor)}function wS(n,e,t){n.lineTo(t.x,t.y)}function SS(n){return n.stepped?U2:n.tension||n.cubicInterpolationMode==="monotone"?W2:wS}function M1(n,e,t={}){const i=n.length,{start:s=0,end:l=i-1}=t,{start:o,end:r}=e,a=Math.max(s,o),u=Math.min(l,r),f=sr&&l>r;return{count:i,start:a,loop:e.loop,ilen:u(o+(u?r-T:T))%l,C=()=>{g!==_&&(n.lineTo(f,_),n.lineTo(f,g),n.lineTo(f,y))};for(a&&(h=s[S(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[S(d)],h.skip)continue;const T=h.x,$=h.y,M=T|0;M===m?($_&&(_=$),f=(c*f+T)/++c):(C(),n.lineTo(T,$),m=M,c=0,g=_=$),y=$}C()}function fa(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?CS:TS}function $S(n){return n.stepped?ww:n.tension||n.cubicInterpolationMode==="monotone"?Sw:ts}function MS(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),$1(n,e.options),n.stroke(s)}function OS(n,e,t,i){const{segments:s,options:l}=e,o=fa(e);for(const r of s)$1(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const ES=typeof Path2D=="function";function DS(n,e,t,i){ES&&!e.options.segment?MS(n,e,t,i):OS(n,e,t,i)}class Yi extends Oi{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;hw(this._points,i,e,s,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Iw(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,s=e[t],l=this.points,o=a1(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=$S(i);let u,f;for(u=0,f=o.length;un!=="borderDash"&&n!=="fill"};function ac(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l){r=iu(o,r,s);const a=s[o],u=s[r];i!==null?(l.push({x:a.x,y:i}),l.push({x:u.x,y:i})):t!==null&&(l.push({x:t,y:a.y}),l.push({x:t,y:u.y}))}),l}function iu(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function uc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function E1(n,e){let t=[],i=!1;return Pt(n)?(i=!0,t=n):t=RS(n,e),t.length?new Yi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function fc(n){return n&&n.fill!==!1}function qS(n,e,t){let s=n[e].fill;const l=[e];let o;if(!t)return s;for(;s!==!1&&l.indexOf(s)===-1;){if(!Yt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function jS(n,e,t){const i=BS(n);if(st(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Yt(s)&&Math.floor(s)===s?HS(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function HS(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function VS(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:st(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function zS(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:st(n)?i=n.value:i=e.getBaseValue(),i}function BS(n){const e=n.options,t=e.fill;let i=at(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function US(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=WS(e,t);r.push(E1({x:null,y:e.bottom},i));for(let a=0;a=0;--o){const r=s[o].$filler;r&&(r.line.updateControlPoints(l,r.axis),i&&r.fill&&Er(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;fc(l)&&Er(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!fc(i)||t.drawTime!=="beforeDatasetDraw"||Er(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ul={average(n){if(!n.length)return!1;let e,t,i=0,s=0,l=0;for(e=0,t=n.length;e-1?n.split(` -`):n}function n4(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function hc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=An(e.bodyFont),u=An(e.titleFont),f=An(e.footerFont),c=l.length,d=s.length,h=i.length,m=Gn(e.padding);let g=m.height,_=0,y=i.reduce((T,$)=>T+$.before.length+$.lines.length+$.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=h*T+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,kt(n.title,C),t.font=a.string,kt(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,kt(i,T=>{kt(T.before,C),kt(T.lines,C),kt(T.after,C)}),S=0,t.font=f.string,kt(n.footer,C),t.restore(),_+=m.width,{width:_,height:g}}function i4(n,e){const{y:t,height:i}=e;return tn.height-i/2?"bottom":"center"}function s4(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function l4(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),s4(u,n,e,t)&&(u="center"),u}function mc(n,e,t){const i=t.yAlign||e.yAlign||i4(n,t);return{xAlign:t.xAlign||e.xAlign||l4(n,e,t,i),yAlign:i}}function o4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function r4(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function gc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=Ts(o);let m=o4(e,r);const g=r4(e,a,u);return a==="center"?r==="left"?m+=u:r==="right"&&(m-=u):r==="left"?m-=Math.max(f,d)+s:r==="right"&&(m+=Math.max(c,h)+s),{x:mn(m,0,i.width-e.width),y:mn(g,0,i.height-e.height)}}function to(n,e,t){const i=Gn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function _c(n){return ai([],yi(n))}function a4(n,e,t){return Wi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function bc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class da extends Oi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new u1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=a4(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=ai(r,yi(s)),r=ai(r,yi(l)),r=ai(r,yi(o)),r}getBeforeBody(e,t){return _c(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return kt(e,l=>{const o={before:[],lines:[],after:[]},r=bc(i,l);ai(o.before,yi(r.beforeLabel.call(this,l))),ai(o.lines,r.label.call(this,l)),ai(o.after,yi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return _c(t.callbacks.afterBody.apply(this,[e]))}getFooter(e,t){const{callbacks:i}=t,s=i.beforeFooter.apply(this,[e]),l=i.footer.apply(this,[e]),o=i.afterFooter.apply(this,[e]);let r=[];return r=ai(r,yi(s)),r=ai(r,yi(l)),r=ai(r,yi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],o=[];let r=[],a,u;for(a=0,u=t.length;ae.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),kt(r,f=>{const c=bc(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),o.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;let l,o=[];if(!s.length)this.opacity!==0&&(l={opacity:0});else{const r=ul[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=hc(this,i),u=Object.assign({},r,a),f=mc(this.chart,i,u),c=gc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,l={opacity:1,x:c.x,y:c.y,width:a.width,height:a.height,caretX:r.x,caretY:r.y}}this._tooltipItems=o,this.$context=void 0,l&&this._resolveAnimations().update(this,l),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,s){const l=this.getCaretPosition(e,i,s);t.lineTo(l.x1,l.y1),t.lineTo(l.x2,l.y2),t.lineTo(l.x3,l.y3)}getCaretPosition(e,t,i){const{xAlign:s,yAlign:l}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=Ts(r),{x:d,y:h}=e,{width:m,height:g}=t;let _,y,S,C,T,$;return l==="center"?(T=h+g/2,s==="left"?(_=d,y=_-o,C=T+o,$=T-o):(_=d+m,y=_+o,C=T-o,$=T+o),S=_):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+m-Math.max(u,c)-o:y=this.caretX,l==="top"?(C=h,T=C-o,_=y-o,S=y+o):(C=h+g,T=C+o,_=y+o,S=y-o),$=C),{x1:_,x2:y,x3:S,y1:C,y2:T,y3:$}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=yr(i.rtl,this.x,this.width);for(e.x=to(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=An(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;aC!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Ao(e,{x:_,y:g,w:u,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Ao(e,{x:y,y:g+1,w:u-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(_,g,u,a),e.strokeRect(_,g,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,g+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:s}=this,{bodySpacing:l,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=An(i.bodyFont);let d=c.lineHeight,h=0;const m=yr(i.rtl,this.x,this.width),g=function(D){t.fillText(D,m.x(e.x+h),e.y+d/2),e.y+=d+l},_=m.textAlign(o);let y,S,C,T,$,M,O;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=to(this,_,i),t.fillStyle=i.bodyColor,kt(this.beforeBody,g),h=r&&_!=="right"?o==="center"?u/2+f:u+2+f:0,T=0,M=s.length;T0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,s=i&&i.x,l=i&&i.y;if(s||l){const o=ul[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=hc(this,e),a=Object.assign({},o,this._size),u=mc(t,e,a),f=gc(e,a,u,t);(s._to!==f.x||l._to!==f.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=r.width,this.height=r.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,f))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const s={width:this.width,height:this.height},l={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Gn(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=i,this.drawBackground(l,e,s,t),Mw(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),Ow(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,s=e.map(({datasetIndex:r,index:a})=>{const u=this.chart.getDatasetMeta(r);if(!u)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:u.data[a],index:a}}),l=!Co(i,s),o=this._positionChanged(s,t);(l||o)&&(this._active=s,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,l=this._active||[],o=this._getActiveElements(e,l,t,i),r=this._positionChanged(o,e),a=t||!Co(o,l)||r;return a&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,s){const l=this.options;if(e.type==="mouseout")return[];if(!s)return t;const o=this.chart.getElementsAtEventForMode(e,l.mode,l,i);return l.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:s,options:l}=this,o=ul[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}da.positioners=ul;var u4={id:"tooltip",_element:da,positioners:ul,afterInit(n,e,t){t&&(n.tooltip=new da({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",t)===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:bi,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndexn!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const f4=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function c4(n,e,t,i){const s=n.indexOf(e);if(s===-1)return f4(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const d4=(n,e)=>n===null?null:mn(Math.round(n),0,e);class pa extends ds{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:s,label:l}of t)i[s]===l&&i.splice(s,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(bt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:c4(i,e,at(t,e),this._addedLabels),d4(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,s=[];let l=this.getLabels();l=e===0&&t===l.length-1?l:l.slice(e,t+1),this._valueRange=Math.max(l.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=e;o<=t;o++)s.push({value:o});return s}getLabelForValue(e){const t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}pa.id="category";pa.defaults={ticks:{callback:pa.prototype.getLabelForValue}};function p4(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,m=f-1,{min:g,max:_}=e,y=!bt(o),S=!bt(r),C=!bt(u),T=(_-g)/(c+1);let $=_f((_-g)/m/h)*h,M,O,D,I;if($<1e-14&&!y&&!S)return[{value:g},{value:_}];I=Math.ceil(_/$)-Math.floor(g/$),I>m&&($=_f(I*$/m/h)*h),bt(a)||(M=Math.pow(10,a),$=Math.ceil($*M)/M),s==="ticks"?(O=Math.floor(g/$)*$,D=Math.ceil(_/$)*$):(O=g,D=_),y&&S&&l&&f2((r-o)/l,$/1e3)?(I=Math.round(Math.min((r-o)/$,f)),$=(r-o)/I,O=o,D=r):C?(O=y?o:O,D=S?r:D,I=u-1,$=(D-O)/I):(I=(D-O)/$,ol(I,Math.round(I),$/1e3)?I=Math.round(I):I=Math.ceil(I));const N=Math.max(bf($),bf(O));M=Math.pow(10,bt(a)?N:a),O=Math.round(O*M)/M,D=Math.round(D*M)/M;let P=0;for(y&&(d&&O!==o?(t.push({value:o}),Os=t?s:a,r=a=>l=i?l:a;if(e){const a=ci(s),u=ci(l);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(s===l){let a=1;(l>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(a=Math.abs(l*.05)),r(l+a),e||o(s-a)}this.min=s,this.max=l}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),t=t||11),t&&(s=Math.min(t,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},l=this._range||this,o=p4(s,l);return e.bounds==="ticks"&&jb(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const s=(i-t)/Math.max(e.length-1,1)/2;t-=s,i+=s}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return Il(e,this.chart.options.locale,this.options.ticks.format)}}class su extends Fo{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?e:0,this.max=Yt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=ni(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}su.id="linear";su.defaults={ticks:{callback:Qo.formatters.numeric}};function yc(n){return n/Math.pow(10,Math.floor(Wn(n)))===1}function h4(n,e){const t=Math.floor(Wn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Hn(n.min,Math.pow(10,Math.floor(Wn(e.min)))),o=Math.floor(Wn(l)),r=Math.floor(l/Math.pow(10,o)),a=o<0?Math.pow(10,Math.abs(o)):1;do s.push({value:l,major:yc(l)}),++r,r===10&&(r=1,++o,a=o>=0?1:a),l=Math.round(r*Math.pow(10,o)*a)/a;while(o0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Yt(e)?Math.max(0,e):null,this.max=Yt(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,s=this.max;const l=a=>i=e?i:a,o=a=>s=t?s:a,r=(a,u)=>Math.pow(10,Math.floor(Wn(a))+u);i===s&&(i<=0?(l(1),o(10)):(l(r(i,-1)),o(r(s,1)))),i<=0&&l(r(s,-1)),s<=0&&o(r(i,1)),this._zero&&this.min!==this._suggestedMin&&i===r(this.min,0)&&l(r(i,-1)),this.min=i,this.max=s}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=h4(t,this);return e.bounds==="ticks"&&jb(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":Il(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=Wn(e),this._valueRange=Wn(this.max)-Wn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Wn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}A1.id="logarithmic";A1.defaults={ticks:{callback:Qo.formatters.logarithmic,major:{enabled:!0}}};function ha(n){const e=n.ticks;if(e.display&&n.display){const t=Gn(e.backdropPadding);return at(e.font&&e.font.size,ut.font.size)+t.height}return 0}function m4(n,e,t){return t=Pt(t)?t:[t],{w:z2(n,e.string,t),h:t.length*e.lineHeight}}function kc(n,e,t,i,s){return n===i||n===s?{start:e-t/2,end:e+t/2}:ns?{start:e-t,end:e}:{start:e,end:e+t}}function g4(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),i=[],s=[],l=n._pointLabels.length,o=n.options.pointLabels,r=o.centerPointLabels?Ut/l:0;for(let a=0;ae.r&&(r=(i.end-e.r)/l,n.r=Math.max(n.r,e.r+r)),s.starte.b&&(a=(s.end-e.b)/o,n.b=Math.max(n.b,e.b+a))}function b4(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ha(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Ut/s:0;for(let u=0;u270||t<90)&&(n-=e),n}function w4(n,e){const{ctx:t,options:{pointLabels:i}}=n;for(let s=e-1;s>=0;s--){const l=i.setContext(n.getPointLabelContext(s)),o=An(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:m}=l;if(!bt(m)){const g=Ts(l.borderRadius),_=Gn(l.backdropPadding);t.fillStyle=m;const y=f-_.left,S=c-_.top,C=d-f+_.width,T=h-c+_.height;Object.values(g).some($=>$!==0)?(t.beginPath(),Ao(t,{x:y,y:S,w:C,h:T,radius:g}),t.fill()):t.fillRect(y,S,C,T)}Do(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function I1(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,wt);else{let l=n.getPointPosition(0,e);s.moveTo(l.x,l.y);for(let o=1;o{const s=Vt(this.options.pointLabels.callback,[t,i],this);return s||s===0?s:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?g4(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,s){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,s))}getIndexAngle(e){const t=wt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Dn(e*t+ni(i))}getDistanceFromCenterForValue(e){if(bt(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(bt(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e{if(f!==0){r=this.getDistanceFromCenterForValue(u.value);const c=s.setContext(this.getContext(f-1));S4(this,c,r,l)}}),i.display){for(e.save(),o=l-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:f,lineWidth:c}=u;!c||!f||(e.lineWidth=c,e.strokeStyle=f,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,r=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),a=this.getPointPosition(o,r),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(a.x,a.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let l,o;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(s),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,a)=>{if(a===0&&!t.reverse)return;const u=i.setContext(this.getContext(a)),f=An(u.font);if(l=this.getDistanceFromCenterForValue(this.ticks[a].value),u.showLabelBackdrop){e.font=f.string,o=e.measureText(r.label).width,e.fillStyle=u.backdropColor;const c=Gn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Do(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}er.id="radialLinear";er.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Qo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};er.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};er.descriptors={angleLines:{_fallback:"grid"}};const tr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},kn=Object.keys(tr);function C4(n,e){return n-e}function wc(n,e){if(bt(e))return null;const t=n._adapter,{parser:i,round:s,isoWeekday:l}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),Yt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ds(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function Sc(n,e,t,i){const s=kn.length;for(let l=kn.indexOf(n);l=kn.indexOf(t);l--){const o=kn[l];if(tr[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return kn[t?kn.indexOf(t):0]}function M4(n){for(let e=kn.indexOf(n)+1,t=kn.length;e=e?t[i]:t[s];n[l]=!0}}function O4(n,e,t,i){const s=n._adapter,l=+s.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=l;r<=o;r=+s.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Cc(n,e,t){const i=[],s={},l=e.length;let o,r;for(o=0;o+e.value))}initOffsets(e){let t=0,i=0,s,l;this.options.offset&&e.length&&(s=this.getDecimalForValue(e[0]),e.length===1?t=1-s:t=(this.getDecimalForValue(e[1])-s)/2,l=this.getDecimalForValue(e[e.length-1]),e.length===1?i=l:i=(l-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=mn(t,0,o),i=mn(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||Sc(l.minUnit,t,i,this._getLabelCapacity(t)),r=at(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Ds(a)||a===!0,f={};let c=t,d,h;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const m=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,h=0;dg-_).map(g=>+g)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}_tickFormatFunction(e,t,i,s){const l=this.options,o=l.time.displayFormats,r=this._unit,a=this._majorUnit,u=r&&o[r],f=a&&o[a],c=i[t],d=a&&f&&c&&c.major,h=this._adapter.format(e,s||(d?f:u)),m=l.ticks.callback;return m?Vt(m,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,i=s.length;t=n[i].pos&&e<=n[s].pos&&({lo:i,hi:s}=is(n,"pos",e)),{pos:l,time:r}=n[i],{pos:o,time:a}=n[s]):(e>=n[i].time&&e<=n[s].time&&({lo:i,hi:s}=is(n,"time",e)),{time:l,pos:r}=n[i],{time:o,pos:a}=n[s]);const u=o-l;return u?r+(a-r)*(e-l)/u:r}class L1 extends Nl{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=no(t,this.min),this._tableRange=no(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,s=[],l=[];let o,r,a,u,f;for(o=0,r=e.length;o=t&&u<=i&&s.push(u);if(s.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=s.length;o{i&&(t||(t=He(e,Qt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,Qt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function D4(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=W(n[1]),t=E(),s=W(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&(k(e),k(t),k(s))}}}function A4(n){let e;return{c(){e=W("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function I4(n){let e,t,i,s,l,o=n[2]&&$c();function r(f,c){return f[2]?A4:D4}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=E(),i=v("canvas"),s=E(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),zr(i,"height","250px"),zr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=$c(),o.c(),A(o,1),o.m(e,t)):o&&(re(),L(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){L(o)},d(f){f&&(k(e),k(s),k(l)),o&&o.d(),n[8](null),u.d()}}}function L4(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),ce.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let m of h)r.push({x:new Date(m.date),y:m.total}),t(1,a+=m.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),ce.error(h,(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Kt(()=>(No.register(Yi,xo,Xo,su,Nl,t4,u4),t(6,o=new No(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){te[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class P4 extends be{constructor(e){super(),_e(this,e,L4,I4,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Mc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N4(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var P1={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/** - * Prism: Lightweight, robust, elegant syntax highlighting - * - * @license MIT - * @author Lea Verou - * @namespace - * @public - */var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&").replace(/"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch($){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec($.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var T in C)if(C[T].src==S)return C[T]}return null}},isActive:function(S,C,T){for(var $="no-"+C;S;){var M=S.classList;if(M.contains(C))return!0;if(M.contains($))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,C){var T=r.util.clone(r.languages[S]);for(var $ in C)T[$]=C[$];return T},insertBefore:function(S,C,T,$){$=$||r.languages;var M=$[S],O={};for(var D in M)if(M.hasOwnProperty(D)){if(D==C)for(var I in T)T.hasOwnProperty(I)&&(O[I]=T[I]);T.hasOwnProperty(D)||(O[D]=M[D])}var N=$[S];return $[S]=O,r.languages.DFS(r.languages,function(P,F){F===N&&P!=S&&(this[P]=O)}),O},DFS:function S(C,T,$,M){M=M||{};var O=r.util.objId;for(var D in C)if(C.hasOwnProperty(D)){T.call(C,D,C[D],$||D);var I=C[D],N=r.util.type(I);N==="Object"&&!M[O(I)]?(M[O(I)]=!0,S(I,T,null,M)):N==="Array"&&!M[O(I)]&&(M[O(I)]=!0,S(I,T,D,M))}}},plugins:{},highlightAll:function(S,C){r.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,T){var $={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",$),$.elements=Array.prototype.slice.apply($.container.querySelectorAll($.selector)),r.hooks.run("before-all-elements-highlight",$);for(var M=0,O;O=$.elements[M++];)r.highlightElement(O,C===!0,$.callback)},highlightElement:function(S,C,T){var $=r.util.getLanguage(S),M=r.languages[$];r.util.setLanguage(S,$);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,$);var D=S.textContent,I={element:S,language:$,grammar:M,code:D};function N(F){I.highlightedCode=F,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),T&&T.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),T&&T.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){N(r.util.encode(I.code));return}if(C&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(F){N(F.data)},P.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else N(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,C,T){var $={code:S,grammar:C,language:T};if(r.hooks.run("before-tokenize",$),!$.grammar)throw new Error('The language "'+$.language+'" has no grammar.');return $.tokens=r.tokenize($.code,$.grammar),r.hooks.run("after-tokenize",$),a.stringify(r.util.encode($.tokens),$.language)},tokenize:function(S,C){var T=C.rest;if(T){for(var $ in T)C[$]=T[$];delete C.rest}var M=new c;return d(M,M.head,S),f(S,M,C,M.head,0),m(M)},hooks:{all:{},add:function(S,C){var T=r.hooks.all;T[S]=T[S]||[],T[S].push(C)},run:function(S,C){var T=r.hooks.all[S];if(!(!T||!T.length))for(var $=0,M;M=T[$++];)M(C)}},Token:a};i.Prism=r;function a(S,C,T,$){this.type=S,this.content=C,this.alias=T,this.length=($||"").length|0}a.stringify=function S(C,T){if(typeof C=="string")return C;if(Array.isArray(C)){var $="";return C.forEach(function(N){$+=S(N,T)}),$}var M={type:C.type,content:S(C.content,T),tag:"span",classes:["token",C.type],attributes:{},language:T},O=C.alias;O&&(Array.isArray(O)?Array.prototype.push.apply(M.classes,O):M.classes.push(O)),r.hooks.run("wrap",M);var D="";for(var I in M.attributes)D+=" "+I+'="'+(M.attributes[I]||"").replace(/"/g,""")+'"';return"<"+M.tag+' class="'+M.classes.join(" ")+'"'+D+">"+M.content+""};function u(S,C,T,$){S.lastIndex=C;var M=S.exec(T);if(M&&$&&M[1]){var O=M[1].length;M.index+=O,M[0]=M[0].slice(O)}return M}function f(S,C,T,$,M,O){for(var D in T)if(!(!T.hasOwnProperty(D)||!T[D])){var I=T[D];I=Array.isArray(I)?I:[I];for(var N=0;N=O.reach);U+=J.value.length,J=J.next){var oe=J.value;if(C.length>S.length)return;if(!(oe instanceof a)){var ee=1,se;if(q){if(se=u(X,U,S,R),!se||se.index>=S.length)break;var We=se.index,Ee=se.index+se[0].length,qe=U;for(qe+=J.value.length;We>=qe;)J=J.next,qe+=J.value.length;if(qe-=J.value.length,U=qe,J.value instanceof a)continue;for(var Ve=J;Ve!==C.tail&&(qeO.reach&&(O.reach=dt);var Se=J.prev;Me&&(Se=d(C,Se,Me),U+=Me.length),h(C,Se,ee);var we=new a(D,F?r.tokenize(ke,F):ke,B,ke);if(J=d(C,Se,we),Je&&d(C,J,Je),ee>1){var Ue={cause:D+","+N,reach:dt};f(S,C,T,J.prev,U,Ue),O&&Ue.reach>O.reach&&(O.reach=Ue.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},C={value:null,prev:S,next:null};S.next=C,this.head=S,this.tail=C,this.length=0}function d(S,C,T){var $=C.next,M={value:T,prev:C,next:$};return C.next=M,$.prev=M,S.length++,M}function h(S,C,T){for(var $=C.next,M=0;M/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.replace(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,l){var o={};o["language-"+l]={pattern:/(^$)/i,lookbehind:!0,inside:t.languages[l]},o.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:o}};r["language-"+l]={pattern:/[\s\S]+/,inside:t.languages[l]};var a={};a[s]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:r},t.languages.insertBefore("markup","cdata",a)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(i,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+i+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,function(i){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;i.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},i.languages.css.atrule.inside.rest=i.languages.css;var l=i.languages.markup;l&&(l.tag.addInlined("style","css"),l.tag.addAttribute("style","css"))}(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var i="Loading…",s=function(g,_){return"✖ Error "+g+" while fetching file: "+_},l="✖ Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(g,_,y){var S=new XMLHttpRequest;S.open("GET",g,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?_(S.responseText):S.status>=400?y(s(S.status,S.statusText)):y(l))},S.send(null)}function h(g){var _=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(_){var y=Number(_[1]),S=_[2],C=_[3];return S?C?[y,Number(C)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(g){g.selector+=", "+c}),t.hooks.add("before-sanity-check",function(g){var _=g.element;if(_.matches(c)){g.code="",_.setAttribute(r,a);var y=_.appendChild(document.createElement("CODE"));y.textContent=i;var S=_.getAttribute("data-src"),C=g.language;if(C==="none"){var T=(/\.(\w+)$/.exec(S)||[,"none"])[1];C=o[T]||T}t.util.setLanguage(y,C),t.util.setLanguage(_,C);var $=t.plugins.autoloader;$&&$.loadLanguages(C),d(S,function(M){_.setAttribute(r,u);var O=h(_.getAttribute("data-range"));if(O){var D=M.split(/\r\n?|\n/g),I=O[0],N=O[1]==null?D.length:O[1];I<0&&(I+=D.length),I=Math.max(0,Math.min(I-1,D.length)),N<0&&(N+=D.length),N=Math.max(0,Math.min(N,D.length)),M=D.slice(I,N).join(` -`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(I+1))}y.textContent=M,t.highlightElement(y)},function(M){_.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};var m=!1;t.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(P1);var F4=P1.exports;const Qs=N4(F4);var R4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;ar&&(f[d]=` -`+f[d],c=h)}a[u]=f.join("")}return a.join(` -`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",m="",g=!1,_=0;_>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function q4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function j4(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Qs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Qs.highlight(a,Qs.languages[l]||Qs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Qs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class N1 extends be{constructor(e){super(),_e(this,e,j4,q4,me,{class:0,content:2,language:3})}}const H4=n=>({}),Oc=n=>({}),V4=n=>({}),Ec=n=>({});function Dc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C=n[4]&&!n[2]&&Ac(n);const T=n[19].header,$=Tt(T,n,n[18],Ec);let M=n[4]&&n[2]&&Ic(n);const O=n[19].default,D=Tt(O,n,n[18],null),I=n[19].footer,N=Tt(I,n,n[18],Oc);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),C&&C.c(),r=E(),$&&$.c(),a=E(),M&&M.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),N&&N.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),p(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(P,F){w(P,e,F),b(e,t),b(e,s),b(e,l),b(l,o),C&&C.m(o,null),b(o,r),$&&$.m(o,null),b(o,a),M&&M.m(o,null),b(l,u),b(l,f),D&&D.m(f,null),n[21](f),b(l,c),b(l,d),N&&N.m(d,null),_=!0,y||(S=[Y(t,"click",Ze(n[20])),Y(f,"scroll",n[22])],y=!0)},p(P,F){n=P,n[4]&&!n[2]?C?(C.p(n,F),F[0]&20&&A(C,1)):(C=Ac(n),C.c(),A(C,1),C.m(o,r)):C&&(re(),L(C,1,1,()=>{C=null}),ae()),$&&$.p&&(!_||F[0]&262144)&&$t($,T,n,n[18],_?Ct(T,n[18],F,V4):Mt(n[18]),Ec),n[4]&&n[2]?M?M.p(n,F):(M=Ic(n),M.c(),M.m(o,null)):M&&(M.d(1),M=null),D&&D.p&&(!_||F[0]&262144)&&$t(D,O,n,n[18],_?Ct(O,n[18],F,null):Mt(n[18]),null),N&&N.p&&(!_||F[0]&262144)&&$t(N,I,n,n[18],_?Ct(I,n[18],F,H4):Mt(n[18]),Oc),(!_||F[0]&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),(!_||F[0]&262)&&Q(l,"popup",n[2]),(!_||F[0]&4)&&Q(e,"padded",n[2]),(!_||F[0]&1)&&Q(e,"active",n[0])},i(P){_||(P&&xe(()=>{_&&(i||(i=He(t,hl,{duration:Ni,opacity:0},!0)),i.run(1))}),A(C),A($,P),A(D,P),A(N,P),P&&xe(()=>{_&&(g&&g.end(1),m=M_(l,mi,n[2]?{duration:Ni,y:-10}:{duration:Ni,x:50}),m.start())}),_=!0)},o(P){P&&(i||(i=He(t,hl,{duration:Ni,opacity:0},!1)),i.run(0)),L(C),L($,P),L(D,P),L(N,P),m&&m.invalidate(),P&&(g=ka(l,mi,n[2]?{duration:Ni,y:10}:{duration:Ni,x:50})),_=!1},d(P){P&&k(e),P&&i&&i.end(),C&&C.d(),$&&$.d(P),M&&M.d(),D&&D.d(P),n[21](null),N&&N.d(P),P&&g&&g.end(),y=!1,$e(S)}}}function Ac(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",Ze(n[5])),s=!0)},p(o,r){n=o},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,hl,{duration:Ni},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,hl,{duration:Ni},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Ic(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[5])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function z4(n){let e,t,i,s,l=n[0]&&Dc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[23](e),t=!0,i||(s=[Y(window,"resize",n[10]),Y(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?l?(l.p(o,r),r[0]&1&&A(l,1)):(l=Dc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[23](null),i=!1,$e(s)}}}let Qi,Dr=[];function F1(){return Qi=Qi||document.querySelector(".overlays"),Qi||(Qi=document.createElement("div"),Qi.classList.add("overlays"),document.body.appendChild(Qi)),Qi}let Ni=150;function Lc(){return 1e3+F1().querySelectorAll(".overlay-panel-container.active").length}function B4(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const h=pt(),m="op_"+j.randomString(10);let g,_,y,S,C="",T=o;function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function M(){typeof d=="function"&&d()===!1||t(0,o=!1)}function O(){return o}async function D(U){t(17,T=U),U?(y=document.activeElement,h("show"),g==null||g.focus()):(clearTimeout(S),h("hide"),y==null||y.focus()),await ln(),I()}function I(){g&&(o?t(6,g.style.zIndex=Lc(),g):t(6,g.style="",g))}function N(){j.pushUnique(Dr,m),document.body.classList.add("overlay-active")}function P(){j.removeByValue(Dr,m),Dr.length||document.body.classList.remove("overlay-active")}function F(U){o&&f&&U.code=="Escape"&&!j.isInput(U.target)&&g&&g.style.zIndex==Lc()&&(U.preventDefault(),M())}function R(U){o&&q(_)}function q(U,oe){oe&&t(8,C=""),!(!U||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!U)return;if(U.scrollHeight-U.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}U.scrollTop==0?t(8,C+=" scroll-top-reached"):U.scrollTop+U.offsetHeight==U.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100))}Kt(()=>(F1().appendChild(g),()=>{var U;clearTimeout(S),P(),(U=g==null?void 0:g.classList)==null||U.add("hidden"),setTimeout(()=>{g==null||g.remove()},0)}));const B=()=>a?M():!0;function Z(U){te[U?"unshift":"push"](()=>{_=U,t(7,_)})}const X=U=>q(U.target);function J(U){te[U?"unshift":"push"](()=>{g=U,t(6,g)})}return n.$$set=U=>{"class"in U&&t(1,l=U.class),"active"in U&&t(0,o=U.active),"popup"in U&&t(2,r=U.popup),"overlayClose"in U&&t(3,a=U.overlayClose),"btnClose"in U&&t(4,u=U.btnClose),"escClose"in U&&t(12,f=U.escClose),"beforeOpen"in U&&t(13,c=U.beforeOpen),"beforeHide"in U&&t(14,d=U.beforeHide),"$$scope"in U&&t(18,s=U.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&T!=o&&D(o),n.$$.dirty[0]&128&&q(_,!0),n.$$.dirty[0]&64&&g&&I(),n.$$.dirty[0]&1&&(o?N():P())},[o,l,r,a,u,M,g,_,C,F,R,q,f,c,d,$,O,T,s,i,B,Z,X,J]}class rn extends be{constructor(e){super(),_e(this,e,B4,z4,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function U4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function W4(n){let e,t=n[2].referer+"",i,s;return{c(){e=v("a"),i=W(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&le(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function Y4(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function K4(n){let e,t,i;return t=new N1({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&4&&(o.content=JSON.stringify(s[2].meta,null,2)),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function J4(n){var Pe;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,m,g=n[2].status+"",_,y,S,C,T,$,M=((Pe=n[2].method)==null?void 0:Pe.toUpperCase())+"",O,D,I,N,P,F,R=n[2].auth+"",q,B,Z,X,J,U,oe=n[2].url+"",ee,se,Ee,qe,Ve,We,ke,Me,Je,dt,Se,we=n[2].remoteIp+"",Ue,nt,ne,Ne,Te,ot,At=n[2].userIp+"",nn,sn,an,Nn,_i,Fn,Ie=n[2].userAgent+"",Ot,oi,cn,Xn,Ai,Cn,Qn,en,et,ue,De,Xe,Jt,it,It,Lt;function Rn(Fe,Ae){return Fe[2].referer?W4:U4}let K=Rn(n),G=K(n);const ie=[K4,Y4],fe=[];function Oe(Fe,Ae){return Ae&4&&(Qn=null),Qn==null&&(Qn=!j.isEmpty(Fe[2].meta)),Qn?0:1}return en=Oe(n,-1),et=fe[en]=ie[en](n),It=new $i({props:{date:n[2].created}}),{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="ID",l=E(),o=v("td"),a=W(r),u=E(),f=v("tr"),c=v("td"),c.textContent="Status",d=E(),h=v("td"),m=v("span"),_=W(g),y=E(),S=v("tr"),C=v("td"),C.textContent="Method",T=E(),$=v("td"),O=W(M),D=E(),I=v("tr"),N=v("td"),N.textContent="Auth",P=E(),F=v("td"),q=W(R),B=E(),Z=v("tr"),X=v("td"),X.textContent="URL",J=E(),U=v("td"),ee=W(oe),se=E(),Ee=v("tr"),qe=v("td"),qe.textContent="Referer",Ve=E(),We=v("td"),G.c(),ke=E(),Me=v("tr"),Je=v("td"),Je.textContent="Remote IP",dt=E(),Se=v("td"),Ue=W(we),nt=E(),ne=v("tr"),Ne=v("td"),Ne.textContent="User IP",Te=E(),ot=v("td"),nn=W(At),sn=E(),an=v("tr"),Nn=v("td"),Nn.textContent="UserAgent",_i=E(),Fn=v("td"),Ot=W(Ie),oi=E(),cn=v("tr"),Xn=v("td"),Xn.textContent="Meta",Ai=E(),Cn=v("td"),et.c(),ue=E(),De=v("tr"),Xe=v("td"),Xe.textContent="Created",Jt=E(),it=v("td"),z(It.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(m,"class","label"),Q(m,"label-danger",n[2].status>=400),p(C,"class","min-width txt-hint txt-bold"),p(N,"class","min-width txt-hint txt-bold"),p(X,"class","min-width txt-hint txt-bold"),p(qe,"class","min-width txt-hint txt-bold"),p(Je,"class","min-width txt-hint txt-bold"),p(Ne,"class","min-width txt-hint txt-bold"),p(Nn,"class","min-width txt-hint txt-bold"),p(Xn,"class","min-width txt-hint txt-bold"),p(Xe,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Fe,Ae){w(Fe,e,Ae),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(o,a),b(t,u),b(t,f),b(f,c),b(f,d),b(f,h),b(h,m),b(m,_),b(t,y),b(t,S),b(S,C),b(S,T),b(S,$),b($,O),b(t,D),b(t,I),b(I,N),b(I,P),b(I,F),b(F,q),b(t,B),b(t,Z),b(Z,X),b(Z,J),b(Z,U),b(U,ee),b(t,se),b(t,Ee),b(Ee,qe),b(Ee,Ve),b(Ee,We),G.m(We,null),b(t,ke),b(t,Me),b(Me,Je),b(Me,dt),b(Me,Se),b(Se,Ue),b(t,nt),b(t,ne),b(ne,Ne),b(ne,Te),b(ne,ot),b(ot,nn),b(t,sn),b(t,an),b(an,Nn),b(an,_i),b(an,Fn),b(Fn,Ot),b(t,oi),b(t,cn),b(cn,Xn),b(cn,Ai),b(cn,Cn),fe[en].m(Cn,null),b(t,ue),b(t,De),b(De,Xe),b(De,Jt),b(De,it),H(It,it,null),Lt=!0},p(Fe,Ae){var Ke;(!Lt||Ae&4)&&r!==(r=Fe[2].id+"")&&le(a,r),(!Lt||Ae&4)&&g!==(g=Fe[2].status+"")&&le(_,g),(!Lt||Ae&4)&&Q(m,"label-danger",Fe[2].status>=400),(!Lt||Ae&4)&&M!==(M=((Ke=Fe[2].method)==null?void 0:Ke.toUpperCase())+"")&&le(O,M),(!Lt||Ae&4)&&R!==(R=Fe[2].auth+"")&&le(q,R),(!Lt||Ae&4)&&oe!==(oe=Fe[2].url+"")&&le(ee,oe),K===(K=Rn(Fe))&&G?G.p(Fe,Ae):(G.d(1),G=K(Fe),G&&(G.c(),G.m(We,null))),(!Lt||Ae&4)&&we!==(we=Fe[2].remoteIp+"")&&le(Ue,we),(!Lt||Ae&4)&&At!==(At=Fe[2].userIp+"")&&le(nn,At),(!Lt||Ae&4)&&Ie!==(Ie=Fe[2].userAgent+"")&&le(Ot,Ie);let Qe=en;en=Oe(Fe,Ae),en===Qe?fe[en].p(Fe,Ae):(re(),L(fe[Qe],1,1,()=>{fe[Qe]=null}),ae(),et=fe[en],et?et.p(Fe,Ae):(et=fe[en]=ie[en](Fe),et.c()),A(et,1),et.m(Cn,null));const ze={};Ae&4&&(ze.date=Fe[2].created),It.$set(ze)},i(Fe){Lt||(A(et),A(It.$$.fragment,Fe),Lt=!0)},o(Fe){L(et),L(It.$$.fragment,Fe),Lt=!1},d(Fe){Fe&&k(e),G.d(),fe[en].d(),V(It)}}}function G4(n){let e;return{c(){e=v("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Z4(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Close',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[4]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function X4(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[Z4],header:[G4],default:[J4]},$$scope:{ctx:n}};return e=new rn({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&260&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function Q4(n,e,t){let i,s={};function l(c){return t(2,s=c),i==null?void 0:i.show()}function o(){return i==null?void 0:i.hide()}const r=()=>o();function a(c){te[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){Re.call(this,n,c)}function f(c){Re.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class x4 extends be{constructor(e){super(),_e(this,e,Q4,X4,me,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function eT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},m(u,f){w(u,e,f),e.checked=n[1],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[10]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&2&&(e.checked=u[1]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Pc(n){let e,t;return e=new P4({props:{filter:n[4],presets:n[5]}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Nc(n){let e,t;return e=new xk({props:{filter:n[4],presets:n[5]}}),e.$on("select",n[12]),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&16&&(l.filter=i[4]),s&32&&(l.presets=i[5]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function tT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S=n[3],C,T=n[3],$,M;r=new Jo({}),r.$on("refresh",n[9]),d=new ge({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[eT,({uniqueId:I})=>({14:I}),({uniqueId:I})=>I?16384:0]},$$scope:{ctx:n}}}),m=new Dl({props:{value:n[0],placeholder:"Search term or filter like status >= 400",extraAutocompleteKeys:n[7]}}),m.$on("submit",n[11]);let O=Pc(n),D=Nc(n);return{c(){e=v("div"),t=v("header"),i=v("nav"),s=v("div"),l=W(n[6]),o=E(),z(r.$$.fragment),a=E(),u=v("div"),f=E(),c=v("div"),z(d.$$.fragment),h=E(),z(m.$$.fragment),g=E(),_=v("div"),y=E(),O.c(),C=E(),D.c(),$=ye(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(_,"class","clearfix m-b-base"),p(e,"class","page-header-wrapper m-b-0")},m(I,N){w(I,e,N),b(e,t),b(t,i),b(i,s),b(s,l),b(t,o),H(r,t,null),b(t,a),b(t,u),b(t,f),b(t,c),H(d,c,null),b(e,h),H(m,e,null),b(e,g),b(e,_),b(e,y),O.m(e,null),w(I,C,N),D.m(I,N),w(I,$,N),M=!0},p(I,N){(!M||N&64)&&le(l,I[6]);const P={};N&49154&&(P.$$scope={dirty:N,ctx:I}),d.$set(P);const F={};N&1&&(F.value=I[0]),m.$set(F),N&8&&me(S,S=I[3])?(re(),L(O,1,1,x),ae(),O=Pc(I),O.c(),A(O,1),O.m(e,null)):O.p(I,N),N&8&&me(T,T=I[3])?(re(),L(D,1,1,x),ae(),D=Nc(I),D.c(),A(D,1),D.m($.parentNode,$)):D.p(I,N)},i(I){M||(A(r.$$.fragment,I),A(d.$$.fragment,I),A(m.$$.fragment,I),A(O),A(D),M=!0)},o(I){L(r.$$.fragment,I),L(d.$$.fragment,I),L(m.$$.fragment,I),L(O),L(D),M=!1},d(I){I&&(k(e),k(C),k($)),V(r),V(d),V(m),O.d(I),D.d(I)}}}function nT(n){let e,t,i,s;e=new Tn({props:{$$slots:{default:[tT]},$$scope:{ctx:n}}});let l={};return i=new x4({props:l}),n[13](i),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&32895&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[13](null),V(i,o)}}}const Fc="includeAdminLogs";function iT(n,e,t){var y;let i,s,l;Ge(n,Ft,S=>t(6,l=S));const o=["method","url","remoteIp","userIp","referer","status","auth","userAgent","created"];un(Ft,l="Request logs",l);let r,a="",u=((y=window.localStorage)==null?void 0:y.getItem(Fc))<<0,f=1;function c(){t(3,f++,f)}const d=()=>c();function h(){u=this.checked,t(1,u)}const m=S=>t(0,a=S.detail),g=S=>r==null?void 0:r.show(S==null?void 0:S.detail);function _(S){te[S?"unshift":"push"](()=>{r=S,t(2,r)})}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=u?"":'auth!="admin"'),n.$$.dirty&2&&typeof u<"u"&&window.localStorage&&window.localStorage.setItem(Fc,u<<0),n.$$.dirty&1&&t(4,s=j.normalizeSearchFilter(a,o))},[a,u,r,f,s,i,l,o,c,d,h,m,g,_]}class sT extends be{constructor(e){super(),_e(this,e,iT,nT,me,{})}}function lT(n){let e,t,i;return{c(){e=v("span"),p(e,"class","dragline svelte-1g2t3dj"),Q(e,"dragging",n[1])},m(s,l){w(s,e,l),n[4](e),t||(i=[Y(e,"mousedown",n[5]),Y(e,"touchstart",n[2])],t=!0)},p(s,[l]){l&2&&Q(e,"dragging",s[1])},i:x,o:x,d(s){s&&k(e),n[4](null),t=!1,$e(i)}}}function oT(n,e,t){const i=pt();let{tolerance:s=0}=e,l,o=0,r=0,a=0,u=0,f=!1;function c(_){_.stopPropagation(),o=_.clientX,r=_.clientY,a=_.clientX-l.offsetLeft,u=_.clientY-l.offsetTop,document.addEventListener("touchmove",h),document.addEventListener("mousemove",h),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(_){f&&(_.preventDefault(),t(1,f=!1),l.classList.remove("no-pointer-events"),i("dragstop",{event:_,elem:l})),document.removeEventListener("touchmove",h),document.removeEventListener("mousemove",h),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function h(_){let y=_.clientX-o,S=_.clientY-r,C=_.clientX-a,T=_.clientY-u;!f&&Math.abs(C-l.offsetLeft){l=_,t(0,l)})}const g=_=>{_.button==0&&c(_)};return n.$$set=_=>{"tolerance"in _&&t(3,s=_.tolerance)},[l,f,c,s,m,g]}class rT extends be{constructor(e){super(),_e(this,e,oT,lT,me,{tolerance:3})}}function aT(n){let e,t,i,s,l;const o=n[5].default,r=Tt(o,n,n[4],null);return s=new rT({}),s.$on("dragstart",n[7]),s.$on("dragging",n[8]),s.$on("dragstop",n[9]),{c(){e=v("aside"),r&&r.c(),i=E(),z(s.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),H(s,a,u),l=!0},p(a,[u]){r&&r.p&&(!l||u&16)&&$t(r,o,a,a[4],l?Ct(o,a[4],u,null):Mt(a[4]),null),(!l||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){l||(A(r,a),A(s.$$.fragment,a),l=!0)},o(a){L(r,a),L(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(i)),r&&r.d(a),n[6](null),V(s,a)}}}const Rc="@adminSidebarWidth";function uT(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,o,r,a=localStorage.getItem(Rc)||null;function u(h){te[h?"unshift":"push"](()=>{o=h,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=h=>{t(2,a=r+h.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=h=>{"class"in h&&t(0,l=h.class),"$$scope"in h&&t(4,s=h.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Rc,a))},[l,o,a,r,s,i,u,f,c,d]}class R1 extends be{constructor(e){super(),_e(this,e,uT,aT,me,{class:0})}}const lu=Ln({});function _n(n,e,t){lu.set({text:n,yesCallback:e,noCallback:t})}function q1(){lu.set({})}function qc(n){let e,t,i;const s=n[17].default,l=Tt(s,n,n[16],null);return{c(){e=v("div"),l&&l.c(),p(e,"class",n[1]),Q(e,"active",n[0])},m(o,r){w(o,e,r),l&&l.m(e,null),n[18](e),i=!0},p(o,r){l&&l.p&&(!i||r&65536)&&$t(l,s,o,o[16],i?Ct(s,o[16],r,null):Mt(o[16]),null),(!i||r&2)&&p(e,"class",o[1]),(!i||r&3)&&Q(e,"active",o[0])},i(o){i||(A(l,o),o&&xe(()=>{i&&(t||(t=He(e,mi,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=He(e,mi,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),n[18](null),o&&t&&t.end()}}}function fT(n){let e,t,i,s,l=n[0]&&qc(n);return{c(){e=v("div"),l&&l.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),l&&l.m(e,null),n[19](e),t=!0,i||(s=[Y(window,"mousedown",n[5]),Y(window,"click",n[6]),Y(window,"keydown",n[4]),Y(window,"focusin",n[7])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=qc(o),l.c(),A(l,1),l.m(e,null)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[19](null),i=!1,$e(s)}}}function cT(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,h,m,g=!1;const _=pt();function y(){t(0,o=!1),g=!1,clearTimeout(m)}function S(){t(0,o=!0),clearTimeout(m),m=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180)}function C(){o?y():S()}function T(B){return!c||B.classList.contains(u)||(h==null?void 0:h.contains(B))&&!c.contains(B)||c.contains(B)&&B.closest&&B.closest("."+u)}function $(B){(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function M(B){(B.code==="Enter"||B.code==="Space")&&(!o||T(B.target))&&(B.preventDefault(),B.stopPropagation(),C())}function O(B){o&&r&&B.code==="Escape"&&(B.preventDefault(),y())}function D(B){o&&!(c!=null&&c.contains(B.target))?g=!0:g&&(g=!1)}function I(B){var Z;o&&g&&!(c!=null&&c.contains(B.target))&&!(h!=null&&h.contains(B.target))&&!((Z=B.target)!=null&&Z.closest(".flatpickr-calendar"))&&y()}function N(B){D(B),I(B)}function P(B){F(),c==null||c.addEventListener("click",$),t(15,h=B||(c==null?void 0:c.parentNode)),h==null||h.addEventListener("click",$),h==null||h.addEventListener("keydown",M)}function F(){clearTimeout(m),c==null||c.removeEventListener("click",$),h==null||h.removeEventListener("click",$),h==null||h.removeEventListener("keydown",M)}Kt(()=>(P(),()=>F()));function R(B){te[B?"unshift":"push"](()=>{d=B,t(3,d)})}function q(B){te[B?"unshift":"push"](()=>{c=B,t(2,c)})}return n.$$set=B=>{"trigger"in B&&t(8,l=B.trigger),"active"in B&&t(0,o=B.active),"escClose"in B&&t(9,r=B.escClose),"autoScroll"in B&&t(10,a=B.autoScroll),"closableClass"in B&&t(11,u=B.closableClass),"class"in B&&t(1,f=B.class),"$$scope"in B&&t(16,s=B.$$scope)},n.$$.update=()=>{var B,Z;n.$$.dirty&260&&c&&P(l),n.$$.dirty&32769&&(o?((B=h==null?void 0:h.classList)==null||B.add("active"),_("show")):((Z=h==null?void 0:h.classList)==null||Z.remove("active"),_("hide")))},[o,f,c,d,O,D,I,N,l,r,a,u,y,S,C,h,s,i,R,q]}class Pn extends be{constructor(e){super(),_e(this,e,cT,fT,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hide:12,show:13,toggle:14})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}get toggle(){return this.$$.ctx[14]}}function jc(n,e,t){const i=n.slice();return i[27]=e[t],i}function dT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("input"),s=E(),l=v("label"),o=W("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(l,"for",r=n[30])},m(f,c){w(f,e,c),w(f,s,c),w(f,l,c),b(l,o),a||(u=Y(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(l,"for",r)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function pT(n){let e,t,i,s;function l(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=Nt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){re();const c=e;L(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}o?(e=Nt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],ve(()=>t=!1)),e.$set(c)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function hT(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function mT(n){let e,t,i,s;const l=[hT,pT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Hc(n){let e,t,i,s=pe(n[10]),l=[];for(let o=0;o({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ge({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[mT,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Hc(n);return{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),r&&r.c(),l=ye()},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Hc(a),r.c(),r.m(l.parentNode,l)):r&&(r.d(1),r=null)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s),k(l)),V(e,a),V(i,a),r&&r.d(a)}}}function _T(n){let e,t=n[5]?"Update":"Create",i,s;return{c(){e=v("h4"),i=W(t),s=W(" index")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o[0]&32&&t!==(t=l[5]?"Update":"Create")&&le(i,t)},d(l){l&&k(e)}}}function zc(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(s,l){w(s,e,l),t||(i=[Ce(Be.call(null,e,{text:"Delete",position:"top"})),Y(e,"click",n[16])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function bT(n){let e,t,i,s,l,o,r=n[5]!=""&&zc(n);return{c(){r&&r.c(),e=E(),t=v("button"),t.innerHTML='Cancel',i=E(),s=v("button"),s.innerHTML='Set index',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(s,"type","button"),p(s,"class","btn"),Q(s,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),l||(o=[Y(t,"click",n[17]),Y(s,"click",n[18])],l=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=zc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&Q(s,"btn-disabled",a[9].length<=0)},d(a){a&&(k(e),k(t),k(i),k(s)),r&&r.d(a),l=!1,$e(o)}}}function vT(n){let e,t;const i=[{popup:!0},n[14]];let s={$$slots:{footer:[bT],header:[_T],default:[gT]},$$scope:{ctx:n}};for(let l=0;lJ.name==B);X?j.removeByValue(Z.columns,X):j.pushUnique(Z.columns,{name:B}),t(2,d=j.buildIndex(Z))}Kt(async()=>{t(8,g=!0);try{t(7,m=(await ft(()=>import("./CodeEditor-c648ece6.js"),["./CodeEditor-c648ece6.js","./index-30dee195.js"],import.meta.url)).default)}catch(B){console.warn(B)}t(8,g=!1)});const M=()=>C(),O=()=>y(),D=()=>T(),I=B=>{t(3,s.unique=B.target.checked,s),t(3,s.tableName=s.tableName||(u==null?void 0:u.name),s),t(2,d=j.buildIndex(s))};function N(B){d=B,t(2,d)}const P=B=>$(B);function F(B){te[B?"unshift":"push"](()=>{f=B,t(4,f)})}function R(B){Re.call(this,n,B)}function q(B){Re.call(this,n,B)}return n.$$set=B=>{e=je(je({},e),xt(B)),t(14,r=tt(e,o)),"collection"in B&&t(0,u=B.collection)},n.$$.update=()=>{var B,Z,X;n.$$.dirty[0]&1&&t(10,i=(((Z=(B=u==null?void 0:u.schema)==null?void 0:B.filter(J=>!J.toDelete))==null?void 0:Z.map(J=>J.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,s=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,l=((X=s.columns)==null?void 0:X.map(J=>J.name))||[])},[u,y,d,s,f,c,h,m,g,l,i,C,T,$,r,_,M,O,D,I,N,P,F,R,q]}class kT extends be{constructor(e){super(),_e(this,e,yT,vT,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Bc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const s=j.parseIndex(i[10]);return i[11]=s,i}function Uc(n){let e;return{c(){e=v("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wc(n){var d;let e,t,i,s=((d=n[11].columns)==null?void 0:d.map(Yc).join(", "))+"",l,o,r,a,u,f=n[11].unique&&Uc();function c(){return n[4](n[10],n[13])}return{c(){var h,m;e=v("button"),f&&f.c(),t=E(),i=v("span"),l=W(s),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((m=(h=n[2].indexes)==null?void 0:h[n[13]])!=null&&m.message?"label-danger":"")+" svelte-167lbwu")},m(h,m){var g,_;w(h,e,m),f&&f.m(e,null),b(e,t),b(e,i),b(i,l),a||(u=[Ce(r=Be.call(null,e,((_=(g=n[2].indexes)==null?void 0:g[n[13]])==null?void 0:_.message)||"")),Y(e,"click",c)],a=!0)},p(h,m){var g,_,y,S,C;n=h,n[11].unique?f||(f=Uc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),m&1&&s!==(s=((g=n[11].columns)==null?void 0:g.map(Yc).join(", "))+"")&&le(l,s),m&4&&o!==(o="label link-primary "+((y=(_=n[2].indexes)==null?void 0:_[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Et(r.update)&&m&4&&r.update.call(null,((C=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:C.message)||"")},d(h){h&&k(e),f&&f.d(),a=!1,$e(u)}}}function wT(n){var T,$,M;let e,t,i=((($=(T=n[0])==null?void 0:T.indexes)==null?void 0:$.length)||0)+"",s,l,o,r,a,u,f,c,d,h,m,g,_=pe(((M=n[0])==null?void 0:M.indexes)||[]),y=[];for(let O=0;O<_.length;O+=1)y[O]=Wc(Bc(n,_,O));function S(O){n[7](O)}let C={};return n[0]!==void 0&&(C.collection=n[0]),c=new kT({props:C}),n[6](c),te.push(()=>he(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=v("div"),t=W("Unique constraints and indexes ("),s=W(i),l=W(")"),o=E(),r=v("div");for(let O=0;O+ New index',f=E(),z(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(O,D){w(O,e,D),b(e,t),b(e,s),b(e,l),w(O,o,D),w(O,r,D);for(let I=0;Id=!1)),c.$set(I)},i(O){h||(A(c.$$.fragment,O),h=!0)},o(O){L(c.$$.fragment,O),h=!1},d(O){O&&(k(e),k(o),k(r),k(f)),vt(y,O),n[6](null),V(c,O),m=!1,g()}}}const Yc=n=>n.name;function ST(n,e,t){let i;Ge(n,Mi,h=>t(2,i=h));let{collection:s}=e,l;function o(h,m){for(let g=0;gl==null?void 0:l.show(h,m),a=()=>l==null?void 0:l.show();function u(h){te[h?"unshift":"push"](()=>{l=h,t(1,l)})}function f(h){s=h,t(0,s)}const c=h=>{for(let m=0;m{o(h.detail.old,h.detail.new)};return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},[s,l,i,o,r,a,u,f,c,d]}class TT extends be{constructor(e){super(),_e(this,e,ST,wT,me,{collection:0})}}function Kc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Jc(n){let e,t,i,s,l,o,r;function a(){return n[4](n[6])}function u(...f){return n[5](n[6],...f)}return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent=`${n[6].label}`,l=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),o||(r=[Y(e,"click",Sn(a)),Y(e,"keydown",Sn(u))],o=!0)},p(f,c){n=f},d(f){f&&k(e),o=!1,$e(r)}}}function CT(n){let e,t=pe(n[2]),i=[];for(let s=0;s{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$set=u=>{"class"in u&&t(0,i=u.class)},[i,s,l,o,r,a]}class OT extends be{constructor(e){super(),_e(this,e,MT,$T,me,{class:0})}}const ET=n=>({interactive:n&64,hasErrors:n&32}),Gc=n=>({interactive:n[6],hasErrors:n[5]}),DT=n=>({interactive:n&64,hasErrors:n&32}),Zc=n=>({interactive:n[6],hasErrors:n[5]}),AT=n=>({interactive:n&64,hasErrors:n&32}),Xc=n=>({interactive:n[6],hasErrors:n[5]});function Qc(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xc(n){let e,t,i;return{c(){e=v("div"),t=v("span"),i=W(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(s,l){w(s,e,l),b(e,t),b(t,i)},p(s,l){l&16&&le(i,s[4])},d(s){s&&k(e)}}}function IT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[0].required&&xc(n);return{c(){h&&h.c(),e=E(),t=v("div"),i=v("i"),l=E(),o=v("input"),p(i,"class",s=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),Q(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,p(o,"placeholder","Field name"),o.value=f=n[0].name},m(m,g){h&&h.m(m,g),w(m,e,g),w(m,t,g),b(t,i),w(m,l,g),w(m,o,g),n[14](o),n[0].id||o.focus(),c||(d=Y(o,"input",n[15]),c=!0)},p(m,g){m[0].required?h?h.p(m,g):(h=xc(m),h.c(),h.m(e.parentNode,e)):h&&(h.d(1),h=null),g&1&&s!==(s=j.getFieldTypeIcon(m[0].type))&&p(i,"class",s),g&64&&Q(t,"txt-disabled",!m[6]),g&64&&r!==(r=!m[6])&&(o.disabled=r),g&1&&a!==(a=m[0].id&&m[0].system)&&(o.readOnly=a),g&1&&u!==(u=!m[0].id)&&(o.autofocus=u),g&1&&f!==(f=m[0].name)&&o.value!==f&&(o.value=f)},d(m){m&&(k(e),k(t),k(l),k(o)),h&&h.d(m),n[14](null),c=!1,d()}}}function LT(n){let e;return{c(){e=v("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PT(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),Q(e,"btn-hint",!n[3]&&!n[5]),Q(e,"btn-danger",n[5])},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[11]),s=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&40&&Q(e,"btn-hint",!o[3]&&!o[5]),r&40&&Q(e,"btn-danger",o[5])},d(o){o&&k(e),s=!1,l()}}}function NT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(s,l){w(s,e,l),t||(i=[Ce(Be.call(null,e,"Restore")),Y(e,"click",n[9])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function ed(n){let e,t,i,s,l,o,r,a,u,f,c;const d=n[13].options,h=Tt(d,n,n[18],Zc);l=new ge({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[FT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[RT,({uniqueId:y})=>({24:y}),({uniqueId:y})=>y?16777216:0]},$$scope:{ctx:n}}});const m=n[13].optionsFooter,g=Tt(m,n,n[18],Gc);let _=!n[0].toDelete&&td(n);return{c(){e=v("div"),t=v("div"),h&&h.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),z(r.$$.fragment),a=E(),g&&g.c(),u=E(),_&&_.c(),p(t,"class","hidden-empty m-b-sm"),p(s,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),H(l,s,null),b(s,o),H(r,s,null),b(s,a),g&&g.m(s,null),b(s,u),_&&_.m(s,null),c=!0},p(y,S){h&&h.p&&(!c||S&262240)&&$t(h,d,y,y[18],c?Ct(d,y[18],S,DT):Mt(y[18]),Zc);const C={};S&17039377&&(C.$$scope={dirty:S,ctx:y}),l.$set(C);const T={};S&17039361&&(T.$$scope={dirty:S,ctx:y}),r.$set(T),g&&g.p&&(!c||S&262240)&&$t(g,m,y,y[18],c?Ct(m,y[18],S,ET):Mt(y[18]),Gc),y[0].toDelete?_&&(re(),L(_,1,1,()=>{_=null}),ae()):_?(_.p(y,S),S&1&&A(_,1)):(_=td(y),_.c(),A(_,1),_.m(s,null))},i(y){c||(A(h,y),A(l.$$.fragment,y),A(r.$$.fragment,y),A(g,y),A(_),y&&xe(()=>{c&&(f||(f=He(e,lt,{duration:150},!0)),f.run(1))}),c=!0)},o(y){L(h,y),L(l.$$.fragment,y),L(r.$$.fragment,y),L(g,y),L(_),y&&(f||(f=He(e,lt,{duration:150},!1)),f.run(0)),c=!1},d(y){y&&k(e),h&&h.d(y),V(l),V(r),g&&g.d(y),_&&_.d(),y&&f&&f.end()}}}function FT(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),o=W(n[4]),r=E(),a=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(a,"class","ri-information-line link-hint"),p(s,"for",f=n[24])},m(h,m){w(h,e,m),e.checked=n[0].required,w(h,i,m),w(h,s,m),b(s,l),b(l,o),b(s,r),b(s,a),c||(d=[Y(e,"change",n[16]),Ce(u=Be.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(h,m){m&16777216&&t!==(t=h[24])&&p(e,"id",t),m&1&&(e.checked=h[0].required),m&16&&le(o,h[4]),u&&Et(u.update)&&m&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(h[0])}.`}),m&16777216&&f!==(f=h[24])&&p(s,"for",f)},d(h){h&&(k(e),k(i),k(s)),c=!1,$e(d)}}}function RT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Presentable",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[24]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[24])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[17]),Ce(Be.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],u=!0)},p(c,d){d&16777216&&t!==(t=c[24])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&16777216&&a!==(a=c[24])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function td(n){let e,t,i,s,l,o,r,a,u;return a=new Pn({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[qT]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=E(),s=v("div"),l=v("button"),o=v("i"),r=E(),z(a.$$.fragment),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"aria-label","More"),p(l,"class","btn btn-circle btn-sm btn-transparent"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(s,l),b(l,o),b(l,r),H(a,l,null),u=!0},p(f,c){const d={};c&262144&&(d.$$scope={dirty:c,ctx:f}),a.$set(d)},i(f){u||(A(a.$$.fragment,f),u=!0)},o(f){L(a.$$.fragment,f),u=!1},d(f){f&&k(e),V(a)}}}function qT(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Remove',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Qc();s=new ge({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[IT]},$$scope:{ctx:n}}});const c=n[13].default,d=Tt(c,n,n[18],Xc),h=d||LT();function m(S,C){if(S[0].toDelete)return NT;if(S[6])return PT}let g=m(n),_=g&&g(n),y=n[6]&&n[3]&&ed(n);return{c(){e=v("div"),t=v("div"),f&&f.c(),i=E(),z(s.$$.fragment),l=E(),h&&h.c(),o=E(),_&&_.c(),r=E(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),Q(e,"required",n[0].required),Q(e,"expanded",n[6]&&n[3]),Q(e,"deleted",n[0].toDelete)},m(S,C){w(S,e,C),b(e,t),f&&f.m(t,null),b(t,i),H(s,t,null),b(t,l),h&&h.m(t,null),b(t,o),_&&_.m(t,null),b(e,r),y&&y.m(e,null),u=!0},p(S,[C]){S[6]?f||(f=Qc(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const T={};C&64&&(T.class="form-field required m-0 "+(S[6]?"":"disabled")),C&2&&(T.name="schema."+S[1]+".name"),C&262229&&(T.$$scope={dirty:C,ctx:S}),s.$set(T),d&&d.p&&(!u||C&262240)&&$t(d,c,S,S[18],u?Ct(c,S[18],C,AT):Mt(S[18]),Xc),g===(g=m(S))&&_?_.p(S,C):(_&&_.d(1),_=g&&g(S),_&&(_.c(),_.m(t,null))),S[6]&&S[3]?y?(y.p(S,C),C&72&&A(y,1)):(y=ed(S),y.c(),A(y,1),y.m(e,null)):y&&(re(),L(y,1,1,()=>{y=null}),ae()),(!u||C&1)&&Q(e,"required",S[0].required),(!u||C&72)&&Q(e,"expanded",S[6]&&S[3]),(!u||C&1)&&Q(e,"deleted",S[0].toDelete)},i(S){u||(A(s.$$.fragment,S),A(h,S),A(y),S&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(S){L(s.$$.fragment,S),L(h,S),L(y),S&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&k(e),f&&f.d(),V(s),h&&h.d(S),_&&_.d(),y&&y.d(),S&&a&&a.end()}}}let Ar=[];function HT(n,e,t){let i,s,l,o;Ge(n,Mi,P=>t(12,o=P));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=pt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:h=j.initSchemaField()}=e,m,g=!1;function _(){h.id?t(0,h.toDelete=!0,h):f("remove")}function y(){t(0,h.toDelete=!1,h),on({})}function S(P){return j.slugify(P)}function C(){t(3,g=!0),M()}function T(){t(3,g=!1)}function $(){g?T():C()}function M(){for(let P of Ar)P.id!=u&&P.collapse()}Kt(()=>(Ar.push({id:u,collapse:T}),h.onMountSelect&&(t(0,h.onMountSelect=!1,h),m==null||m.select()),()=>{j.removeByKey(Ar,"id",u)}));function O(P){te[P?"unshift":"push"](()=>{m=P,t(2,m)})}const D=P=>{const F=h.name;t(0,h.name=S(P.target.value),h),P.target.value=h.name,f("rename",{oldName:F,newName:h.name})};function I(){h.required=this.checked,t(0,h)}function N(){h.presentable=this.checked,t(0,h)}return n.$$set=P=>{"key"in P&&t(1,d=P.key),"field"in P&&t(0,h=P.field),"$$scope"in P&&t(18,a=P.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&h.toDelete&&h.originalName&&h.name!==h.originalName&&t(0,h.name=h.originalName,h),n.$$.dirty&1&&!h.originalName&&h.name&&t(0,h.originalName=h.name,h),n.$$.dirty&1&&typeof h.toDelete>"u"&&t(0,h.toDelete=!1,h),n.$$.dirty&1&&h.required&&t(0,h.nullable=!1,h),n.$$.dirty&1&&t(6,i=!h.toDelete&&!(h.id&&h.system)),n.$$.dirty&4098&&t(5,s=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,l=c[h==null?void 0:h.type]||"Nonempty")},[h,d,m,g,l,s,i,f,_,y,S,$,o,r,O,D,I,N,a]}class gi extends be{constructor(e){super(),_e(this,e,HT,jT,me,{key:1,field:0})}}function VT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Min length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.min),r||(a=Y(l,"input",n[3]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.min&&de(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function zT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Max length"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[0].options.max),a||(u=Y(l,"input",n[4]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(l,"min",r),c&1&&yt(l.value)!==f[0].options.max&&de(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function BT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Regex pattern"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","text"),p(l,"id",o=n[9]),p(l,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.pattern),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0].options.pattern&&de(l,u[0].options.pattern)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function UT(n){let e,t,i,s,l,o,r,a,u,f;return i=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[VT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[zT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[BT,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),p(t,"class","col-sm-3"),p(l,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),f=!0},p(c,d){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&1537&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const m={};d&2&&(m.name="schema."+c[1]+".options.max"),d&1537&&(m.$$scope={dirty:d,ctx:c}),o.$set(m);const g={};d&2&&(g.name="schema."+c[1]+".options.pattern"),d&1537&&(g.$$scope={dirty:d,ctx:c}),u.$set(g)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(o.$$.fragment,c),L(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function WT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{options:[UT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function YT(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.min=yt(this.value),t(0,l)}function a(){l.options.max=yt(this.value),t(0,l)}function u(){l.options.pattern=this.value,t(0,l)}function f(h){l=h,t(0,l)}function c(h){Re.call(this,n,h)}function d(h){Re.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(2,s=tt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d]}class KT extends be{constructor(e){super(),_e(this,e,YT,WT,me,{field:0,key:1})}}function JT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Min"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.min),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.min&&de(l,u[0].options.min)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function GT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Max"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"min",r=n[0].options.min)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[0].options.max),a||(u=Y(l,"input",n[5]),a=!0)},p(f,c){c&512&&i!==(i=f[9])&&p(e,"for",i),c&512&&o!==(o=f[9])&&p(l,"id",o),c&1&&r!==(r=f[0].options.min)&&p(l,"min",r),c&1&&yt(l.value)!==f[0].options.max&&de(l,f[0].options.max)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function ZT(n){let e,t,i,s,l,o,r;return i=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[JT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[GT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function XT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="No decimals",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[3]),Ce(Be.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&512&&a!==(a=c[9])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function QT(n){let e,t;return e=new ge({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[XT,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.noDecimal"),s&1537&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[6](r)}let o={$$slots:{optionsFooter:[QT],options:[ZT]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[7]),e.$on("remove",n[8]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function eC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){l.options.noDecimal=this.checked,t(0,l)}function a(){l.options.min=yt(this.value),t(0,l)}function u(){l.options.max=yt(this.value),t(0,l)}function f(h){l=h,t(0,l)}function c(h){Re.call(this,n,h)}function d(h){Re.call(this,n,h)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(2,s=tt(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d]}class tC extends be{constructor(e){super(),_e(this,e,eC,xT,me,{field:0,key:1})}}function nC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function iC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Re.call(this,n,f)}function u(f){Re.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),xt(f)),t(2,s=tt(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class sC extends be{constructor(e){super(),_e(this,e,iC,nC,me,{field:0,key:1})}}function lC(n){let e,t,i,s,l=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=je(je({},e),xt(c)),t(5,l=tt(e,s)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,u,i,l,f]}class qs extends be{constructor(e){super(),_e(this,e,oC,lC,me,{value:0,separator:1,readonly:2,disabled:3})}}function rC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(_){n[3](_)}let g={id:n[8],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(g.value=n[0].options.exceptDomains),r=new qs({props:g}),te.push(()=>he(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Ce(Be.call(null,s,{text:`List of domains that are NOT allowed. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function aC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(_){n[4](_)}let g={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new qs({props:g}),te.push(()=>he(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Ce(Be.call(null,s,{text:`List of domains that are ONLY allowed. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function uC(n){let e,t,i,s,l,o,r;return i=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[rC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[aC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function fC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[uC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function cC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Re.call(this,n,d)}function c(d){Re.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(2,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class j1 extends be{constructor(e){super(),_e(this,e,cC,fC,me,{field:0,key:1})}}function dC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function pC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Re.call(this,n,f)}function u(f){Re.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),xt(f)),t(2,s=tt(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class hC extends be{constructor(e){super(),_e(this,e,pC,dC,me,{field:0,key:1})}}function mC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Strip urls domain",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[3]),Ce(Be.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function gC(n){let e,t;return e=new ge({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[mC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.convertUrls"),s&769&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _C(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[4](r)}let o={$$slots:{optionsFooter:[gC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[5]),e.$on("remove",n[6]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?_t(s,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function bC(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;function r(){t(0,l.options={convertUrls:!1},l)}function a(){l.options.convertUrls=this.checked,t(0,l)}function u(d){l=d,t(0,l)}function f(d){Re.call(this,n,d)}function c(d){Re.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(2,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(l.options)&&r()},[l,o,s,a,u,f,c]}class vC extends be{constructor(e){super(),_e(this,e,bC,_C,me,{field:0,key:1})}}var Ir=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Cs={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},yl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},vn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Vn=function(n){return n===!0?1:0};function nd(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var Lr=function(n){return n instanceof Array?n:[n]};function gn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function mt(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function io(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function H1(n,e){if(e(n))return n;if(n.parentNode)return H1(n.parentNode,e)}function so(n,e){var t=mt("div","numInputWrapper"),i=mt("input","numInput "+n),s=mt("span","arrowUp"),l=mt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function Mn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Pr=function(){},Ro=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},yC={D:Pr,F:function(n,e,t){n.setMonth(t.months.longhand.indexOf(e))},G:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},H:function(n,e){n.setHours(parseFloat(e))},J:function(n,e){n.setDate(parseFloat(e))},K:function(n,e,t){n.setHours(n.getHours()%12+12*Vn(new RegExp(t.amPM[1],"i").test(e)))},M:function(n,e,t){n.setMonth(t.months.shorthand.indexOf(e))},S:function(n,e){n.setSeconds(parseFloat(e))},U:function(n,e){return new Date(parseFloat(e)*1e3)},W:function(n,e,t){var i=parseInt(e),s=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return s.setDate(s.getDate()-s.getDay()+t.firstDayOfWeek),s},Y:function(n,e){n.setFullYear(parseFloat(e))},Z:function(n,e){return new Date(e)},d:function(n,e){n.setDate(parseFloat(e))},h:function(n,e){n.setHours((n.getHours()>=12?12:0)+parseFloat(e))},i:function(n,e){n.setMinutes(parseFloat(e))},j:function(n,e){n.setDate(parseFloat(e))},l:Pr,m:function(n,e){n.setMonth(parseFloat(e)-1)},n:function(n,e){n.setMonth(parseFloat(e)-1)},s:function(n,e){n.setSeconds(parseFloat(e))},u:function(n,e){return new Date(parseFloat(e))},w:Pr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},ns={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},fl={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[fl.w(n,e,t)]},F:function(n,e,t){return Ro(fl.n(n,e,t)-1,!1,e)},G:function(n,e,t){return vn(fl.h(n,e,t))},H:function(n){return vn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Vn(n.getHours()>11)]},M:function(n,e){return Ro(n.getMonth(),!0,e)},S:function(n){return vn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return vn(n.getFullYear(),4)},d:function(n){return vn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return vn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return vn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},V1=function(n){var e=n.config,t=e===void 0?Cs:e,i=n.l10n,s=i===void 0?yl:i,l=n.isMobile,o=l===void 0?!1:l;return function(r,a,u){var f=u||s;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,h){return fl[c]&&h[d-1]!=="\\"?fl[c](r,f,t):c!=="\\"?c:""}).join("")}},ma=function(n){var e=n.config,t=e===void 0?Cs:e,i=n.l10n,s=i===void 0?yl:i;return function(l,o,r,a){if(!(l!==0&&!l)){var u=a||s,f,c=l;if(l instanceof Date)f=new Date(l.getTime());else if(typeof l!="string"&&l.toFixed!==void 0)f=new Date(l);else if(typeof l=="string"){var d=o||(t||Cs).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var m=void 0,g=[],_=0,y=0,S="";_Math.min(e,t)&&n=0?new Date:new Date(t.config.minDate.getTime()),ie=Fr(t.config);G.setHours(ie.hours,ie.minutes,ie.seconds,G.getMilliseconds()),t.selectedDates=[G],t.latestSelectedDateObj=G}K!==void 0&&K.type!=="blur"&&Rn(K);var fe=t._input.value;c(),It(),t._input.value!==fe&&t._debouncedChange()}function u(K,G){return K%12+12*Vn(G===t.l10n.amPM[1])}function f(K){switch(K%24){case 0:case 12:return 12;default:return K%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var K=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,G=(parseInt(t.minuteElement.value,10)||0)%60,ie=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(K=u(K,t.amPM.textContent));var fe=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&On(t.latestSelectedDateObj,t.config.minDate,!0)===0,Oe=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&On(t.latestSelectedDateObj,t.config.maxDate,!0)===0;if(t.config.maxTime!==void 0&&t.config.minTime!==void 0&&t.config.minTime>t.config.maxTime){var Pe=Nr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Fe=Nr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ae=Nr(K,G,ie);if(Ae>Fe&&Ae=12)]),t.secondElement!==void 0&&(t.secondElement.value=vn(ie)))}function m(K){var G=Mn(K),ie=parseInt(G.value)+(K.delta||0);(ie/1e3>1||K.key==="Enter"&&!/[^\d]/.test(ie.toString()))&&ke(ie)}function g(K,G,ie,fe){if(G instanceof Array)return G.forEach(function(Oe){return g(K,Oe,ie,fe)});if(K instanceof Array)return K.forEach(function(Oe){return g(Oe,G,ie,fe)});K.addEventListener(G,ie,fe),t._handlers.push({remove:function(){return K.removeEventListener(G,ie,fe)}})}function _(){et("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ie){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ie+"]"),function(fe){return g(fe,"click",t[ie])})}),t.isMobile){Qn();return}var K=nd(Ue,50);if(t._debouncedChange=nd(_,TC),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(t.daysContainer,"mouseover",function(ie){t.config.mode==="range"&&we(Mn(ie))}),g(t._input,"keydown",Se),t.calendarContainer!==void 0&&g(t.calendarContainer,"keydown",Se),!t.config.inline&&!t.config.static&&g(window,"resize",K),window.ontouchstart!==void 0?g(window.document,"touchstart",We):g(window.document,"mousedown",We),g(window.document,"focus",We,{capture:!0}),t.config.clickOpens===!0&&(g(t._input,"focus",t.open),g(t._input,"click",t.open)),t.daysContainer!==void 0&&(g(t.monthNav,"click",Lt),g(t.monthNav,["keyup","increment"],m),g(t.daysContainer,"click",_i)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var G=function(ie){return Mn(ie).select()};g(t.timeContainer,["increment"],a),g(t.timeContainer,"blur",a,{capture:!0}),g(t.timeContainer,"click",C),g([t.hourElement,t.minuteElement],["focus","click"],G),t.secondElement!==void 0&&g(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&g(t.amPM,"click",function(ie){a(ie)})}t.config.allowInput&&g(t._input,"blur",dt)}function S(K,G){var ie=K!==void 0?t.parseDate(K):t.latestSelectedDateObj||(t.config.minDate&&t.config.minDate>t.now?t.config.minDate:t.config.maxDate&&t.config.maxDate1),t.calendarContainer.appendChild(K);var Oe=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Oe&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Pe=mt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Pe,t.element),Pe.appendChild(t.element),t.altInput&&Pe.appendChild(t.altInput),Pe.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function M(K,G,ie,fe){var Oe=Me(G,!0),Pe=mt("span",K,G.getDate().toString());return Pe.dateObj=G,Pe.$i=fe,Pe.setAttribute("aria-label",t.formatDate(G,t.config.ariaDateFormat)),K.indexOf("hidden")===-1&&On(G,t.now)===0&&(t.todayDateElem=Pe,Pe.classList.add("today"),Pe.setAttribute("aria-current","date")),Oe?(Pe.tabIndex=-1,De(G)&&(Pe.classList.add("selected"),t.selectedDateElem=Pe,t.config.mode==="range"&&(gn(Pe,"startRange",t.selectedDates[0]&&On(G,t.selectedDates[0],!0)===0),gn(Pe,"endRange",t.selectedDates[1]&&On(G,t.selectedDates[1],!0)===0),K==="nextMonthDay"&&Pe.classList.add("inRange")))):Pe.classList.add("flatpickr-disabled"),t.config.mode==="range"&&Xe(G)&&!De(G)&&Pe.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&K!=="prevMonthDay"&&fe%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend",""+t.config.getWeek(G)+""),et("onDayCreate",Pe),Pe}function O(K){K.focus(),t.config.mode==="range"&&we(K)}function D(K){for(var G=K>0?0:t.config.showMonths-1,ie=K>0?t.config.showMonths:-1,fe=G;fe!=ie;fe+=K)for(var Oe=t.daysContainer.children[fe],Pe=K>0?0:Oe.children.length-1,Fe=K>0?Oe.children.length:-1,Ae=Pe;Ae!=Fe;Ae+=K){var Qe=Oe.children[Ae];if(Qe.className.indexOf("hidden")===-1&&Me(Qe.dateObj))return Qe}}function I(K,G){for(var ie=K.className.indexOf("Month")===-1?K.dateObj.getMonth():t.currentMonth,fe=G>0?t.config.showMonths:-1,Oe=G>0?1:-1,Pe=ie-t.currentMonth;Pe!=fe;Pe+=Oe)for(var Fe=t.daysContainer.children[Pe],Ae=ie-t.currentMonth===Pe?K.$i+G:G<0?Fe.children.length-1:0,Qe=Fe.children.length,ze=Ae;ze>=0&&ze0?Qe:-1);ze+=Oe){var Ke=Fe.children[ze];if(Ke.className.indexOf("hidden")===-1&&Me(Ke.dateObj)&&Math.abs(K.$i-ze)>=Math.abs(G))return O(Ke)}t.changeMonth(Oe),N(D(Oe),0)}function N(K,G){var ie=l(),fe=Je(ie||document.body),Oe=K!==void 0?K:fe?ie:t.selectedDateElem!==void 0&&Je(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Je(t.todayDateElem)?t.todayDateElem:D(G>0?1:-1);Oe===void 0?t._input.focus():fe?I(Oe,G):O(Oe)}function P(K,G){for(var ie=(new Date(K,G,1).getDay()-t.l10n.firstDayOfWeek+7)%7,fe=t.utils.getDaysInMonth((G-1+12)%12,K),Oe=t.utils.getDaysInMonth(G,K),Pe=window.document.createDocumentFragment(),Fe=t.config.showMonths>1,Ae=Fe?"prevMonthDay hidden":"prevMonthDay",Qe=Fe?"nextMonthDay hidden":"nextMonthDay",ze=fe+1-ie,Ke=0;ze<=fe;ze++,Ke++)Pe.appendChild(M("flatpickr-day "+Ae,new Date(K,G-1,ze),ze,Ke));for(ze=1;ze<=Oe;ze++,Ke++)Pe.appendChild(M("flatpickr-day",new Date(K,G,ze),ze,Ke));for(var St=Oe+1;St<=42-ie&&(t.config.showMonths===1||Ke%7!==0);St++,Ke++)Pe.appendChild(M("flatpickr-day "+Qe,new Date(K,G+1,St%Oe),St,Ke));var ri=mt("div","dayContainer");return ri.appendChild(Pe),ri}function F(){if(t.daysContainer!==void 0){io(t.daysContainer),t.weekNumbers&&io(t.weekNumbers);for(var K=document.createDocumentFragment(),G=0;G1||t.config.monthSelectorType!=="dropdown")){var K=function(fe){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&fet.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var G=0;G<12;G++)if(K(G)){var ie=mt("option","flatpickr-monthDropdown-month");ie.value=new Date(t.currentYear,G).getMonth().toString(),ie.textContent=Ro(G,t.config.shorthandCurrentMonth,t.l10n),ie.tabIndex=-1,t.currentMonth===G&&(ie.selected=!0),t.monthsDropdownContainer.appendChild(ie)}}}function q(){var K=mt("div","flatpickr-month"),G=window.document.createDocumentFragment(),ie;t.config.showMonths>1||t.config.monthSelectorType==="static"?ie=mt("span","cur-month"):(t.monthsDropdownContainer=mt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),g(t.monthsDropdownContainer,"change",function(Fe){var Ae=Mn(Fe),Qe=parseInt(Ae.value,10);t.changeMonth(Qe-t.currentMonth),et("onMonthChange")}),R(),ie=t.monthsDropdownContainer);var fe=so("cur-year",{tabindex:"-1"}),Oe=fe.getElementsByTagName("input")[0];Oe.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Oe.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Oe.setAttribute("max",t.config.maxDate.getFullYear().toString()),Oe.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Pe=mt("div","flatpickr-current-month");return Pe.appendChild(ie),Pe.appendChild(fe),G.appendChild(Pe),K.appendChild(G),{container:K,yearElement:Oe,monthElement:ie}}function B(){io(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var K=t.config.showMonths;K--;){var G=q();t.yearElements.push(G.yearElement),t.monthElements.push(G.monthElement),t.monthNav.appendChild(G.container)}t.monthNav.appendChild(t.nextMonthNav)}function Z(){return t.monthNav=mt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=mt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=mt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,B(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(K){t.__hidePrevMonthArrow!==K&&(gn(t.prevMonthNav,"flatpickr-disabled",K),t.__hidePrevMonthArrow=K)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(K){t.__hideNextMonthArrow!==K&&(gn(t.nextMonthNav,"flatpickr-disabled",K),t.__hideNextMonthArrow=K)}}),t.currentYearElement=t.yearElements[0],Jt(),t.monthNav}function X(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var K=Fr(t.config);t.timeContainer=mt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var G=mt("span","flatpickr-time-separator",":"),ie=so("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ie.getElementsByTagName("input")[0];var fe=so("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=fe.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?K.hours:f(K.hours)),t.minuteElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():K.minutes),t.hourElement.setAttribute("step",t.config.hourIncrement.toString()),t.minuteElement.setAttribute("step",t.config.minuteIncrement.toString()),t.hourElement.setAttribute("min",t.config.time_24hr?"0":"1"),t.hourElement.setAttribute("max",t.config.time_24hr?"23":"12"),t.hourElement.setAttribute("maxlength","2"),t.minuteElement.setAttribute("min","0"),t.minuteElement.setAttribute("max","59"),t.minuteElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ie),t.timeContainer.appendChild(G),t.timeContainer.appendChild(fe),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Oe=so("flatpickr-second");t.secondElement=Oe.getElementsByTagName("input")[0],t.secondElement.value=vn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():K.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(mt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Oe)}return t.config.time_24hr||(t.amPM=mt("span","flatpickr-am-pm",t.l10n.amPM[Vn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function J(){t.weekdayContainer?io(t.weekdayContainer):t.weekdayContainer=mt("div","flatpickr-weekdays");for(var K=t.config.showMonths;K--;){var G=mt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(G)}return U(),t.weekdayContainer}function U(){if(t.weekdayContainer){var K=t.l10n.firstDayOfWeek,G=id(t.l10n.weekdays.shorthand);K>0&&K - `+G.join("")+` - - `}}function oe(){t.calendarContainer.classList.add("hasWeeks");var K=mt("div","flatpickr-weekwrapper");K.appendChild(mt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=mt("div","flatpickr-weeks");return K.appendChild(G),{weekWrapper:K,weekNumbers:G}}function ee(K,G){G===void 0&&(G=!0);var ie=G?K:K-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,et("onYearChange"),R()),F(),et("onMonthChange"),Jt())}function se(K,G){if(K===void 0&&(K=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Fr(t.config),fe=ie.hours,Oe=ie.minutes,Pe=ie.seconds;h(fe,Oe,Pe)}t.redraw(),K&&et("onChange")}function Ee(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),et("onClose")}function qe(){t.config!==void 0&&et("onDestroy");for(var K=t._handlers.length;K--;)t._handlers[K].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function Ve(K){return t.calendarContainer.contains(K)}function We(K){if(t.isOpen&&!t.config.inline){var G=Mn(K),ie=Ve(G),fe=G===t.input||G===t.altInput||t.element.contains(G)||K.path&&K.path.indexOf&&(~K.path.indexOf(t.input)||~K.path.indexOf(t.altInput)),Oe=!fe&&!ie&&!Ve(K.relatedTarget),Pe=!t.config.ignoredFocusElements.some(function(Fe){return Fe.contains(G)});Oe&&Pe&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ke(K){if(!(!K||t.config.minDate&&Kt.config.maxDate.getFullYear())){var G=K,ie=t.currentYear!==G;t.currentYear=G||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),et("onYearChange"),R())}}function Me(K,G){var ie;G===void 0&&(G=!0);var fe=t.parseDate(K,void 0,G);if(t.config.minDate&&fe&&On(fe,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&fe&&On(fe,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(fe===void 0)return!1;for(var Oe=!!t.config.enable,Pe=(ie=t.config.enable)!==null&&ie!==void 0?ie:t.config.disable,Fe=0,Ae=void 0;Fe=Ae.from.getTime()&&fe.getTime()<=Ae.to.getTime())return Oe}return!Oe}function Je(K){return t.daysContainer!==void 0?K.className.indexOf("hidden")===-1&&K.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(K):!1}function dt(K){var G=K.target===t._input,ie=t._input.value.trimEnd()!==it();G&&ie&&!(K.relatedTarget&&Ve(K.relatedTarget))&&t.setDate(t._input.value,!0,K.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Se(K){var G=Mn(K),ie=t.config.wrap?n.contains(G):G===t._input,fe=t.config.allowInput,Oe=t.isOpen&&(!fe||!ie),Pe=t.config.inline&&ie&&!fe;if(K.keyCode===13&&ie){if(fe)return t.setDate(t._input.value,!0,G===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),G.blur();t.open()}else if(Ve(G)||Oe||Pe){var Fe=!!t.timeContainer&&t.timeContainer.contains(G);switch(K.keyCode){case 13:Fe?(K.preventDefault(),a(),Nn()):_i(K);break;case 27:K.preventDefault(),Nn();break;case 8:case 46:ie&&!t.config.allowInput&&(K.preventDefault(),t.clear());break;case 37:case 39:if(!Fe&&!ie){K.preventDefault();var Ae=l();if(t.daysContainer!==void 0&&(fe===!1||Ae&&Je(Ae))){var Qe=K.keyCode===39?1:-1;K.ctrlKey?(K.stopPropagation(),ee(Qe),N(D(1),0)):N(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:K.preventDefault();var ze=K.keyCode===40?1:-1;t.daysContainer&&G.$i!==void 0||G===t.input||G===t.altInput?K.ctrlKey?(K.stopPropagation(),ke(t.currentYear-ze),N(D(1),0)):Fe||N(void 0,ze*7):G===t.currentYearElement?ke(t.currentYear-ze):t.config.enableTime&&(!Fe&&t.hourElement&&t.hourElement.focus(),a(K),t._debouncedChange());break;case 9:if(Fe){var Ke=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function($n){return $n}),St=Ke.indexOf(G);if(St!==-1){var ri=Ke[St+(K.shiftKey?-1:1)];K.preventDefault(),(ri||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(G)&&K.shiftKey&&(K.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&G===t.amPM)switch(K.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),It();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),It();break}(ie||Ve(G))&&et("onKeyDown",K)}function we(K,G){if(G===void 0&&(G="flatpickr-day"),!(t.selectedDates.length!==1||K&&(!K.classList.contains(G)||K.classList.contains("flatpickr-disabled")))){for(var ie=K?K.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),fe=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Oe=Math.min(ie,t.selectedDates[0].getTime()),Pe=Math.max(ie,t.selectedDates[0].getTime()),Fe=!1,Ae=0,Qe=0,ze=Oe;zeOe&&zeAe)?Ae=ze:ze>fe&&(!Qe||ze ."+G));Ke.forEach(function(St){var ri=St.dateObj,$n=ri.getTime(),Hs=Ae>0&&$n0&&$n>Qe;if(Hs){St.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ps){St.classList.remove(ps)});return}else if(Fe&&!Hs)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ps){St.classList.remove(ps)}),K!==void 0&&(K.classList.add(ie<=t.selectedDates[0].getTime()?"startRange":"endRange"),feie&&$n===fe&&St.classList.add("endRange"),$n>=Ae&&(Qe===0||$n<=Qe)&&kC($n,fe,ie)&&St.classList.add("inRange"))})}}function Ue(){t.isOpen&&!t.config.static&&!t.config.inline&&At()}function nt(K,G){if(G===void 0&&(G=t._positionElement),t.isMobile===!0){if(K){K.preventDefault();var ie=Mn(K);ie&&ie.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),et("onOpen");return}else if(t._input.disabled||t.config.inline)return;var fe=t.isOpen;t.isOpen=!0,fe||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),et("onOpen"),At(G)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(K===void 0||!t.timeContainer.contains(K.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ne(K){return function(G){var ie=t.config["_"+K+"Date"]=t.parseDate(G,t.config.dateFormat),fe=t.config["_"+(K==="min"?"max":"min")+"Date"];ie!==void 0&&(t[K==="min"?"minDateHasTime":"maxDateHasTime"]=ie.getHours()>0||ie.getMinutes()>0||ie.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Oe){return Me(Oe)}),!t.selectedDates.length&&K==="min"&&d(ie),It()),t.daysContainer&&(an(),ie!==void 0?t.currentYearElement[K]=ie.getFullYear().toString():t.currentYearElement.removeAttribute(K),t.currentYearElement.disabled=!!fe&&ie!==void 0&&fe.getFullYear()===ie.getFullYear())}}function Ne(){var K=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=pn(pn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ie={};t.config.parseDate=G.parseDate,t.config.formatDate=G.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ke){t.config._enable=cn(Ke)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ke){t.config._disable=cn(Ke)}});var fe=G.mode==="time";if(!G.dateFormat&&(G.enableTime||fe)){var Oe=Xt.defaultConfig.dateFormat||Cs.dateFormat;ie.dateFormat=G.noCalendar||fe?"H:i"+(G.enableSeconds?":S":""):Oe+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||fe)&&!G.altFormat){var Pe=Xt.defaultConfig.altFormat||Cs.altFormat;ie.altFormat=G.noCalendar||fe?"h:i"+(G.enableSeconds?":S K":" K"):Pe+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ne("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ne("max")});var Fe=function(Ke){return function(St){t.config[Ke==="min"?"_minTime":"_maxTime"]=t.parseDate(St,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Fe("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Fe("max")}),G.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ie,G);for(var Ae=0;Ae-1?t.config[ze]=Lr(Qe[ze]).map(o).concat(t.config[ze]):typeof G[ze]>"u"&&(t.config[ze]=Qe[ze])}G.altInputClass||(t.config.altInputClass=Te().className+" "+t.config.altInputClass),et("onParseConfig")}function Te(){return t.config.wrap?n.querySelector("[data-input]"):n}function ot(){typeof t.config.locale!="object"&&typeof Xt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=pn(pn({},Xt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Xt.l10ns[t.config.locale]:void 0),ns.D="("+t.l10n.weekdays.shorthand.join("|")+")",ns.l="("+t.l10n.weekdays.longhand.join("|")+")",ns.M="("+t.l10n.months.shorthand.join("|")+")",ns.F="("+t.l10n.months.longhand.join("|")+")",ns.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var K=pn(pn({},e),JSON.parse(JSON.stringify(n.dataset||{})));K.time_24hr===void 0&&Xt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=V1(t),t.parseDate=ma({config:t.config,l10n:t.l10n})}function At(K){if(typeof t.config.position=="function")return void t.config.position(t,K);if(t.calendarContainer!==void 0){et("onPreCalendarPosition");var G=K||t._positionElement,ie=Array.prototype.reduce.call(t.calendarContainer.children,function(i0,s0){return i0+s0.offsetHeight},0),fe=t.calendarContainer.offsetWidth,Oe=t.config.position.split(" "),Pe=Oe[0],Fe=Oe.length>1?Oe[1]:null,Ae=G.getBoundingClientRect(),Qe=window.innerHeight-Ae.bottom,ze=Pe==="above"||Pe!=="below"&&Qeie,Ke=window.pageYOffset+Ae.top+(ze?-ie-2:G.offsetHeight+2);if(gn(t.calendarContainer,"arrowTop",!ze),gn(t.calendarContainer,"arrowBottom",ze),!t.config.inline){var St=window.pageXOffset+Ae.left,ri=!1,$n=!1;Fe==="center"?(St-=(fe-Ae.width)/2,ri=!0):Fe==="right"&&(St-=fe-Ae.width,$n=!0),gn(t.calendarContainer,"arrowLeft",!ri&&!$n),gn(t.calendarContainer,"arrowCenter",ri),gn(t.calendarContainer,"arrowRight",$n);var Hs=window.document.body.offsetWidth-(window.pageXOffset+Ae.right),ps=St+fe>window.document.body.offsetWidth,Z1=Hs+fe>window.document.body.offsetWidth;if(gn(t.calendarContainer,"rightMost",ps),!t.config.static)if(t.calendarContainer.style.top=Ke+"px",!ps)t.calendarContainer.style.left=St+"px",t.calendarContainer.style.right="auto";else if(!Z1)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Hs+"px";else{var ir=nn();if(ir===void 0)return;var X1=window.document.body.offsetWidth,Q1=Math.max(0,X1/2-fe/2),x1=".flatpickr-calendar.centerMost:before",e0=".flatpickr-calendar.centerMost:after",t0=ir.cssRules.length,n0="{left:"+Ae.left+"px;right:auto;}";gn(t.calendarContainer,"rightMost",!1),gn(t.calendarContainer,"centerMost",!0),ir.insertRule(x1+","+e0+n0,t0),t.calendarContainer.style.left=Q1+"px",t.calendarContainer.style.right="auto"}}}}function nn(){for(var K=null,G=0;Gt.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=fe,t.config.mode==="single")t.selectedDates=[Oe];else if(t.config.mode==="multiple"){var Fe=De(Oe);Fe?t.selectedDates.splice(parseInt(Fe),1):t.selectedDates.push(Oe)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Oe,t.selectedDates.push(Oe),On(Oe,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ke,St){return Ke.getTime()-St.getTime()}));if(c(),Pe){var Ae=t.currentYear!==Oe.getFullYear();t.currentYear=Oe.getFullYear(),t.currentMonth=Oe.getMonth(),Ae&&(et("onYearChange"),R()),et("onMonthChange")}if(Jt(),F(),It(),!Pe&&t.config.mode!=="range"&&t.config.showMonths===1?O(fe):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var Qe=t.config.mode==="single"&&!t.config.enableTime,ze=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||ze)&&Nn()}_()}}var Fn={locale:[ot,U],showMonths:[B,r,J],minDate:[S],maxDate:[S],positionElement:[Cn],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ie(K,G){if(K!==null&&typeof K=="object"){Object.assign(t.config,K);for(var ie in K)Fn[ie]!==void 0&&Fn[ie].forEach(function(fe){return fe()})}else t.config[K]=G,Fn[K]!==void 0?Fn[K].forEach(function(fe){return fe()}):Ir.indexOf(K)>-1&&(t.config[K]=Lr(G));t.redraw(),It(!0)}function Ot(K,G){var ie=[];if(K instanceof Array)ie=K.map(function(fe){return t.parseDate(fe,G)});else if(K instanceof Date||typeof K=="number")ie=[t.parseDate(K,G)];else if(typeof K=="string")switch(t.config.mode){case"single":case"time":ie=[t.parseDate(K,G)];break;case"multiple":ie=K.split(t.config.conjunction).map(function(fe){return t.parseDate(fe,G)});break;case"range":ie=K.split(t.l10n.rangeSeparator).map(function(fe){return t.parseDate(fe,G)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(K)));t.selectedDates=t.config.allowInvalidPreload?ie:ie.filter(function(fe){return fe instanceof Date&&Me(fe,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(fe,Oe){return fe.getTime()-Oe.getTime()})}function oi(K,G,ie){if(G===void 0&&(G=!1),ie===void 0&&(ie=t.config.dateFormat),K!==0&&!K||K instanceof Array&&K.length===0)return t.clear(G);Ot(K,ie),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,G),d(),t.selectedDates.length===0&&t.clear(!1),It(G),G&&et("onChange")}function cn(K){return K.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?t.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:t.parseDate(G.from,void 0),to:t.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function Xn(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var K=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);K&&Ot(K,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function Ai(){if(t.input=Te(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=mt(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Cn()}function Cn(){t._positionElement=t.config.positionElement||t._input}function Qn(){var K=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=mt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=K,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=K==="datetime-local"?"Y-m-d\\TH:i:S":K==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(G){t.setDate(Mn(G).value,!1,t.mobileFormatStr),et("onChange"),et("onClose")})}function en(K){if(t.isOpen===!0)return t.close();t.open(K)}function et(K,G){if(t.config!==void 0){var ie=t.config[K];if(ie!==void 0&&ie.length>0)for(var fe=0;ie[fe]&&fe=0&&On(K,t.selectedDates[1])<=0}function Jt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(K,G){var ie=new Date(t.currentYear,t.currentMonth,1);ie.setMonth(t.currentMonth+G),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[G].textContent=Ro(ie.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ie.getMonth().toString(),K.value=ie.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function it(K){var G=K||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ie){return t.formatDate(ie,G)}).filter(function(ie,fe,Oe){return t.config.mode!=="range"||t.config.enableTime||Oe.indexOf(ie)===fe}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function It(K){K===void 0&&(K=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=it(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=it(t.config.altFormat)),K!==!1&&et("onValueUpdate")}function Lt(K){var G=Mn(K),ie=t.prevMonthNav.contains(G),fe=t.nextMonthNav.contains(G);ie||fe?ee(ie?-1:1):t.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):G.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Rn(K){K.preventDefault();var G=K.type==="keydown",ie=Mn(K),fe=ie;t.amPM!==void 0&&ie===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]);var Oe=parseFloat(fe.getAttribute("min")),Pe=parseFloat(fe.getAttribute("max")),Fe=parseFloat(fe.getAttribute("step")),Ae=parseInt(fe.value,10),Qe=K.delta||(G?K.which===38?1:-1:0),ze=Ae+Fe*Qe;if(typeof fe.value<"u"&&fe.value.length===2){var Ke=fe===t.hourElement,St=fe===t.minuteElement;zePe&&(ze=fe===t.hourElement?ze-Pe-Vn(!t.amPM):Oe,St&&T(void 0,1,t.hourElement)),t.amPM&&Ke&&(Fe===1?ze+Ae===23:Math.abs(ze-Ae)>Fe)&&(t.amPM.textContent=t.l10n.amPM[Vn(t.amPM.textContent===t.l10n.amPM[0])]),fe.value=vn(ze)}}return s(),t}function $s(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;st===e[i]))}function EC(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=tt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,h=!1,{input:m=void 0,flatpickr:g=void 0}=e;Kt(()=>{const T=f??m,$=y(d);return $.onReady.push((M,O,D)=>{a===void 0&&S(M,O,D),ln().then(()=>{t(8,h=!0)})}),t(3,g=Xt(T,Object.assign($,f?{wrap:!0}:{}))),()=>{g.destroy()}});const _=pt();function y(T={}){T=Object.assign({},T);for(const $ of r){const M=(O,D,I)=>{_(OC($),[O,D,I])};$ in T?(Array.isArray(T[$])||(T[$]=[T[$]]),T[$].push(M)):T[$]=[M]}return T.onChange&&!T.onChange.includes(S)&&T.onChange.push(S),T}function S(T,$,M){const O=sd(M,T);!ld(a,O)&&(a||O)&&t(2,a=O),t(4,u=$)}function C(T){te[T?"unshift":"push"](()=>{m=T,t(0,m)})}return n.$$set=T=>{e=je(je({},e),xt(T)),t(1,s=tt(e,i)),"value"in T&&t(2,a=T.value),"formattedValue"in T&&t(4,u=T.formattedValue),"element"in T&&t(5,f=T.element),"dateFormat"in T&&t(6,c=T.dateFormat),"options"in T&&t(7,d=T.options),"input"in T&&t(0,m=T.input),"flatpickr"in T&&t(3,g=T.flatpickr),"$$scope"in T&&t(9,o=T.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&g&&h&&(ld(a,sd(g,g.selectedDates))||g.setDate(a,!0,c)),n.$$.dirty&392&&g&&h)for(const[T,$]of Object.entries(y(d)))g.set(T,$)},[m,s,a,g,u,f,c,d,h,o,l,C]}class ou extends be{constructor(e){super(),_e(this,e,EC,MC,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function DC(n){let e,t,i,s,l,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),l=new ou({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[8]),{c(){e=v("label"),t=W("Min date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const m={};h&32768&&(m.id=d[15]),!o&&h&4&&(o=!0,m.value=d[2],ve(()=>o=!1)),!r&&h&1&&(r=!0,m.formattedValue=d[0].options.min,ve(()=>r=!1)),l.$set(m)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function AC(n){let e,t,i,s,l,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[15],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),l=new ou({props:c}),te.push(()=>he(l,"value",u)),te.push(()=>he(l,"formattedValue",f)),l.$on("close",n[11]),{c(){e=v("label"),t=W("Max date (UTC)"),s=E(),z(l.$$.fragment),p(e,"for",i=n[15])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),H(l,d,h),a=!0},p(d,h){(!a||h&32768&&i!==(i=d[15]))&&p(e,"for",i);const m={};h&32768&&(m.id=d[15]),!o&&h&8&&(o=!0,m.value=d[3],ve(()=>o=!1)),!r&&h&1&&(r=!0,m.formattedValue=d[0].options.max,ve(()=>r=!1)),l.$set(m)},i(d){a||(A(l.$$.fragment,d),a=!0)},o(d){L(l.$$.fragment,d),a=!1},d(d){d&&(k(e),k(s)),V(l,d)}}}function IC(n){let e,t,i,s,l,o,r;return i=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[DC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[AC,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&98309&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&98313&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function LC(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[12](r)}let o={$$slots:{options:[IC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[13]),e.$on("remove",n[14]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?_t(s,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&65551&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function PC(n,e,t){var C,T;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=(C=l==null?void 0:l.options)==null?void 0:C.min,a=(T=l==null?void 0:l.options)==null?void 0:T.max;function u($,M){$.detail&&$.detail.length==3&&t(0,l.options[M]=$.detail[1],l)}function f($){r=$,t(2,r),t(0,l)}function c($){n.$$.not_equal(l.options.min,$)&&(l.options.min=$,t(0,l))}const d=$=>u($,"min");function h($){a=$,t(3,a),t(0,l)}function m($){n.$$.not_equal(l.options.max,$)&&(l.options.max=$,t(0,l))}const g=$=>u($,"max");function _($){l=$,t(0,l)}function y($){Re.call(this,n,$)}function S($){Re.call(this,n,$)}return n.$$set=$=>{e=je(je({},e),xt($)),t(5,s=tt(e,i)),"field"in $&&t(0,l=$.field),"key"in $&&t(1,o=$.key)},n.$$.update=()=>{var $,M,O,D;n.$$.dirty&5&&r!=(($=l==null?void 0:l.options)==null?void 0:$.min)&&t(2,r=(M=l==null?void 0:l.options)==null?void 0:M.min),n.$$.dirty&9&&a!=((O=l==null?void 0:l.options)==null?void 0:O.max)&&t(3,a=(D=l==null?void 0:l.options)==null?void 0:D.max)},[l,o,r,a,u,s,f,c,d,h,m,g,_,y,S]}class NC extends be{constructor(e){super(),_e(this,e,PC,LC,me,{field:0,key:1})}}const FC=n=>({}),od=n=>({});function rd(n,e,t){const i=n.slice();return i[48]=e[t],i}const RC=n=>({}),ad=n=>({});function ud(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function fd(n){let e,t,i;return{c(){e=v("div"),t=W(n[2]),i=E(),p(e,"class","block txt-placeholder"),Q(e,"link-hint",!n[5]&&!n[6])},m(s,l){w(s,e,l),b(e,t),b(e,i)},p(s,l){l[0]&4&&le(t,s[2]),l[0]&96&&Q(e,"link-hint",!s[5]&&!s[6])},d(s){s&&k(e)}}}function qC(n){let e,t=n[48]+"",i;return{c(){e=v("span"),i=W(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&1&&t!==(t=s[48]+"")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function jC(n){let e,t,i;const s=[{item:n[48]},n[11]];var l=n[10];function o(r,a){let u={};if(a!==void 0&&a[0]&2049)u=_t(s,[a[0]&1&&{item:r[48]},a[0]&2048&&Dt(r[11])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Nt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&2049?_t(s,[a[0]&1&&{item:r[48]},a[0]&2048&&Dt(r[11])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function cd(n){let e,t,i;function s(){return n[36](n[48])}return{c(){e=v("span"),e.innerHTML='',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Ce(Be.call(null,e,"Clear")),Y(e,"click",Sn(Ze(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function dd(n){let e,t,i,s,l,o;const r=[jC,qC],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&cd(n);return{c(){e=v("div"),i.c(),s=E(),f&&f.c(),l=E(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),b(e,s),f&&f.m(e,null),b(e,l),o=!0},p(c,d){let h=t;t=u(c),t===h?a[t].p(c,d):(re(),L(a[h],1,1,()=>{a[h]=null}),ae(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),A(i,1),i.m(e,s)),c[4]||c[8]?f?f.p(c,d):(f=cd(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){L(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function pd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[zC]},$$scope:{ctx:n}};return e=new Pn({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(s[7]?"dropdown-upside":"")),l[0]&1048576&&(o.trigger=s[20]),l[0]&6451722|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[41](null),V(e,s)}}}function hd(n){let e,t,i,s,l,o,r,a,u=n[17].length&&md(n);return{c(){e=v("div"),t=v("label"),i=v("div"),i.innerHTML='',s=E(),l=v("input"),o=E(),u&&u.c(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),b(e,t),b(t,i),b(t,s),b(t,l),de(l,n[17]),b(t,o),u&&u.m(t,null),l.focus(),r||(a=Y(l,"input",n[38]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&131072&&l.value!==f[17]&&de(l,f[17]),f[17].length?u?u.p(f,c):(u=md(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function md(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",Sn(Ze(n[23]))),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function gd(n){let e,t=n[1]&&_d(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=_d(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function _d(n){let e,t;return{c(){e=v("div"),t=W(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&2&&le(t,i[1])},d(i){i&&k(e)}}}function HC(n){let e=n[48]+"",t;return{c(){t=W(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&4194304&&e!==(e=i[48]+"")&&le(t,e)},i:x,o:x,d(i){i&&k(t)}}}function VC(n){let e,t,i;const s=[{item:n[48]},n[13]];var l=n[12];function o(r,a){let u={};if(a!==void 0&&a[0]&4202496)u=_t(s,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Dt(r[13])]);else for(let f=0;f{V(u,1)}),ae()}l?(e=Nt(l,o(r,a)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const u=a[0]&4202496?_t(s,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Dt(r[13])]):{};e.$set(u)}},i(r){i||(e&&A(e.$$.fragment,r),i=!0)},o(r){e&&L(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function bd(n){let e,t,i,s,l,o,r;const a=[VC,HC],u=[];function f(h,m){return h[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[39](n[48],...h)}function d(...h){return n[40](n[48],...h)}return{c(){e=v("div"),i.c(),s=E(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),Q(e,"closable",n[9]),Q(e,"selected",n[21](n[48]))},m(h,m){w(h,e,m),u[t].m(e,null),b(e,s),l=!0,o||(r=[Y(e,"click",c),Y(e,"keydown",d)],o=!0)},p(h,m){n=h;let g=t;t=f(n),t===g?u[t].p(n,m):(re(),L(u[g],1,1,()=>{u[g]=null}),ae(),i=u[t],i?i.p(n,m):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),(!l||m[0]&512)&&Q(e,"closable",n[9]),(!l||m[0]&6291456)&&Q(e,"selected",n[21](n[48]))},i(h){l||(A(i),l=!0)},o(h){L(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,$e(r)}}}function zC(n){let e,t,i,s,l,o=n[14]&&hd(n);const r=n[35].beforeOptions,a=Tt(r,n,n[44],ad);let u=pe(n[22]),f=[];for(let g=0;gL(f[g],1,1,()=>{f[g]=null});let d=null;u.length||(d=gd(n));const h=n[35].afterOptions,m=Tt(h,n,n[44],od);return{c(){o&&o.c(),e=E(),a&&a.c(),t=E(),i=v("div");for(let g=0;gL(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=fd(n));let c=!n[5]&&!n[6]&&pd(n);return{c(){e=v("div"),t=v("div");for(let d=0;d{c=null}),ae()),(!o||h[0]&32768&&l!==(l="select "+d[15]))&&p(e,"class",l),(!o||h[0]&32896)&&Q(e,"upside",d[7]),(!o||h[0]&32784)&&Q(e,"multiple",d[4]),(!o||h[0]&32800)&&Q(e,"disabled",d[5]),(!o||h[0]&32832)&&Q(e,"readonly",d[6])},i(d){if(!o){for(let h=0;hTe(ot,Ne))||[]}function Ee(ne,Ne){ne.preventDefault(),y&&d?Z(Ne):B(Ne)}function qe(ne,Ne){(ne.code==="Enter"||ne.code==="Space")&&(Ee(ne,Ne),S&&U())}function Ve(){ee(),setTimeout(()=>{const ne=F==null?void 0:F.querySelector(".dropdown-item.option.selected");ne&&(ne.focus(),ne.scrollIntoView({block:"nearest"}))},0)}function We(ne){ne.stopPropagation(),!m&&!h&&(N==null||N.toggle())}Kt(()=>{const ne=document.querySelectorAll(`label[for="${r}"]`);for(const Ne of ne)Ne.addEventListener("click",We);return()=>{for(const Ne of ne)Ne.removeEventListener("click",We)}});const ke=ne=>q(ne);function Me(ne){te[ne?"unshift":"push"](()=>{R=ne,t(20,R)})}function Je(){P=this.value,t(17,P)}const dt=(ne,Ne)=>Ee(Ne,ne),Se=(ne,Ne)=>qe(Ne,ne);function we(ne){te[ne?"unshift":"push"](()=>{N=ne,t(18,N)})}function Ue(ne){Re.call(this,n,ne)}function nt(ne){te[ne?"unshift":"push"](()=>{F=ne,t(19,F)})}return n.$$set=ne=>{"id"in ne&&t(27,r=ne.id),"noOptionsText"in ne&&t(1,a=ne.noOptionsText),"selectPlaceholder"in ne&&t(2,u=ne.selectPlaceholder),"searchPlaceholder"in ne&&t(3,f=ne.searchPlaceholder),"items"in ne&&t(28,c=ne.items),"multiple"in ne&&t(4,d=ne.multiple),"disabled"in ne&&t(5,h=ne.disabled),"readonly"in ne&&t(6,m=ne.readonly),"upside"in ne&&t(7,g=ne.upside),"selected"in ne&&t(0,_=ne.selected),"toggle"in ne&&t(8,y=ne.toggle),"closable"in ne&&t(9,S=ne.closable),"labelComponent"in ne&&t(10,C=ne.labelComponent),"labelComponentProps"in ne&&t(11,T=ne.labelComponentProps),"optionComponent"in ne&&t(12,$=ne.optionComponent),"optionComponentProps"in ne&&t(13,M=ne.optionComponentProps),"searchable"in ne&&t(14,O=ne.searchable),"searchFunc"in ne&&t(29,D=ne.searchFunc),"class"in ne&&t(15,I=ne.class),"$$scope"in ne&&t(44,o=ne.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(oe(),ee()),n.$$.dirty[0]&268566528&&t(22,i=se(c,P)),n.$$.dirty[0]&1&&t(21,s=function(ne){const Ne=j.toArray(_);return j.inArray(Ne,ne)})},[_,a,u,f,d,h,m,g,y,S,C,T,$,M,O,I,q,P,N,F,R,s,i,ee,Ee,qe,Ve,r,c,D,B,Z,X,J,U,l,ke,Me,Je,dt,Se,we,Ue,nt,o]}class z1 extends be{constructor(e){super(),_e(this,e,WC,BC,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function vd(n){let e,t;return{c(){e=v("i"),p(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&k(e)}}}function YC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",s,l=n[0].icon&&vd(n);return{c(){l&&l.c(),e=E(),t=v("span"),s=W(i),p(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),b(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=vd(o),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&le(s,i)},i:x,o:x,d(o){o&&(k(e),k(t)),l&&l.d(o)}}}function KC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class yd extends be{constructor(e){super(),_e(this,e,KC,YC,me,{item:0})}}const JC=n=>({}),kd=n=>({});function GC(n){let e;const t=n[8].afterOptions,i=Tt(t,n,n[12],kd);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&$t(i,t,s,s[12],e?Ct(t,s[12],l,JC):Mt(s[12]),kd)},i(s){e||(A(i,s),e=!0)},o(s){L(i,s),e=!1},d(s){i&&i.d(s)}}}function ZC(n){let e,t,i;const s=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function l(r){n[9](r)}let o={$$slots:{afterOptions:[GC]},$$scope:{ctx:n}};for(let r=0;rhe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&62?_t(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Dt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function XC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=tt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=yd}=e,{optionComponent:c=yd}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function m(C){C=j.toArray(C,!0);let T=[];for(let $ of C){const M=j.findByKey(r,d,$);M&&T.push(M)}C.length&&!T.length||t(0,u=a?T:T[0])}async function g(C){let T=j.toArray(C,!0).map($=>$[d]);r.length&&t(6,h=a?T:T[0])}function _(C){u=C,t(0,u)}function y(C){Re.call(this,n,C)}function S(C){Re.call(this,n,C)}return n.$$set=C=>{e=je(je({},e),xt(C)),t(5,s=tt(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,h=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&m(h),n.$$.dirty&1&&g(u)},[u,r,a,f,c,s,h,d,l,_,y,S,o]}class Ei extends be{constructor(e){super(),_e(this,e,XC,ZC,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function QC(n){let e,t,i,s,l,o;function r(u){n[7](u)}let a={id:n[13],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[14]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new qs({props:a}),te.push(()=>he(t,"value",r)),{c(){e=v("div"),z(t.$$.fragment)},m(u,f){w(u,e,f),H(t,e,null),s=!0,l||(o=Ce(Be.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),l=!0)},p(u,f){const c={};f&8192&&(c.id=u[13]),f&16384&&(c.readonly=!u[14]),!i&&f&1&&(i=!0,c.value=u[0].options.values,ve(()=>i=!1)),t.$set(c)},i(u){s||(A(t.$$.fragment,u),s=!0)},o(u){L(t.$$.fragment,u),s=!1},d(u){u&&k(e),V(t),l=!1,o()}}}function xC(n){let e,t,i;function s(o){n[8](o)}let l={id:n[13],items:n[3],readonly:!n[14]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8192&&(a.id=o[13]),r&16384&&(a.readonly=!o[14]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function e$(n){let e,t,i,s,l,o,r,a,u,f;return i=new ge({props:{class:"form-field required "+(n[14]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[QC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field form-field-single-multiple-select "+(n[14]?"":"readonly"),inlineError:!0,$$slots:{default:[xC,({uniqueId:c})=>({13:c}),({uniqueId:c})=>c?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16384&&(h.class="form-field required "+(c[14]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.values"),d&57345&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const m={};d&16384&&(m.class="form-field form-field-single-multiple-select "+(c[14]?"":"readonly")),d&57348&&(m.$$scope={dirty:d,ctx:c}),r.$set(m)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function wd(n){let e,t;return e=new ge({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[t$,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.maxSelect"),s&40961&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function t$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Max select"),s=E(),l=v("input"),p(e,"for",i=n[13]),p(l,"id",o=n[13]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.maxSelect&&de(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function n$(n){let e,t,i=!n[2]&&wd(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,l){s[2]?i&&(re(),L(i,1,1,()=>{i=null}),ae()):i?(i.p(s,l),l&4&&A(i,1)):(i=wd(s),i.c(),A(i,1),i.m(e.parentNode,e))},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function i$(n){let e,t,i;const s=[{key:n[1]},n[4]];function l(r){n[9](r)}let o={$$slots:{options:[n$],default:[e$,({interactive:r})=>({14:r}),({interactive:r})=>r?16384:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[10]),e.$on("remove",n[11]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&18?_t(s,[a&2&&{key:r[1]},a&16&&Dt(r[4])]):{};a&49159&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function s$(n,e,t){var y;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((y=l.options)==null?void 0:y.maxSelect)<=1,u=a;function f(){t(0,l.options={maxSelect:1,values:[]},l),t(2,a=!0),t(5,u=a)}function c(){l.options.maxSelect=yt(this.value),t(0,l),t(5,u),t(2,a)}function d(S){n.$$.not_equal(l.options.values,S)&&(l.options.values=S,t(0,l),t(5,u),t(2,a))}function h(S){a=S,t(2,a)}function m(S){l=S,t(0,l),t(5,u),t(2,a)}function g(S){Re.call(this,n,S)}function _(S){Re.call(this,n,S)}return n.$$set=S=>{e=je(je({},e),xt(S)),t(4,s=tt(e,i)),"field"in S&&t(0,l=S.field),"key"in S&&t(1,o=S.key)},n.$$.update=()=>{var S,C;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((C=(S=l.options)==null?void 0:S.values)==null?void 0:C.length)||2,l)),n.$$.dirty&1&&j.isEmpty(l.options)&&f()},[l,o,a,r,s,u,c,d,h,m,g,_]}class l$ extends be{constructor(e){super(),_e(this,e,s$,i$,me,{field:0,key:1})}}function o$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function r$(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O='"{"a":1,"b":2}"',D,I,N,P,F,R,q,B,Z,X,J,U,oe;return{c(){e=v("div"),t=v("div"),i=v("div"),s=W("In order to support seamlessly both "),l=v("code"),l.textContent="application/json",o=W(` and - `),r=v("code"),r.textContent="multipart/form-data",a=W(` - requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=W(` field - is a - `),c=v("strong"),c.textContent="plain string",d=W(`: - `),h=v("ul"),m=v("li"),m.innerHTML=""true" is converted to the json true",g=E(),_=v("li"),_.innerHTML=""false" is converted to the json false",y=E(),S=v("li"),S.innerHTML=""null" is converted to the json null",C=E(),T=v("li"),T.innerHTML=""[1,2,3]" is converted to the json [1,2,3]",$=E(),M=v("li"),D=W(O),I=W(" is converted to the json "),N=v("code"),N.textContent='{"a":1,"b":2}',P=E(),F=v("li"),F.textContent="numeric strings are converted to json number",R=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",B=E(),Z=v("li"),Z.textContent="any other string (empty string too) is double quoted",X=W(` - Alternatively, if you want to avoid the string value normalizations, you can wrap your - data inside an object, eg.`),J=v("code"),J.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,se){w(ee,e,se),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,h),b(h,m),b(h,g),b(h,_),b(h,y),b(h,S),b(h,C),b(h,T),b(h,$),b(h,M),b(M,D),b(M,I),b(M,N),b(h,P),b(h,F),b(h,R),b(h,q),b(h,B),b(h,Z),b(i,X),b(i,J),oe=!0},i(ee){oe||(ee&&xe(()=>{oe&&(U||(U=He(e,lt,{duration:150},!0)),U.run(1))}),oe=!0)},o(ee){ee&&(U||(U=He(e,lt,{duration:150},!1)),U.run(0)),oe=!1},d(ee){ee&&k(e),ee&&U&&U.end()}}}function a$(n){let e,t,i,s,l,o,r;function a(d,h){return d[2]?r$:o$}let u=a(n),f=u(n),c=n[2]&&Sd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,h){w(d,e,h),b(e,t),b(e,i),f.m(e,null),w(d,s,h),c&&c.m(d,h),w(d,l,h),o||(r=Y(e,"click",n[4]),o=!0)},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?h&4&&A(c,1):(c=Sd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),L(c,1,1,()=>{c=null}),ae())},d(d){d&&(k(e),k(s),k(l)),f.d(),c&&c.d(d),o=!1,r()}}}function u$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[a$]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&10?_t(s,[a&2&&{key:r[1]},a&8&&Dt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function f$(n,e,t){const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Re.call(this,n,d)}function c(d){Re.call(this,n,d)}return n.$$set=d=>{e=je(je({},e),xt(d)),t(3,s=tt(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class c$ extends be{constructor(e){super(),_e(this,e,f$,u$,me,{field:0,key:1})}}function d$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=W(t),s=E(),l=v("small"),r=W(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:x,o:x,d(a){a&&(k(e),k(s),k(l))}}}function p$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Td extends be{constructor(e){super(),_e(this,e,p$,d$,me,{item:0})}}const h$=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function m$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[22],items:n[4],readonly:!n[23]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&4194304&&(a.id=o[22]),r&8388608&&(a.readonly=!o[23]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function g$(n){let e,t,i,s,l,o;return i=new ge({props:{class:"form-field form-field-single-multiple-select "+(n[23]?"":"readonly"),inlineError:!0,$$slots:{default:[m$,({uniqueId:r})=>({22:r}),({uniqueId:r})=>r?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),p(e,"class","separator"),p(l,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),w(r,l,a),o=!0},p(r,a){const u={};a&8388608&&(u.class="form-field form-field-single-multiple-select "+(r[23]?"":"readonly")),a&29360132&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(A(i.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s),k(l)),V(i,r)}}}function _$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Images (jpg, png, svg, gif, webp)',t=E(),i=v("button"),i.innerHTML='Documents (pdf, doc/docx, xls/xlsx)',s=E(),l=v("button"),l.innerHTML='Videos (mp4, avi, mov, 3gp)',o=E(),r=v("button"),r.innerHTML='Archives (zip, 7zip, rar)',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[9]),Y(i,"click",n[10]),Y(l,"click",n[11]),Y(r,"click",n[12])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function b$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C;function T(M){n[8](M)}let $={id:n[22],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Td,optionComponent:Td};return n[0].options.mimeTypes!==void 0&&($.keyOfSelected=n[0].options.mimeTypes),r=new Ei({props:$}),te.push(()=>he(r,"keyOfSelected",T)),_=new Pn({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[_$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Allowed mime types",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("button"),d=v("span"),d.textContent="Choose presets",h=E(),m=v("i"),g=E(),z(_.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(d,"class","txt link-primary"),p(m,"class","ri-arrow-drop-down-fill"),p(c,"type","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(M,O){w(M,e,O),b(e,t),b(e,i),b(e,s),w(M,o,O),H(r,M,O),w(M,u,O),w(M,f,O),b(f,c),b(c,d),b(c,h),b(c,m),b(c,g),H(_,c,null),y=!0,S||(C=Ce(Be.call(null,s,{text:`Allow files ONLY with the listed mime types. - Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,O){(!y||O&4194304&&l!==(l=M[22]))&&p(e,"for",l);const D={};O&4194304&&(D.id=M[22]),O&8&&(D.items=M[3]),!a&&O&1&&(a=!0,D.keyOfSelected=M[0].options.mimeTypes,ve(()=>a=!1)),r.$set(D);const I={};O&16777217&&(I.$$scope={dirty:O,ctx:M}),_.$set(I)},i(M){y||(A(r.$$.fragment,M),A(_.$$.fragment,M),y=!0)},o(M){L(r.$$.fragment,M),L(_.$$.fragment,M),y=!1},d(M){M&&(k(e),k(o),k(u),k(f)),V(r,M),V(_),S=!1,C()}}}function v$(n){let e;return{c(){e=v("ul"),e.innerHTML=`
  • WxH - (eg. 100x50) - crop to WxH viewbox (from center)
  • WxHt - (eg. 100x50t) - crop to WxH viewbox (from top)
  • WxHb - (eg. 100x50b) - crop to WxH viewbox (from bottom)
  • WxHf - (eg. 100x50f) - fit inside a WxH viewbox (without cropping)
  • 0xH - (eg. 0x50) - resize to H height preserving the aspect ratio
  • Wx0 - (eg. 100x0) - resize to W width preserving the aspect ratio
  • `,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function y$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$;function M(D){n[13](D)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new qs({props:O}),te.push(()=>he(r,"value",M)),S=new Pn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[v$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),h=v("button"),m=v("span"),m.textContent="Supported formats",g=E(),_=v("i"),y=E(),z(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(m,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,I){w(D,e,I),b(e,t),b(e,i),b(e,s),w(D,o,I),H(r,D,I),w(D,u,I),w(D,f,I),b(f,c),b(f,d),b(f,h),b(h,m),b(h,g),b(h,_),b(h,y),H(S,h,null),C=!0,T||($=Ce(Be.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(D,I){(!C||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const N={};I&4194304&&(N.id=D[22]),!a&&I&1&&(a=!0,N.value=D[0].options.thumbs,ve(()=>a=!1)),r.$set(N);const P={};I&16777216&&(P.$$scope={dirty:I,ctx:D}),S.$set(P)},i(D){C||(A(r.$$.fragment,D),A(S.$$.fragment,D),C=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),C=!1},d(D){D&&(k(e),k(o),k(u),k(f)),V(r,D),V(S),T=!1,$()}}}function k$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&yt(l.value)!==c[0].options.maxSize&&de(l,c[0].options.maxSize)},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function Cd(n){let e,t,i;return t=new ge({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[w$,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function w$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.maxSelect&&de(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function S$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[b$,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[y$,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),f=new ge({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[k$,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}});let m=!n[2]&&Cd(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),d=E(),m&&m.c(),p(t,"class","col-sm-12"),p(l,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(g,_){w(g,e,_),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,a),b(e,u),H(f,u,null),b(e,d),m&&m.m(e,null),h=!0},p(g,_){const y={};_&2&&(y.name="schema."+g[1]+".options.mimeTypes"),_&20971529&&(y.$$scope={dirty:_,ctx:g}),i.$set(y);const S={};_&2&&(S.name="schema."+g[1]+".options.thumbs"),_&20971521&&(S.$$scope={dirty:_,ctx:g}),o.$set(S),(!h||_&4&&r!==(r=g[2]?"col-sm-8":"col-sm-6"))&&p(l,"class",r);const C={};_&2&&(C.name="schema."+g[1]+".options.maxSize"),_&20971521&&(C.$$scope={dirty:_,ctx:g}),f.$set(C),(!h||_&4&&c!==(c=g[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),g[2]?m&&(re(),L(m,1,1,()=>{m=null}),ae()):m?(m.p(g,_),_&4&&A(m,1)):(m=Cd(g),m.c(),A(m,1),m.m(e,null))},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(f.$$.fragment,g),A(m),h=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(f.$$.fragment,g),L(m),h=!1},d(g){g&&k(e),V(i),V(o),V(f),m&&m.d()}}}function T$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Protected",r=E(),a=v("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"class","txt"),p(s,"for",o=n[22]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,s,d),b(s,l),w(c,r,d),w(c,a,d),u||(f=Y(e,"change",n[7]),u=!0)},p(c,d){d&4194304&&t!==(t=c[22])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&4194304&&o!==(o=c[22])&&p(s,"for",o)},d(c){c&&(k(e),k(i),k(s),k(r),k(a)),u=!1,f()}}}function C$(n){let e,t;return e=new ge({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[T$,({uniqueId:i})=>({22:i}),({uniqueId:i})=>i?4194304:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&2&&(l.name="schema."+i[1]+".options.protected"),s&20971521&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $$(n){let e,t,i;const s=[{key:n[1]},n[5]];function l(r){n[17](r)}let o={$$slots:{optionsFooter:[C$],options:[S$],default:[g$,({interactive:r})=>({23:r}),({interactive:r})=>r?8388608:0]},$$scope:{ctx:n}};for(let r=0;rhe(e,"field",l)),e.$on("rename",n[18]),e.$on("remove",n[19]),{c(){z(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?_t(s,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&25165839&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ve(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function M$(n,e,t){var N;const i=["field","key"];let s=tt(e,i),{field:l}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=h$.slice(),u=((N=l.options)==null?void 0:N.maxSelect)<=1,f=u;function c(){t(0,l.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},l),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(l.options.mimeTypes))return;const P=[];for(const F of l.options.mimeTypes)a.find(R=>R.mimeType===F)||P.push({mimeType:F});P.length&&t(3,a=a.concat(P))}function h(){l.options.protected=this.checked,t(0,l),t(6,f),t(2,u)}function m(P){n.$$.not_equal(l.options.mimeTypes,P)&&(l.options.mimeTypes=P,t(0,l),t(6,f),t(2,u))}const g=()=>{t(0,l.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],l)},_=()=>{t(0,l.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],l)},y=()=>{t(0,l.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],l)},S=()=>{t(0,l.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],l)};function C(P){n.$$.not_equal(l.options.thumbs,P)&&(l.options.thumbs=P,t(0,l),t(6,f),t(2,u))}function T(){l.options.maxSize=yt(this.value),t(0,l),t(6,f),t(2,u)}function $(){l.options.maxSelect=yt(this.value),t(0,l),t(6,f),t(2,u)}function M(P){u=P,t(2,u)}function O(P){l=P,t(0,l),t(6,f),t(2,u)}function D(P){Re.call(this,n,P)}function I(P){Re.call(this,n,P)}return n.$$set=P=>{e=je(je({},e),xt(P)),t(5,s=tt(e,i)),"field"in P&&t(0,l=P.field),"key"in P&&t(1,o=P.key)},n.$$.update=()=>{var P,F;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,l.options.maxSelect=1,l):t(0,l.options.maxSelect=((F=(P=l.options)==null?void 0:P.values)==null?void 0:F.length)||99,l)),n.$$.dirty&1&&(j.isEmpty(l.options)?c():d())},[l,o,u,a,r,s,f,h,m,g,_,y,S,C,T,$,M,O,D,I]}class O$ extends be{constructor(e){super(),_e(this,e,M$,$$,me,{field:0,key:1})}}function E$(n){let e,t,i,s,l;return{c(){e=v("hr"),t=E(),i=v("button"),i.innerHTML=' New collection',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function D$(n){let e,t,i;function s(o){n[15](o)}let l={id:n[23],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[24]||n[0].id,$$slots:{afterOptions:[E$]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&16777217&&(a.readonly=!o[24]||o[0].id),r&33554440&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function A$(n){let e,t,i;function s(o){n[16](o)}let l={id:n[23],items:n[6],readonly:!n[24]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function I$(n){let e,t,i,s,l,o,r,a,u,f;return i=new ge({props:{class:"form-field required "+(n[24]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[D$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[A$,({uniqueId:c})=>({23:c}),({uniqueId:c})=>c?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),z(i.$$.fragment),s=E(),l=v("div"),o=E(),z(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const h={};d&16777216&&(h.class="form-field required "+(c[24]?"":"readonly")),d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&58720297&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);const m={};d&16777216&&(m.class="form-field form-field-single-multiple-select "+(c[24]?"":"readonly")),d&58720260&&(m.$$scope={dirty:d,ctx:c}),r.$set(m)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&(k(e),k(t),k(s),k(l),k(o),k(a),k(u)),V(i,c),V(r,c)}}}function $d(n){let e,t,i,s,l,o;return t=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[L$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),l=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[P$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),i=E(),s=v("div"),z(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),H(t,e,null),w(r,i,a),w(r,s,a),H(l,s,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&41943041&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&41943041&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(i),k(s)),V(t),V(l)}}}function L$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Min select"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.minSelect),r||(a=Y(l,"input",n[11]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.minSelect&&de(l,u[0].options.minSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function P$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Max select"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),p(l,"step","1"),p(l,"placeholder","No max limit"),p(l,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[0].options.maxSelect),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&8388608&&i!==(i=f[23])&&p(e,"for",i),c&8388608&&o!==(o=f[23])&&p(l,"id",o),c&1&&r!==(r=f[0].options.minSelect||2)&&p(l,"min",r),c&1&&yt(l.value)!==f[0].options.maxSelect&&de(l,f[0].options.maxSelect)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function N$(n){let e,t,i,s,l,o,r,a,u,f,c,d;function h(g){n[13](g)}let m={id:n[23],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(m.keyOfSelected=n[0].options.cascadeDelete),a=new Ei({props:m}),te.push(()=>he(a,"keyOfSelected",h)),{c(){e=v("label"),t=v("span"),t.textContent="Cascade delete",i=E(),s=v("i"),r=E(),z(a.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",o=n[23])},m(g,_){var y,S;w(g,e,_),b(e,t),b(e,i),b(e,s),w(g,r,_),H(a,g,_),f=!0,c||(d=Ce(l=Be.call(null,s,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` - -`),position:"top"})),c=!0)},p(g,_){var S,C;l&&Et(l.update)&&_&20&&l.update.call(null,{text:[`Whether on ${((S=g[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,g[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((C=g[4])==null?void 0:C.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(` - -`),position:"top"}),(!f||_&8388608&&o!==(o=g[23]))&&p(e,"for",o);const y={};_&8388608&&(y.id=g[23]),!u&&_&1&&(u=!0,y.keyOfSelected=g[0].options.cascadeDelete,ve(()=>u=!1)),a.$set(y)},i(g){f||(A(a.$$.fragment,g),f=!0)},o(g){L(a.$$.fragment,g),f=!1},d(g){g&&(k(e),k(r)),V(a,g),c=!1,d()}}}function F$(n){let e,t,i,s,l,o=!n[2]&&$d(n);return s=new ge({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[N$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),o&&o.c(),t=E(),i=v("div"),z(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),b(e,t),b(e,i),H(s,i,null),l=!0},p(r,a){r[2]?o&&(re(),L(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&A(o,1)):(o=$d(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(A(o),A(s.$$.fragment,r),l=!0)},o(r){L(o),L(s.$$.fragment,r),l=!1},d(r){r&&k(e),o&&o.d(),V(s)}}}function R$(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[F$],default:[I$,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;fhe(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return s=new ru({props:u}),n[20](s),s.$on("save",n[21]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,c){H(e,f,c),w(f,i,c),H(s,f,c),l=!0},p(f,[c]){const d=c&258?_t(o,[c&2&&{key:f[1]},c&256&&Dt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ve(()=>t=!1)),e.$set(d);const h={};s.$set(h)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){f&&k(i),V(e,f),n[20](null),V(s,f)}}}function q$(n,e,t){var P;let i,s;const l=["field","key"];let o=tt(e,l),r;Ge(n,Zn,F=>t(10,r=F));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,h=((P=a.options)==null?void 0:P.maxSelect)==1,m=h;function g(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,h=!0),t(9,m=h)}function _(){a.options.minSelect=yt(this.value),t(0,a),t(9,m),t(2,h)}function y(){a.options.maxSelect=yt(this.value),t(0,a),t(9,m),t(2,h)}function S(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,m),t(2,h))}const C=()=>d==null?void 0:d.show();function T(F){n.$$.not_equal(a.options.collectionId,F)&&(a.options.collectionId=F,t(0,a),t(9,m),t(2,h))}function $(F){h=F,t(2,h)}function M(F){a=F,t(0,a),t(9,m),t(2,h)}function O(F){Re.call(this,n,F)}function D(F){Re.call(this,n,F)}function I(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const N=F=>{var R,q;(q=(R=F==null?void 0:F.detail)==null?void 0:R.collection)!=null&&q.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=je(je({},e),xt(F)),t(8,o=tt(e,l)),"field"in F&&t(0,a=F.field),"key"in F&&t(1,u=F.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(F=>F.type!="view")),n.$$.dirty&516&&m!=h&&(t(9,m=h),h?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&g(),n.$$.dirty&1025&&t(4,s=r.find(F=>F.id==a.options.collectionId)||null)},[a,u,h,d,s,i,f,c,o,m,r,_,y,S,C,T,$,M,O,D,I,N]}class j$ extends be{constructor(e){super(),_e(this,e,q$,R$,me,{field:0,key:1})}}const H$=n=>({dragging:n&4,dragover:n&8}),Md=n=>({dragging:n[2],dragover:n[3]});function V$(n){let e,t,i,s,l;const o=n[10].default,r=Tt(o,n,n[9],Md);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[Y(e,"dragover",Ze(n[11])),Y(e,"dragleave",Ze(n[12])),Y(e,"dragend",n[13]),Y(e,"dragstart",n[14]),Y(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&$t(r,o,a,a[9],i?Ct(o,a[9],u,H$):Mt(a[9]),Md),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&Q(e,"dragging",a[2]),(!i||u&8)&&Q(e,"dragover",a[3])},i(a){i||(A(r,a),i=!0)},o(a){L(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,$e(l)}}}function z$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function h(T,$){if(!(!T||u)){if(f&&!T.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),T.preventDefault();return}t(2,c=!0),T.dataTransfer.effectAllowed="move",T.dataTransfer.dropEffect="move",T.dataTransfer.setData("text/plain",JSON.stringify({index:$,group:a})),l("drag",T)}}function m(T,$){if(t(3,d=!1),t(2,c=!1),!T||u)return;T.dataTransfer.dropEffect="move";let M={};try{M=JSON.parse(T.dataTransfer.getData("text/plain"))}catch{}if(M.group!=a)return;const O=M.index<<0;O<$?(r.splice($+1,0,r[O]),r.splice(O,1)):(r.splice($,0,r[O]),r.splice(O+1,1)),t(6,r),l("sort",{oldIndex:O,newIndex:$,list:r})}const g=()=>{t(3,d=!0)},_=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=T=>h(T,o),C=T=>m(T,o);return n.$$set=T=>{"index"in T&&t(0,o=T.index),"list"in T&&t(6,r=T.list),"group"in T&&t(7,a=T.group),"disabled"in T&&t(1,u=T.disabled),"dragHandleClass"in T&&t(8,f=T.dragHandleClass),"$$scope"in T&&t(9,s=T.$$scope)},[o,u,c,d,h,m,r,a,f,s,i,g,_,y,S,C]}class Fl extends be{constructor(e){super(),_e(this,e,z$,V$,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Od(n,e,t){const i=n.slice();return i[17]=e[t],i[18]=e,i[19]=t,i}function Ed(n){let e,t,i,s,l,o,r,a;return{c(){e=W(`, - `),t=v("code"),t.textContent="username",i=W(` , - `),s=v("code"),s.textContent="email",l=W(` , - `),o=v("code"),o.textContent="emailVisibility",r=W(` , - `),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r),k(a))}}}function B$(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=Nt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&z(e.$$.fragment),i=E()},m(u,f){e&&H(e,u,f),w(u,i,f),s=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){re();const c=e;L(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(e=Nt(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],ve(()=>t=!1)),e.$set(c)}},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){u&&k(i),e&&V(e,u)}}}function Dd(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[B$]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function U$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],m=new Map,g,_,y,S,C,T,$,M,O=n[0].type==="auth"&&Ed(),D=pe(n[0].schema);const I=F=>F[17];for(let F=0;Fhe(T,"collection",N)),{c(){e=v("div"),t=v("p"),i=W(`System fields: - `),s=v("code"),s.textContent="id",l=W(` , - `),o=v("code"),o.textContent="created",r=W(` , - `),a=v("code"),a.textContent="updated",u=E(),O&&O.c(),f=W(` - .`),c=E(),d=v("div");for(let F=0;F$=!1)),T.$set(q)},i(F){if(!M){for(let R=0;RM.name===T))}function f(T){return i.findIndex($=>$===T)}function c(T,$){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||T===$||!$||t(0,s.indexes=s.indexes.map(O=>j.replaceIndexColumn(O,T,$)),s)}function d(T,$,M,O){M[O]=T,t(0,s)}const h=T=>o(T),m=T=>c(T.detail.oldName,T.detail.newName);function g(T){n.$$.not_equal(s.schema,T)&&(s.schema=T,t(0,s))}const _=T=>{if(!T.detail)return;const $=T.detail.target;$.style.opacity=0,setTimeout(()=>{var M;(M=$==null?void 0:$.style)==null||M.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage($,0,0)},y=()=>{on({})},S=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,c,d,h,m,g,_,y,S,C]}class Y$ extends be{constructor(e){super(),_e(this,e,W$,U$,me,{collection:0})}}const K$=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),J$=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]}),G$=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]});function Z$(n){let e,t;return e=new ge({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[Q$,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function X$(n){let e;return{c(){e=v("div"),e.innerHTML='',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Pd(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Set Admins only',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Nd(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Unlock and set custom rule
    ',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Q$(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,h,m,g,_,y,S;const C=n[12].beforeLabel,T=Tt(C,n,n[15],Ld),$=n[12].afterLabel,M=Tt($,n,n[15],Id);let O=!n[9]&&Pd(n);function D(q){n[14](q)}var I=n[7];function N(q,B){let Z={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(Z.value=q[0]),{props:Z}}I&&(h=Nt(I,N(n)),n[13](h),te.push(()=>he(h,"value",D)));let P=n[9]&&Nd(n);const F=n[12].default,R=Tt(F,n,n[15],Ad);return{c(){e=v("div"),t=v("label"),T&&T.c(),i=E(),s=v("span"),l=W(n[2]),o=E(),a=W(r),u=E(),M&&M.c(),f=E(),O&&O.c(),d=E(),h&&z(h.$$.fragment),g=E(),P&&P.c(),_=E(),y=v("div"),R&&R.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,B){w(q,e,B),b(e,t),T&&T.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),M&&M.m(t,null),b(t,f),O&&O.m(t,null),b(e,d),h&&H(h,e,null),b(e,g),P&&P.m(e,null),w(q,_,B),w(q,y,B),R&&R.m(y,null),S=!0},p(q,B){if(T&&T.p&&(!S||B&33280)&&$t(T,C,q,q[15],S?Ct(C,q[15],B,G$):Mt(q[15]),Ld),(!S||B&4)&&le(l,q[2]),(!S||B&512)&&r!==(r=q[9]?"- Admins only":"")&&le(a,r),(!S||B&512)&&Q(s,"txt-hint",q[9]),M&&M.p&&(!S||B&33280)&&$t(M,$,q,q[15],S?Ct($,q[15],B,J$):Mt(q[15]),Id),q[9]?O&&(O.d(1),O=null):O?O.p(q,B):(O=Pd(q),O.c(),O.m(t,null)),(!S||B&262144&&c!==(c=q[18]))&&p(t,"for",c),B&128&&I!==(I=q[7])){if(h){re();const Z=h;L(Z.$$.fragment,1,0,()=>{V(Z,1)}),ae()}I?(h=Nt(I,N(q)),q[13](h),te.push(()=>he(h,"value",D)),z(h.$$.fragment),A(h.$$.fragment,1),H(h,e,g)):h=null}else if(I){const Z={};B&262144&&(Z.id=q[18]),B&2&&(Z.baseCollection=q[1]),B&512&&(Z.disabled=q[9]),B&544&&(Z.placeholder=q[9]?"":q[5]),!m&&B&1&&(m=!0,Z.value=q[0],ve(()=>m=!1)),h.$set(Z)}q[9]?P?(P.p(q,B),B&512&&A(P,1)):(P=Nd(q),P.c(),A(P,1),P.m(e,null)):P&&(re(),L(P,1,1,()=>{P=null}),ae()),R&&R.p&&(!S||B&33280)&&$t(R,F,q,q[15],S?Ct(F,q[15],B,K$):Mt(q[15]),Ad)},i(q){S||(A(T,q),A(M,q),h&&A(h.$$.fragment,q),A(P),A(R,q),S=!0)},o(q){L(T,q),L(M,q),h&&L(h.$$.fragment,q),L(P),L(R,q),S=!1},d(q){q&&(k(e),k(_),k(y)),T&&T.d(q),M&&M.d(q),O&&O.d(),n[13](null),h&&V(h),P&&P.d(),R&&R.d(q)}}}function x$(n){let e,t,i,s;const l=[X$,Z$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}let Fd;function eM(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,h=null,m=Fd,g=!1;_();async function _(){m||g||(t(8,g=!0),t(7,m=(await ft(()=>import("./FilterAutocompleteInput-288f3849.js"),["./FilterAutocompleteInput-288f3849.js","./index-30dee195.js"],import.meta.url)).default),Fd=m,t(8,g=!1))}async function y(){t(0,r=h||""),await ln(),d==null||d.focus()}async function S(){h=r,t(0,r=null)}function C($){te[$?"unshift":"push"](()=>{d=$,t(6,d)})}function T($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,u=$.formKey),"required"in $&&t(4,f=$.required),"placeholder"in $&&t(5,c=$.placeholder),"$$scope"in $&&t(15,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,m,g,i,y,S,s,C,T,l]}class Ms extends be{constructor(e){super(),_e(this,e,eM,x$,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Rd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O,D,I=pe(n[2]),N=[];for(let P=0;P@request filter:",c=E(),d=v("div"),d.innerHTML="@request.headers.* @request.query.* @request.data.* @request.auth.*",h=E(),m=v("hr"),g=E(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the @collection filter:",y=E(),S=v("div"),S.innerHTML="@collection.ANY_COLLECTION_NAME.*",C=E(),T=v("hr"),$=E(),M=v("p"),M.innerHTML=`Example rule: -
    @request.auth.id != "" && created > "2022-01-01 00:00:00"`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(m,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,F){w(P,e,F),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R{D&&(O||(O=He(e,lt,{duration:150},!0)),O.run(1))}),D=!0)},o(P){P&&(O||(O=He(e,lt,{duration:150},!1)),O.run(0)),D=!1},d(P){P&&k(e),vt(N,P),P&&O&&O.end()}}}function jd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=W(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&le(i,t)},d(s){s&&k(e)}}}function Hd(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[tM,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ms({props:c}),te.push(()=>he(e,"rule",f));function d(_){n[7](_)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Ms({props:h}),te.push(()=>he(s,"rule",d));function m(_){n[8](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Ms({props:g}),te.push(()=>he(r,"rule",m)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(_,y){H(e,_,y),w(_,i,y),H(s,_,y),w(_,o,y),H(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&17408&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,ve(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!l&&y&1&&(l=!0,C.rule=_[0].updateRule,ve(()=>l=!1)),s.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,ve(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){L(e.$$.fragment,_),L(s.$$.fragment,_),L(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),V(e,_),V(s,_),V(r,_)}}}function Vd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Ce(Be.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function tM(n){let e,t=!n[10]&&Vd();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=Vd(),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function zd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[nM]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ms({props:l}),te.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function nM(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg. - changing the password without requiring to enter the old one, directly updating the verified - state or email, etc.`,t=E(),i=v("p"),i.innerHTML="This rule is executed in addition to the create and update API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&(k(e),k(t),k(i))}}}function iM(n){var F,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,m,g,_,y,S,C,T,$=n[1]&&qd(n);function M(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Ms({props:O}),te.push(()=>he(f,"rule",M));function D(q){n[5](q)}let I={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(I.rule=n[0].viewRule),h=new Ms({props:I}),te.push(()=>he(h,"rule",D));let N=((F=n[0])==null?void 0:F.type)!=="view"&&Hd(n),P=((R=n[0])==null?void 0:R.type)==="auth"&&zd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the -
    PocketBase filter syntax and operators - .`,s=E(),l=v("button"),r=W(o),a=E(),$&&$.c(),u=E(),z(f.$$.fragment),d=E(),z(h.$$.fragment),g=E(),N&&N.c(),_=E(),P&&P.c(),y=ye(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,B){w(q,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),$&&$.m(e,null),w(q,u,B),H(f,q,B),w(q,d,B),H(h,q,B),w(q,g,B),N&&N.m(q,B),w(q,_,B),P&&P.m(q,B),w(q,y,B),S=!0,C||(T=Y(l,"click",n[3]),C=!0)},p(q,[B]){var J,U;(!S||B&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&le(r,o),q[1]?$?($.p(q,B),B&2&&A($,1)):($=qd(q),$.c(),A($,1),$.m(e,null)):$&&(re(),L($,1,1,()=>{$=null}),ae());const Z={};B&1&&(Z.collection=q[0]),!c&&B&1&&(c=!0,Z.rule=q[0].listRule,ve(()=>c=!1)),f.$set(Z);const X={};B&1&&(X.collection=q[0]),!m&&B&1&&(m=!0,X.rule=q[0].viewRule,ve(()=>m=!1)),h.$set(X),((J=q[0])==null?void 0:J.type)!=="view"?N?(N.p(q,B),B&1&&A(N,1)):(N=Hd(q),N.c(),A(N,1),N.m(_.parentNode,_)):N&&(re(),L(N,1,1,()=>{N=null}),ae()),((U=q[0])==null?void 0:U.type)==="auth"?P?(P.p(q,B),B&1&&A(P,1)):(P=zd(q),P.c(),A(P,1),P.m(y.parentNode,y)):P&&(re(),L(P,1,1,()=>{P=null}),ae())},i(q){S||(A($),A(f.$$.fragment,q),A(h.$$.fragment,q),A(N),A(P),S=!0)},o(q){L($),L(f.$$.fragment,q),L(h.$$.fragment,q),L(N),L(P),S=!1},d(q){q&&(k(e),k(u),k(d),k(g),k(_),k(y)),$&&$.d(),V(f,q),V(h,q),N&&N.d(q),P&&P.d(q),C=!1,T()}}}function sM(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function c(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function d(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class lM extends be{constructor(e){super(),_e(this,e,sM,iM,me,{collection:0})}}function Bd(n,e,t){const i=n.slice();return i[9]=e[t],i}function oM(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Nt(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;L(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Nt(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ve(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function rM(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Ud(n){let e,t,i=pe(n[3]),s=[];for(let l=0;l
  • Wildcard columns (*) are not supported.
  • The query must have a unique id column. -
    - If your query doesn't have a suitable one, you can use the universal - (ROW_NUMBER() OVER()) as id.
  • Expressions must be aliased with a valid formatted field name (eg. - MAX(balance) as maxBalance).
  • `,u=E(),g&&g.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),h[l].m(_,y),w(_,r,y),w(_,a,y),w(_,u,y),g&&g.m(_,y),w(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=m(_),l===S?h[l].p(_,y):(re(),L(h[S],1,1,()=>{h[S]=null}),ae(),o=h[l],o?o.p(_,y):(o=h[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=Ud(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(A(o),c=!0)},o(_){L(o),c=!1},d(_){_&&(k(e),k(s),k(r),k(a),k(u),k(f)),h[l].d(_),g&&g.d(_)}}}function uM(n){let e,t;return e=new ge({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[aM,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function fM(n,e,t){let i;Ge(n,Mi,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var m;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const h=j.extractColumnsFromQuery((m=s==null?void 0:s.options)==null?void 0:m.query);j.removeByValue(h,"id"),j.removeByValue(h,"created"),j.removeByValue(h,"updated");for(let g in d)for(let _ in d[g]){const y=d[g][_].message,S=h[g]||g;r.push(j.sentenize(S+": "+y))}}Kt(async()=>{t(2,o=!0);try{t(1,l=(await ft(()=>import("./CodeEditor-c648ece6.js"),["./CodeEditor-c648ece6.js","./index-30dee195.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&pi("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class cM extends be{constructor(e){super(),_e(this,e,fM,uM,me,{collection:0})}}const dM=n=>({active:n&1}),Yd=n=>({active:n[0]});function Kd(n){let e,t,i;const s=n[15].default,l=Tt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&$t(l,s,o,o[14],i?Ct(s,o[14],r,null):Mt(o[14]),null)},i(o){i||(A(l,o),o&&xe(()=>{i&&(t||(t=He(e,lt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=He(e,lt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function pM(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Tt(a,n,n[14],Yd);let f=n[0]&&Kd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[Y(t,"click",Ze(n[17])),Y(t,"drop",Ze(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",Ze(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&$t(u,a,c,c[14],l?Ct(a,c[14],d,dM):Mt(c[14]),Yd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Kd(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),L(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){L(u,c),L(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,$e(r)}}}function hM(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function m(){return!!f}function g(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():g()}function S(){if(d&&o.closest(".accordions")){const N=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of N)P.click()}}Kt(()=>()=>clearTimeout(r));function C(N){Re.call(this,n,N)}const T=()=>c&&y(),$=N=>{u&&(t(7,h=!1),S(),l("drop",N))},M=N=>u&&l("dragstart",N),O=N=>{u&&(t(7,h=!0),l("dragenter",N))},D=N=>{u&&(t(7,h=!1),l("dragleave",N))};function I(N){te[N?"unshift":"push"](()=>{o=N,t(6,o)})}return n.$$set=N=>{"class"in N&&t(1,a=N.class),"draggable"in N&&t(2,u=N.draggable),"active"in N&&t(0,f=N.active),"interactive"in N&&t(3,c=N.interactive),"single"in N&&t(9,d=N.single),"$$scope"in N&&t(14,s=N.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,y,S,o,h,l,d,m,g,_,r,s,i,C,T,$,M,O,D,I]}class po extends be{constructor(e){super(),_e(this,e,hM,pM,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function mM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[5]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function gM(n){let e,t;return e=new ge({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[mM,({uniqueId:i})=>({12:i}),({uniqueId:i})=>i?4096:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&12289&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _M(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function bM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Jd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ce(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function vM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowUsernameAuth?bM:_M}let a=r(n),u=a(n),f=n[3]&&Jd();return{c(){e=v("div"),e.innerHTML=' Username/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[3]?f?d&8&&A(f,1):(f=Jd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),L(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function yM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Gd(n){let e,t,i,s,l,o,r,a;return i=new ge({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[kM,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[wM,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&xe(()=>{a&&(r||(r=He(e,lt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){L(i.$$.fragment,u),L(o.$$.fragment,u),u&&(r||(r=He(e,lt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),V(i),V(o),u&&r&&r.end()}}}function kM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(_){n[7](_)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new qs({props:g}),te.push(()=>he(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Ce(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up. - This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function wM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(_){n[8](_)}let g={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new qs({props:g}),te.push(()=>he(r,"value",m)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),H(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Ce(Be.call(null,s,{text:`Email domains that are ONLY allowed to sign up. - This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ve(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),V(r,_),d=!1,h()}}}function SM(n){let e,t,i,s;e=new ge({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[yM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Gd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Gd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function TM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function CM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ce(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function $M(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?CM:TM}let a=r(n),u=a(n),f=n[2]&&Zd();return{c(){e=v("div"),e.innerHTML=' Email/Password',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Zd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),L(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function MM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Xd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=He(e,lt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=He(e,lt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function OM(n){let e,t,i,s;e=new ge({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[MM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Xd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Xd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),V(e,o),l&&l.d(o)}}}function EM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function DM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Qd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ce(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function AM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?DM:EM}let a=r(n),u=a(n),f=n[1]&&Qd();return{c(){e=v("div"),e.innerHTML=' OAuth2',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&A(f,1):(f=Qd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),L(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function IM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Minimum password length"),s=E(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].options.minPasswordLength&&de(l,u[0].options.minPasswordLength)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function LM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),Ce(Be.call(null,r,{text:`The constraint is applied only for new records. -Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function PM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y;return s=new po({props:{single:!0,$$slots:{header:[vM],default:[gM]},$$scope:{ctx:n}}}),o=new po({props:{single:!0,$$slots:{header:[$M],default:[SM]},$$scope:{ctx:n}}}),a=new po({props:{single:!0,$$slots:{header:[AM],default:[OM]},$$scope:{ctx:n}}}),m=new ge({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[IM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new ge({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[LM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",h=E(),z(m.$$.fragment),g=E(),z(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,C){w(S,e,C),w(S,t,C),w(S,i,C),H(s,i,null),b(i,l),H(o,i,null),b(i,r),H(a,i,null),w(S,u,C),w(S,f,C),w(S,c,C),w(S,d,C),w(S,h,C),H(m,S,C),w(S,g,C),H(_,S,C),y=!0},p(S,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:S}),s.$set(T);const $={};C&8197&&($.$$scope={dirty:C,ctx:S}),o.$set($);const M={};C&8195&&(M.$$scope={dirty:C,ctx:S}),a.$set(M);const O={};C&12289&&(O.$$scope={dirty:C,ctx:S}),m.$set(O);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),_.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(m.$$.fragment,S),A(_.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(m.$$.fragment,S),L(_.$$.fragment,S),y=!1},d(S){S&&(k(e),k(t),k(i),k(u),k(f),k(c),k(d),k(h),k(g)),V(s),V(o),V(a),V(m,S),V(_,S)}}}function NM(n,e,t){let i,s,l,o;Ge(n,Mi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=yt(this.value),t(0,r)}function m(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,_,y,S;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,m]}class FM extends be{constructor(e){super(),_e(this,e,NM,PM,me,{collection:0})}}function xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function ep(n,e,t){const i=n.slice();return i[18]=e[t],i}function tp(n,e,t){const i=n.slice();return i[18]=e[t],i}function np(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ip(n){let e,t,i,s,l=n[3]&&sp(n),o=!n[4]&&lp(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=sp(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=lp(r),o.c(),o.m(i,null))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(),o&&o.d()}}}function sp(n){var h,m;let e,t,i,s,l=((h=n[1])==null?void 0:h.name)+"",o,r,a,u,f,c=((m=n[2])==null?void 0:m.name)+"",d;return{c(){e=v("li"),t=v("div"),i=W(`Renamed collection - `),s=v("strong"),o=W(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=W(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(g,_){w(g,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(g,_){var y,S;_&2&&l!==(l=((y=g[1])==null?void 0:y.name)+"")&&le(o,l),_&4&&c!==(c=((S=g[2])==null?void 0:S.name)+"")&&le(d,c)},d(g){g&&k(e)}}}function lp(n){let e,t,i,s=pe(n[6]),l=[];for(let f=0;f
    ',i=E(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query, - you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=ye(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=np(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=ip(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function qM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function jM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='Cancel',t=E(),i=v("button"),i.innerHTML='Confirm',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[Y(e,"click",n[12]),Y(i,"click",n[13])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function HM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[jM],header:[qM],default:[RM]},$$scope:{ctx:n}};return e=new rn({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),V(e,s)}}}function VM(n,e,t){let i,s,l,o,r,a;const u=pt();let f,c,d;async function h($,M){t(1,c=$),t(2,d=M),await ln(),i||l.length||o.length||r.length?f==null||f.show():g()}function m(){f==null||f.hide()}function g(){m(),u("confirm")}const _=()=>m(),y=()=>g();function S($){te[$?"unshift":"push"](()=>{f=$,t(5,f)})}function C($){Re.call(this,n,$)}function T($){Re.call(this,n,$)}return n.$$.update=()=>{var $,M,O;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=(($=d==null?void 0:d.schema)==null?void 0:$.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>{var N,P,F;const I=(N=c==null?void 0:c.schema)==null?void 0:N.find(R=>R.id==D.id);return I?((P=I.options)==null?void 0:P.maxSelect)!=1&&((F=D.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[m,c,d,i,s,f,r,o,l,a,g,h,_,y,S,C,T]}class zM extends be{constructor(e){super(),_e(this,e,VM,HM,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function up(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function BM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new Y$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function UM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new cM({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function fp(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new lM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ve(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function cp(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new FM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===Ls)},m(r,a){w(r,e,a),H(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ve(()=>i=!1)),t.$set(u),(!s||a[0]&8)&&Q(e,"active",r[3]===Ls)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function WM(n){let e,t,i,s,l,o,r;const a=[UM,BM],u=[];function f(h,m){return h[14]?0:1}i=f(n),s=u[i]=a[i](n);let c=n[3]===kl&&fp(n),d=n[15]&&cp(n);return{c(){e=v("div"),t=v("div"),s.c(),l=E(),c&&c.c(),o=E(),d&&d.c(),p(t,"class","tab-item"),Q(t,"active",n[3]===ji),p(e,"class","tabs-content svelte-12y0yzb")},m(h,m){w(h,e,m),b(e,t),u[i].m(t,null),b(e,l),c&&c.m(e,null),b(e,o),d&&d.m(e,null),r=!0},p(h,m){let g=i;i=f(h),i===g?u[i].p(h,m):(re(),L(u[g],1,1,()=>{u[g]=null}),ae(),s=u[i],s?s.p(h,m):(s=u[i]=a[i](h),s.c()),A(s,1),s.m(t,null)),(!r||m[0]&8)&&Q(t,"active",h[3]===ji),h[3]===kl?c?(c.p(h,m),m[0]&8&&A(c,1)):(c=fp(h),c.c(),A(c,1),c.m(e,o)):c&&(re(),L(c,1,1,()=>{c=null}),ae()),h[15]?d?(d.p(h,m),m[0]&32768&&A(d,1)):(d=cp(h),d.c(),A(d,1),d.m(e,null)):d&&(re(),L(d,1,1,()=>{d=null}),ae())},i(h){r||(A(s),A(c),A(d),r=!0)},o(h){L(s),L(c),L(d),r=!1},d(h){h&&k(e),u[i].d(),c&&c.d(),d&&d.d()}}}function dp(n){let e,t,i,s,l,o,r;return o=new Pn({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[YM]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),i=v("button"),s=v("i"),l=E(),z(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),b(i,s),b(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[1]&4194304&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),V(o)}}}function YM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=' Duplicate',t=E(),i=v("button"),i.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[26]),Y(i,"click",Sn(Ze(n[27])))],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function pp(n){let e,t,i,s;return i=new Pn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[KM]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),z(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&(k(e),k(t)),V(i,l)}}}function hp(n){let e,t,i,s,l,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=W(o),a=W(" collection"),u=E(),p(t,"class",i=ii(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(h,m){w(h,e,m),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=Y(e,"click",d),f=!0)},p(h,m){n=h,m[0]&64&&i!==(i=ii(j.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),m[0]&64&&o!==(o=n[50]+"")&&le(r,o),m[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(h){h&&k(e),f=!1,c()}}}function KM(n){let e,t=pe(Object.entries(n[6])),i=[];for(let s=0;s{P=null}),ae()):P?(P.p(R,q),q[0]&4&&A(P,1)):(P=pp(R),P.c(),A(P,1),P.m(d,null)),(!D||q[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(R[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",T),(!D||q[0]&4&&$!==($=!!R[2].id))&&(d.disabled=$),R[2].system?F||(F=mp(),F.c(),F.m(O.parentNode,O)):F&&(F.d(1),F=null)},i(R){D||(A(P),D=!0)},o(R){L(P),D=!1},d(R){R&&(k(e),k(s),k(l),k(f),k(c),k(M),k(O)),P&&P.d(),F&&F.d(R),I=!1,N()}}}function gp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ce(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&Et(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{s&&(i||(i=He(e,Qt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=He(e,Qt,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function _p(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ce(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function bp(n){var a,u,f;let e,t,i,s=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),l,o,r=s&&vp();return{c(){e=v("button"),t=v("span"),t.textContent="Options",i=E(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),Q(e,"active",n[3]===Ls)},m(c,d){w(c,e,d),b(e,t),b(e,i),r&&r.m(e,null),l||(o=Y(e,"click",n[33]),l=!0)},p(c,d){var h,m,g;d[0]&32&&(s=!j.isEmpty((h=c[5])==null?void 0:h.options)&&!((g=(m=c[5])==null?void 0:m.options)!=null&&g.manageRule)),s?r?d[0]&32&&A(r,1):(r=vp(),r.c(),A(r,1),r.m(e,null)):r&&(re(),L(r,1,1,()=>{r=null}),ae()),d[0]&8&&Q(e,"active",c[3]===Ls)},d(c){c&&k(e),r&&r.d(),l=!1,o()}}}function vp(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ce(Be.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function GM(n){var B,Z,X,J,U,oe,ee;let e,t=n[2].id?"Edit collection":"New collection",i,s,l,o,r,a,u,f,c,d,h,m=n[14]?"Query":"Fields",g,_,y=!j.isEmpty(n[11]),S,C,T,$,M=!j.isEmpty((B=n[5])==null?void 0:B.listRule)||!j.isEmpty((Z=n[5])==null?void 0:Z.viewRule)||!j.isEmpty((X=n[5])==null?void 0:X.createRule)||!j.isEmpty((J=n[5])==null?void 0:J.updateRule)||!j.isEmpty((U=n[5])==null?void 0:U.deleteRule)||!j.isEmpty((ee=(oe=n[5])==null?void 0:oe.options)==null?void 0:ee.manageRule),O,D,I,N,P=!!n[2].id&&!n[2].system&&dp(n);r=new ge({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[JM,({uniqueId:se})=>({48:se}),({uniqueId:se})=>[0,se?131072:0]]},$$scope:{ctx:n}}});let F=y&&gp(n),R=M&&_p(),q=n[15]&&bp(n);return{c(){e=v("h4"),i=W(t),s=E(),P&&P.c(),l=E(),o=v("form"),z(r.$$.fragment),a=E(),u=v("input"),f=E(),c=v("div"),d=v("button"),h=v("span"),g=W(m),_=E(),F&&F.c(),S=E(),C=v("button"),T=v("span"),T.textContent="API Rules",$=E(),R&&R.c(),O=E(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),Q(d,"active",n[3]===ji),p(T,"class","txt"),p(C,"type","button"),p(C,"class","tab-item"),Q(C,"active",n[3]===kl),p(c,"class","tabs-header stretched")},m(se,Ee){w(se,e,Ee),b(e,i),w(se,s,Ee),P&&P.m(se,Ee),w(se,l,Ee),w(se,o,Ee),H(r,o,null),b(o,a),b(o,u),w(se,f,Ee),w(se,c,Ee),b(c,d),b(d,h),b(h,g),b(d,_),F&&F.m(d,null),b(c,S),b(c,C),b(C,T),b(C,$),R&&R.m(C,null),b(c,O),q&&q.m(c,null),D=!0,I||(N=[Y(o,"submit",Ze(n[30])),Y(d,"click",n[31]),Y(C,"click",n[32])],I=!0)},p(se,Ee){var Ve,We,ke,Me,Je,dt,Se;(!D||Ee[0]&4)&&t!==(t=se[2].id?"Edit collection":"New collection")&&le(i,t),se[2].id&&!se[2].system?P?(P.p(se,Ee),Ee[0]&4&&A(P,1)):(P=dp(se),P.c(),A(P,1),P.m(l.parentNode,l)):P&&(re(),L(P,1,1,()=>{P=null}),ae());const qe={};Ee[0]&8192&&(qe.class="form-field collection-field-name required m-b-0 "+(se[13]?"disabled":"")),Ee[0]&41028|Ee[1]&4325376&&(qe.$$scope={dirty:Ee,ctx:se}),r.$set(qe),(!D||Ee[0]&16384)&&m!==(m=se[14]?"Query":"Fields")&&le(g,m),Ee[0]&2048&&(y=!j.isEmpty(se[11])),y?F?(F.p(se,Ee),Ee[0]&2048&&A(F,1)):(F=gp(se),F.c(),A(F,1),F.m(d,null)):F&&(re(),L(F,1,1,()=>{F=null}),ae()),(!D||Ee[0]&8)&&Q(d,"active",se[3]===ji),Ee[0]&32&&(M=!j.isEmpty((Ve=se[5])==null?void 0:Ve.listRule)||!j.isEmpty((We=se[5])==null?void 0:We.viewRule)||!j.isEmpty((ke=se[5])==null?void 0:ke.createRule)||!j.isEmpty((Me=se[5])==null?void 0:Me.updateRule)||!j.isEmpty((Je=se[5])==null?void 0:Je.deleteRule)||!j.isEmpty((Se=(dt=se[5])==null?void 0:dt.options)==null?void 0:Se.manageRule)),M?R?Ee[0]&32&&A(R,1):(R=_p(),R.c(),A(R,1),R.m(C,null)):R&&(re(),L(R,1,1,()=>{R=null}),ae()),(!D||Ee[0]&8)&&Q(C,"active",se[3]===kl),se[15]?q?q.p(se,Ee):(q=bp(se),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(se){D||(A(P),A(r.$$.fragment,se),A(F),A(R),D=!0)},o(se){L(P),L(r.$$.fragment,se),L(F),L(R),D=!1},d(se){se&&(k(e),k(s),k(l),k(o),k(f),k(c)),P&&P.d(se),V(r),F&&F.d(),R&&R.d(),q&&q.d(),I=!1,$e(N)}}}function ZM(n){let e,t,i,s,l,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=W(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],Q(s,"btn-loading",n[9])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=[Y(e,"click",n[24]),Y(s,"click",n[25])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&le(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(s.disabled=a),d[0]&512&&Q(s,"btn-loading",c[9])},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function XM(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[38],$$slots:{footer:[ZM],header:[GM],default:[WM]},$$scope:{ctx:n}};e=new rn({props:l}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let o={};return i=new zM({props:o}),n[42](i),i.$on("confirm",n[43]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[38]),a[0]&64108|a[1]&4194304&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[39](null),V(e,r),n[42](null),V(i,r)}}}const ji="schema",kl="api_rules",Ls="options",QM="base",yp="auth",kp="view";function Rr(n){return JSON.stringify(n)}function xM(n,e,t){let i,s,l,o,r,a;Ge(n,Mi,ne=>t(5,a=ne));const u={};u[QM]="Base",u[kp]="View",u[yp]="Auth";const f=pt();let c,d,h=null,m=j.initCollection(),g=!1,_=!1,y=ji,S=Rr(m),C="";function T(ne){t(3,y=ne)}function $(ne){return O(ne),t(10,_=!0),T(ji),c==null?void 0:c.show()}function M(){return c==null?void 0:c.hide()}async function O(ne){on({}),typeof ne<"u"?(t(22,h=ne),t(2,m=structuredClone(ne))):(t(22,h=null),t(2,m=j.initCollection())),t(2,m.schema=m.schema||[],m),t(2,m.originalName=m.name||"",m),await ln(),t(23,S=Rr(m))}function D(){m.id?d==null||d.show(h,m):I()}function I(){if(g)return;t(9,g=!0);const ne=N();let Ne;m.id?Ne=ce.collections.update(m.id,ne):Ne=ce.collections.create(ne),Ne.then(Te=>{La(),ek(Te),t(10,_=!1),M(),zt(m.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!m.id,collection:Te})}).catch(Te=>{ce.error(Te)}).finally(()=>{t(9,g=!1)})}function N(){const ne=Object.assign({},m);ne.schema=ne.schema.slice(0);for(let Ne=ne.schema.length-1;Ne>=0;Ne--)ne.schema[Ne].toDelete&&ne.schema.splice(Ne,1);return ne}function P(){h!=null&&h.id&&_n(`Do you really want to delete collection "${h.name}" and all its records?`,()=>ce.collections.delete(h.id).then(()=>{M(),zt(`Successfully deleted collection "${h.name}".`),f("delete",h),tk(h)}).catch(ne=>{ce.error(ne)}))}function F(ne){t(2,m.type=ne,m),pi("schema")}function R(){o?_n("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ne=h?structuredClone(h):null;if(ne){if(ne.id="",ne.created="",ne.updated="",ne.name+="_duplicate",!j.isEmpty(ne.schema))for(const Ne of ne.schema)Ne.id="";if(!j.isEmpty(ne.indexes))for(let Ne=0;NeM(),Z=()=>D(),X=()=>R(),J=()=>P(),U=ne=>{t(2,m.name=j.slugify(ne.target.value),m),ne.target.value=m.name},oe=ne=>F(ne),ee=()=>{r&&D()},se=()=>T(ji),Ee=()=>T(kl),qe=()=>T(Ls);function Ve(ne){m=ne,t(2,m),t(22,h)}function We(ne){m=ne,t(2,m),t(22,h)}function ke(ne){m=ne,t(2,m),t(22,h)}function Me(ne){m=ne,t(2,m),t(22,h)}const Je=()=>o&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),M()}),!1):!0;function dt(ne){te[ne?"unshift":"push"](()=>{c=ne,t(7,c)})}function Se(ne){Re.call(this,n,ne)}function we(ne){Re.call(this,n,ne)}function Ue(ne){te[ne?"unshift":"push"](()=>{d=ne,t(8,d)})}const nt=()=>I();return n.$$.update=()=>{var ne,Ne;n.$$.dirty[0]&4&&m.type==="view"&&(t(2,m.createRule=null,m),t(2,m.updateRule=null,m),t(2,m.deleteRule=null,m),t(2,m.indexes=[],m)),n.$$.dirty[0]&4194308&&m.name&&(h==null?void 0:h.name)!=m.name&&m.indexes.length>0&&t(2,m.indexes=(ne=m.indexes)==null?void 0:ne.map(Te=>j.replaceIndexTableName(Te,m.name)),m),n.$$.dirty[0]&4&&t(15,i=m.type===yp),n.$$.dirty[0]&4&&t(14,s=m.type===kp),n.$$.dirty[0]&32&&(a.schema||(Ne=a.options)!=null&&Ne.query?t(11,C=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,C="")),n.$$.dirty[0]&4&&t(13,l=!!m.id&&m.system),n.$$.dirty[0]&8388612&&t(4,o=S!=Rr(m)),n.$$.dirty[0]&20&&t(12,r=!m.id||o),n.$$.dirty[0]&12&&y===Ls&&m.type!=="auth"&&T(ji)},[T,M,m,y,o,a,u,c,d,g,_,C,r,l,s,i,D,I,P,F,R,$,h,S,B,Z,X,J,U,oe,ee,se,Ee,qe,Ve,We,ke,Me,Je,dt,Se,we,Ue,nt]}class ru extends be{constructor(e){super(),_e(this,e,xM,XM,me,{changeTab:0,show:21,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}}function e6(n){let e;return{c(){e=v("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function t6(n){let e;return{c(){e=v("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function n6(n){let e,t,i,s,l,o=n[0].name+"",r,a,u,f,c,d,h,m;function g(S,C){return S[1]?t6:e6}let _=g(n),y=_(n);return{c(){var S;e=v("a"),t=v("i"),s=E(),l=v("span"),r=W(o),a=E(),u=v("span"),y.c(),p(t,"class",i=ii(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(l,"class","txt m-r-auto"),p(u,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(u,"aria-label","Pin collection"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),Q(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,C){w(S,e,C),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),y.m(u,null),h||(m=[Ce(f=Be.call(null,u,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),Y(u,"click",Sn(Ze(n[5]))),Ce(dn.call(null,e))],h=!0)},p(S,[C]){var T;C&1&&i!==(i=ii(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),C&1&&o!==(o=S[0].name+"")&&le(r,o),_!==(_=g(S))&&(y.d(1),y=_(S),y&&(y.c(),y.m(u,null))),f&&Et(f.update)&&C&2&&f.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),C&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),C&1&&d!==(d=S[0].name)&&p(e,"title",d),C&5&&Q(e,"active",((T=S[2])==null?void 0:T.id)===S[0].id)},i:x,o:x,d(S){S&&k(e),y.d(),h=!1,$e(m)}}}function i6(n,e,t){let i,s;Ge(n,hi,u=>t(2,s=u));let{collection:l}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?j.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(l);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(l.id))},[l,i,s,r,o,a]}class B1 extends be{constructor(e){super(),_e(this,e,i6,n6,me,{collection:0,pinnedIds:4})}}function wp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Sp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Tp(n){let e,t,i=[],s=new Map,l,o,r=pe(n[6]);const a=u=>u[22].id;for(let u=0;uhe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&64&&(f.collection=e[22]),!s&&u&2&&(s=!0,f.pinnedIds=e[1],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function $p(n){let e,t=[],i=new Map,s,l,o=n[6].length&&Mp(),r=pe(n[5]);const a=u=>u[22].id;for(let u=0;uhe(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&32&&(f.collection=e[22]),!s&&u&2&&(s=!0,f.pinnedIds=e[1],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function Ep(n){let e;return{c(){e=v("p"),e.textContent="No collections found.",p(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dp(n){let e,t,i,s;return{c(){e=v("footer"),t=v("button"),t.innerHTML=' New collection',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",n[16]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function s6(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S=n[6].length&&Tp(n),C=n[5].length&&$p(n),T=n[3].length&&!n[2].length&&Ep(),$=!n[9]&&Dp(n);return{c(){e=v("header"),t=v("div"),i=v("div"),s=v("button"),s.innerHTML='',l=E(),o=v("input"),r=E(),a=v("hr"),u=E(),f=v("div"),S&&S.c(),c=E(),C&&C.c(),d=E(),T&&T.c(),h=E(),$&&$.c(),m=ye(),p(s,"type","button"),p(s,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(s,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),Q(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),Q(f,"fade",n[8]),Q(f,"sidebar-content-compact",n[2].length>20)},m(M,O){w(M,e,O),b(e,t),b(t,i),b(i,s),b(t,l),b(t,o),de(o,n[0]),w(M,r,O),w(M,a,O),w(M,u,O),w(M,f,O),S&&S.m(f,null),b(f,c),C&&C.m(f,null),b(f,d),T&&T.m(f,null),w(M,h,O),$&&$.m(M,O),w(M,m,O),g=!0,_||(y=[Y(s,"click",n[12]),Y(o,"input",n[13])],_=!0)},p(M,O){(!g||O&128)&&Q(s,"hidden",!M[7]),O&1&&o.value!==M[0]&&de(o,M[0]),(!g||O&128)&&Q(t,"active",M[7]),M[6].length?S?(S.p(M,O),O&64&&A(S,1)):(S=Tp(M),S.c(),A(S,1),S.m(f,c)):S&&(re(),L(S,1,1,()=>{S=null}),ae()),M[5].length?C?(C.p(M,O),O&32&&A(C,1)):(C=$p(M),C.c(),A(C,1),C.m(f,d)):C&&(re(),L(C,1,1,()=>{C=null}),ae()),M[3].length&&!M[2].length?T||(T=Ep(),T.c(),T.m(f,null)):T&&(T.d(1),T=null),(!g||O&256)&&Q(f,"fade",M[8]),(!g||O&4)&&Q(f,"sidebar-content-compact",M[2].length>20),M[9]?$&&($.d(1),$=null):$?$.p(M,O):($=Dp(M),$.c(),$.m(m.parentNode,m))},i(M){g||(A(S),A(C),g=!0)},o(M){L(S),L(C),g=!1},d(M){M&&(k(e),k(r),k(a),k(u),k(f),k(h),k(m)),S&&S.d(),C&&C.d(),T&&T.d(),$&&$.d(M),_=!1,$e(y)}}}function l6(n){let e,t,i,s;e=new R1({props:{class:"collection-sidebar",$$slots:{default:[s6]},$$scope:{ctx:n}}});let l={};return i=new ru({props:l}),n[17](i),i.$on("save",n[18]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[17](null),V(i,o)}}}const Ap="@pinnedCollections";function o6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function r6(n,e,t){let i,s,l,o,r,a,u,f,c;Ge(n,Zn,I=>t(11,a=I)),Ge(n,hi,I=>t(19,u=I)),Ge(n,wo,I=>t(8,f=I)),Ge(n,Es,I=>t(9,c=I));let d,h="",m=[];_();function g(I){un(hi,u=I,u)}function _(){t(1,m=[]);try{const I=localStorage.getItem(Ap);I&&t(1,m=JSON.parse(I)||[])}catch{}}function y(){t(1,m=m.filter(I=>!!a.find(N=>N.id==I)))}const S=()=>t(0,h="");function C(){h=this.value,t(0,h)}function T(I){m=I,t(1,m)}function $(I){m=I,t(1,m)}const M=()=>d==null?void 0:d.show();function O(I){te[I?"unshift":"push"](()=>{d=I,t(4,d)})}const D=I=>{var N;(N=I.detail)!=null&&N.isNew&&I.detail.collection&&g(I.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),o6()),n.$$.dirty&1&&t(3,i=h.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,s=h!==""),n.$$.dirty&2&&m&&localStorage.setItem(Ap,JSON.stringify(m)),n.$$.dirty&2057&&t(2,l=a.filter(I=>I.id==h||I.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=l.filter(I=>m.includes(I.id))),n.$$.dirty&6&&t(5,r=l.filter(I=>!m.includes(I.id)))},[h,m,l,i,d,r,o,s,f,c,g,a,S,C,T,$,M,O,D]}class a6 extends be{constructor(e){super(),_e(this,e,r6,l6,me,{})}}function Ip(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Lp(n){n[18]=n[19].default}function Pp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Np(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Fp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Np();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),s=E(),l=v("button"),r=W(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(h,m){w(h,t,m),c&&c.m(h,m),w(h,s,m),w(h,l,m),b(l,r),b(l,a),u||(f=Y(l,"click",d),u=!0)},p(h,m){e=h,m&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Np(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),m&8&&o!==(o=e[15].label+"")&&le(r,o),m&40&&Q(l,"active",e[5]===e[14])},d(h){h&&(k(t),k(s),k(l)),c&&c.d(h),u=!1,f()}}}function Rp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:c6,then:f6,catch:u6,value:19,blocks:[,,,]};return hu(t=n[15].component,s),{c(){e=ye(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.anchor=e,i=!0},p(l,o){n=l,s.ctx=n,o&8&&t!==(t=n[15].component)&&hu(t,s)||S0(s,n,o)},i(l){i||(A(s.block),i=!0)},o(l){for(let o=0;o<3;o+=1){const r=s.blocks[o];L(r)}i=!1},d(l){l&&k(e),s.block.d(l),s.token=null,s=null}}}function u6(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function f6(n){Lp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){z(e.$$.fragment),t=E()},m(s,l){H(e,s,l),w(s,t,l),i=!0},p(s,l){Lp(s);const o={};l&4&&(o.collection=s[2]),e.$set(o)},i(s){i||(A(e.$$.fragment,s),i=!0)},o(s){L(e.$$.fragment,s),i=!1},d(s){s&&k(t),V(e,s)}}}function c6(n){return{c:x,m:x,p:x,i:x,o:x,d:x}}function qp(n,e){let t,i,s,l=e[5]===e[14]&&Rp(e);return{key:n,first:null,c(){t=ye(),l&&l.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[5]===e[14]?l?(l.p(e,r),r&40&&A(l,1)):(l=Rp(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),L(l,1,1,()=>{l=null}),ae())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&(k(t),k(i)),l&&l.d(o)}}}function d6(n){let e,t,i,s=[],l=new Map,o,r,a=[],u=new Map,f,c=pe(Object.entries(n[3]));const d=g=>g[14];for(let g=0;gg[14];for(let g=0;gClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[8]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function h6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[p6],default:[d6]},$$scope:{ctx:n}};return e=new rn({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4194348&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function m6(n,e,t){const i={list:{label:"List/Search",component:ft(()=>import("./ListApiDocs-3cd045c1.js"),["./ListApiDocs-3cd045c1.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js","./ListApiDocs-68f52edd.css"],import.meta.url)},view:{label:"View",component:ft(()=>import("./ViewApiDocs-7f75b66b.js"),["./ViewApiDocs-7f75b66b.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},create:{label:"Create",component:ft(()=>import("./CreateApiDocs-0d934784.js"),["./CreateApiDocs-0d934784.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},update:{label:"Update",component:ft(()=>import("./UpdateApiDocs-ae87c615.js"),["./UpdateApiDocs-ae87c615.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},delete:{label:"Delete",component:ft(()=>import("./DeleteApiDocs-fd29a801.js"),["./DeleteApiDocs-fd29a801.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},realtime:{label:"Realtime",component:ft(()=>import("./RealtimeApiDocs-531c981c.js"),["./RealtimeApiDocs-531c981c.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}},s={"auth-with-password":{label:"Auth with password",component:ft(()=>import("./AuthWithPasswordDocs-107160ee.js"),["./AuthWithPasswordDocs-107160ee.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:ft(()=>import("./AuthWithOAuth2Docs-a6296efb.js"),["./AuthWithOAuth2Docs-a6296efb.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},refresh:{label:"Auth refresh",component:ft(()=>import("./AuthRefreshDocs-335aea06.js"),["./AuthRefreshDocs-335aea06.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},"request-verification":{label:"Request verification",component:ft(()=>import("./RequestVerificationDocs-7606398a.js"),["./RequestVerificationDocs-7606398a.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-verification":{label:"Confirm verification",component:ft(()=>import("./ConfirmVerificationDocs-a6b36296.js"),["./ConfirmVerificationDocs-a6b36296.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-password-reset":{label:"Request password reset",component:ft(()=>import("./RequestPasswordResetDocs-c6b478f9.js"),["./RequestPasswordResetDocs-c6b478f9.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:ft(()=>import("./ConfirmPasswordResetDocs-ea85ce68.js"),["./ConfirmPasswordResetDocs-ea85ce68.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"request-email-change":{label:"Request email change",component:ft(()=>import("./RequestEmailChangeDocs-67bd3d32.js"),["./RequestEmailChangeDocs-67bd3d32.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:ft(()=>import("./ConfirmEmailChangeDocs-0dc32323.js"),["./ConfirmEmailChangeDocs-0dc32323.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)},"list-auth-methods":{label:"List auth methods",component:ft(()=>import("./AuthMethodsDocs-33f5e9f2.js"),["./AuthMethodsDocs-33f5e9f2.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:ft(()=>import("./ListExternalAuthsDocs-2258a5ea.js"),["./ListExternalAuthsDocs-2258a5ea.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css","./FieldsQueryParam-f6b769d1.js"],import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:ft(()=>import("./UnlinkExternalAuthDocs-d7bb55bc.js"),["./UnlinkExternalAuthDocs-d7bb55bc.js","./SdkTabs-f0532e58.js","./SdkTabs-9b0b7a06.css"],import.meta.url)}};let l,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),l==null?void 0:l.show()}function f(){return l==null?void 0:l.hide()}function c(y){t(5,r=y)}const d=()=>f(),h=y=>c(y);function m(y){te[y?"unshift":"push"](()=>{l=y,t(4,l)})}function g(y){Re.call(this,n,y)}function _(y){Re.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,s)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,l,r,i,u,d,h,m,g,_]}class g6 extends be{constructor(e){super(),_e(this,e,m6,h6,me,{show:7,hide:0,changeTab:1})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}get changeTab(){return this.$$.ctx[1]}}function _6(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(l,o){w(l,e,o),i||(s=Ce(t=Be.call(null,e,{text:n[0].join(` -`),position:"left"})),i=!0)},p(l,[o]){t&&Et(t.update)&&o&1&&t.update.call(null,{text:l[0].join(` -`),position:"left"})},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}const jp="yyyy-MM-dd HH:mm:ss.SSS";function b6(n,e,t){let{model:i}=e,s=[];function l(){t(0,s=[]),i.created&&s.push("Created: "+j.formatToLocalDate(i.created,jp)+" Local"),i.updated&&s.push("Updated: "+j.formatToLocalDate(i.updated,jp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&l()},[s,i]}class U1 extends be{constructor(e){super(),_e(this,e,b6,_6,me,{model:1})}}function v6(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),s||(l=[Ce(i=Be.call(null,e,n[2]?"":"Copy")),Y(e,"click",Sn(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&Et(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function y6(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(j.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Kt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class js extends be{constructor(e){super(),_e(this,e,y6,v6,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function k6(n){let e,t,i,s,l,o,r,a,u,f;return l=new js({props:{value:n[1]}}),{c(){e=v("div"),t=v("span"),i=W(n[1]),s=E(),z(l.$$.fragment),o=E(),r=v("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),b(e,t),b(t,i),n[6](t),b(e,s),H(l,e,null),b(e,o),b(e,r),a=!0,u||(f=[Ce(Be.call(null,r,"Refresh")),Y(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&le(i,c[1]);const h={};d&2&&(h.value=c[1]),l.$set(h)},i(c){a||(A(l.$$.fragment,c),a=!0)},o(c){L(l.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),V(l),u=!1,$e(f)}}}function w6(n){let e,t,i,s,l,o,r,a,u,f;function c(h){n[7](h)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[k6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Pn({props:d}),te.push(()=>he(s,"active",c)),s.$on("show",n[4]),{c(){e=v("button"),t=v("i"),i=E(),z(s.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(h,m){w(h,e,m),b(e,t),b(e,i),H(s,e,null),a=!0,u||(f=Ce(r=Be.call(null,e,n[3]?"":"Generate")),u=!0)},p(h,[m]){const g={};m&518&&(g.$$scope={dirty:m,ctx:h}),!l&&m&8&&(l=!0,g.active=h[3],ve(()=>l=!1)),s.$set(g),(!a||m&1&&o!==(o="btn btn-circle "+h[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Et(r.update)&&m&8&&r.update.call(null,h[3]?"":"Generate")},i(h){a||(A(s.$$.fragment,h),a=!0)},o(h){L(s.$$.fragment,h),a=!1},d(h){h&&k(e),V(s),u=!1,f()}}}function S6(n,e,t){const i=pt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(l)),i("generate",o),await ln(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class W1 extends be{constructor(e){super(),_e(this,e,S6,w6,me,{class:0,length:5})}}function T6(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Username",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(h,m){w(h,e,m),b(e,t),b(e,i),b(e,s),w(h,o,m),w(h,r,m),de(r,n[0].username),c||(d=Y(r,"input",n[5]),c=!0)},p(h,m){m&8192&&l!==(l=h[13])&&p(e,"for",l),m&4&&a!==(a=!h[2])&&p(r,"requried",a),m&4&&u!==(u=h[2]?"Leave empty to auto generate...":h[4])&&p(r,"placeholder",u),m&8192&&f!==(f=h[13])&&p(r,"id",f),m&1&&r.value!==h[0].username&&de(r,h[0].username)},d(h){h&&(k(e),k(o),k(r)),c=!1,d()}}}function C6(n){let e,t,i,s,l,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,h,m,g,_,y,S,C;return{c(){var T;e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("div"),a=v("button"),u=v("span"),f=W("Public: "),d=W(c),m=E(),g=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",h="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(g,"type","email"),g.autofocus=n[2],p(g,"autocomplete","off"),p(g,"id",_=n[13]),g.required=y=(T=n[1].options)==null?void 0:T.requireEmail,p(g,"class","svelte-1751a4d")},m(T,$){w(T,e,$),b(e,t),b(e,i),b(e,s),w(T,o,$),w(T,r,$),b(r,a),b(a,u),b(u,f),b(u,d),w(T,m,$),w(T,g,$),de(g,n[0].email),n[2]&&g.focus(),S||(C=[Ce(Be.call(null,a,{text:"Make email public or private",position:"top-right"})),Y(a,"click",Ze(n[6])),Y(g,"input",n[7])],S=!0)},p(T,$){var M;$&8192&&l!==(l=T[13])&&p(e,"for",l),$&1&&c!==(c=T[0].emailVisibility?"On":"Off")&&le(d,c),$&1&&h!==(h="btn btn-sm btn-transparent "+(T[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",h),$&4&&(g.autofocus=T[2]),$&8192&&_!==(_=T[13])&&p(g,"id",_),$&2&&y!==(y=(M=T[1].options)==null?void 0:M.requireEmail)&&(g.required=y),$&1&&g.value!==T[0].email&&de(g,T[0].email)},d(T){T&&(k(e),k(o),k(r),k(m),k(g)),S=!1,$e(C)}}}function Hp(n){let e,t;return e=new ge({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[$6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&24584&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Vp(n){let e,t,i,s,l,o,r,a,u;return s=new ge({props:{class:"form-field required",name:"password",$$slots:{default:[M6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[O6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),Q(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c&24577&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&24577&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!u||c&8)&&Q(t,"p-t-xs",f[3])},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function M6(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m;return c=new W1({props:{length:15}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(f,"class","form-field-addon")},m(g,_){w(g,e,_),b(e,t),b(e,i),b(e,s),w(g,o,_),w(g,r,_),de(r,n[0].password),w(g,u,_),w(g,f,_),H(c,f,null),d=!0,h||(m=Y(r,"input",n[9]),h=!0)},p(g,_){(!d||_&8192&&l!==(l=g[13]))&&p(e,"for",l),(!d||_&8192&&a!==(a=g[13]))&&p(r,"id",a),_&1&&r.value!==g[0].password&&de(r,g[0].password)},i(g){d||(A(c.$$.fragment,g),d=!0)},o(g){L(c.$$.fragment,g),d=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,m()}}}function O6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[0].passwordConfirm),u||(f=Y(r,"input",n[10]),u=!0)},p(c,d){d&8192&&l!==(l=c[13])&&p(e,"for",l),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&de(r,c[0].passwordConfirm)},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function E6(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"change",n[11]),Y(e,"change",Ze(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function D6(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new ge({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[T6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field "+((_=n[1].options)!=null&&_.requireEmail?"required":""),name:"email",$$slots:{default:[C6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let m=!n[2]&&Hp(n),g=(n[2]||n[3])&&Vp(n);return d=new ge({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[E6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),m&&m.c(),u=E(),g&&g.c(),f=E(),c=v("div"),z(d.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),m&&m.m(a,null),b(a,u),g&&g.m(a,null),b(e,f),b(e,c),H(d,c,null),h=!0},p(y,[S]){var M;const C={};S&4&&(C.class="form-field "+(y[2]?"":"required")),S&24581&&(C.$$scope={dirty:S,ctx:y}),i.$set(C);const T={};S&2&&(T.class="form-field "+((M=y[1].options)!=null&&M.requireEmail?"required":"")),S&24583&&(T.$$scope={dirty:S,ctx:y}),o.$set(T),y[2]?m&&(re(),L(m,1,1,()=>{m=null}),ae()):m?(m.p(y,S),S&4&&A(m,1)):(m=Hp(y),m.c(),A(m,1),m.m(a,u)),y[2]||y[3]?g?(g.p(y,S),S&12&&A(g,1)):(g=Vp(y),g.c(),A(g,1),g.m(a,null)):g&&(re(),L(g,1,1,()=>{g=null}),ae());const $={};S&24581&&($.$$scope={dirty:S,ctx:y}),d.$set($)},i(y){h||(A(i.$$.fragment,y),A(o.$$.fragment,y),A(m),A(g),A(d.$$.fragment,y),h=!0)},o(y){L(i.$$.fragment,y),L(o.$$.fragment,y),L(m),L(g),L(d.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),V(o),m&&m.d(),g&&g.d(),V(d)}}}function A6(n,e,t){let{record:i}=e,{collection:s}=e,{isNew:l=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function h(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function m(){i.verified=this.checked,t(0,i),t(3,r)}const g=_=>{l||_n("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!_.target.checked,i)})};return n.$$set=_=>{"record"in _&&t(0,i=_.record),"collection"in _&&t(1,s=_.collection),"isNew"in _&&t(2,l=_.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),pi("password"),pi("passwordConfirm")))},[i,s,l,r,o,a,u,f,c,d,h,m,g]}class I6 extends be{constructor(e){super(),_e(this,e,A6,D6,me,{record:0,collection:1,isNew:2})}}function L6(n){let e,t,i,s=[n[3]],l={};for(let o=0;o{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)&&!(h!=null&&h.isComposing)){h.preventDefault();const m=r.closest("form");m!=null&&m.requestSubmit&&m.requestSubmit()}}Kt(()=>(u(),()=>clearTimeout(a)));function c(h){te[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(3,s=tt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class N6 extends be{constructor(e){super(),_e(this,e,P6,L6,me,{value:0,maxHeight:4})}}function F6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(g){n[2](g)}let m={id:n[3],required:n[1].required};return n[0]!==void 0&&(m.value=n[0]),f=new N6({props:m}),te.push(()=>he(f,"value",h)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),z(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3])},m(g,_){w(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(g,u,_),H(f,g,_),d=!0},p(g,_){(!d||_&2&&i!==(i=j.getFieldTypeIcon(g[1].type)))&&p(t,"class",i),(!d||_&2)&&o!==(o=g[1].name+"")&&le(r,o),(!d||_&8&&a!==(a=g[3]))&&p(e,"for",a);const y={};_&8&&(y.id=g[3]),_&2&&(y.required=g[1].required),!c&&_&1&&(c=!0,y.value=g[0],ve(()=>c=!1)),f.$set(y)},i(g){d||(A(f.$$.fragment,g),d=!0)},o(g){L(f.$$.fragment,g),d=!1},d(g){g&&(k(e),k(u)),V(f,g)}}}function R6(n){let e,t;return e=new ge({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[F6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function q6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(o){s=o,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class j6 extends be{constructor(e){super(),_e(this,e,q6,R6,me,{field:1,value:0})}}function H6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m,g,_;return{c(){var y,S;e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",m=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),w(y,f,S),de(f,n[0]),g||(_=Y(f,"input",n[2]),g=!0)},p(y,S){var C,T;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&le(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&h!==(h=(C=y[1].options)==null?void 0:C.min)&&p(f,"min",h),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.max)&&p(f,"max",m),S&1&&yt(f.value)!==y[0]&&de(f,y[0])},d(y){y&&(k(e),k(u),k(f)),g=!1,_()}}}function V6(n){let e,t;return e=new ge({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[H6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function z6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=yt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class B6 extends be{constructor(e){super(),_e(this,e,z6,V6,me,{field:1,value:0})}}function U6(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=v("input"),i=E(),s=v("label"),o=W(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),b(s,o),a||(u=Y(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&le(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&(k(e),k(i),k(s)),a=!1,u()}}}function W6(n){let e,t;return e=new ge({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[U6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field form-field-toggle "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Y6(n,e,t){let{field:i}=e,{value:s=!1}=e;function l(){s=this.checked,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class K6 extends be{constructor(e){super(),_e(this,e,Y6,W6,me,{field:1,value:0})}}function J6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(g,_){w(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(g,u,_),w(g,f,_),de(f,n[0]),h||(m=Y(f,"input",n[2]),h=!0)},p(g,_){_&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&p(t,"class",i),_&2&&o!==(o=g[1].name+"")&&le(r,o),_&8&&a!==(a=g[3])&&p(e,"for",a),_&8&&c!==(c=g[3])&&p(f,"id",c),_&2&&d!==(d=g[1].required)&&(f.required=d),_&1&&f.value!==g[0]&&de(f,g[0])},d(g){g&&(k(e),k(u),k(f)),h=!1,m()}}}function G6(n){let e,t;return e=new ge({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[J6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Z6(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class X6 extends be{constructor(e){super(),_e(this,e,Z6,G6,me,{field:1,value:0})}}function Q6(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),f=v("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(g,_){w(g,e,_),b(e,t),b(e,s),b(e,l),b(l,r),w(g,u,_),w(g,f,_),de(f,n[0]),h||(m=Y(f,"input",n[2]),h=!0)},p(g,_){_&2&&i!==(i=j.getFieldTypeIcon(g[1].type))&&p(t,"class",i),_&2&&o!==(o=g[1].name+"")&&le(r,o),_&8&&a!==(a=g[3])&&p(e,"for",a),_&8&&c!==(c=g[3])&&p(f,"id",c),_&2&&d!==(d=g[1].required)&&(f.required=d),_&1&&f.value!==g[0]&&de(f,g[0])},d(g){g&&(k(e),k(u),k(f)),h=!1,m()}}}function x6(n){let e,t;return e=new ge({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Q6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&27&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function e5(n,e,t){let{field:i}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class t5 extends be{constructor(e){super(),_e(this,e,e5,x6,me,{field:1,value:0})}}function zp(n){let e,t,i,s;return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(l,o){w(l,e,o),b(e,t),i||(s=[Ce(Be.call(null,t,"Clear")),Y(t,"click",n[5])],i=!0)},p:x,d(l){l&&k(e),i=!1,$e(s)}}}function n5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m,g,_=n[0]&&!n[1].required&&zp(n);function y(T){n[6](T)}function S(T){n[7](T)}let C={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(C.value=n[2]),n[0]!==void 0&&(C.formattedValue=n[0]),d=new ou({props:C}),te.push(()=>he(d,"value",y)),te.push(()=>he(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),a=W(" (UTC)"),f=E(),_&&_.c(),c=E(),z(d.$$.fragment),p(t,"class",i=ii(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(l,"class","txt"),p(e,"for",u=n[8])},m(T,$){w(T,e,$),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),w(T,f,$),_&&_.m(T,$),w(T,c,$),H(d,T,$),g=!0},p(T,$){(!g||$&2&&i!==(i=ii(j.getFieldTypeIcon(T[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!g||$&2)&&o!==(o=T[1].name+"")&&le(r,o),(!g||$&256&&u!==(u=T[8]))&&p(e,"for",u),T[0]&&!T[1].required?_?_.p(T,$):(_=zp(T),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null);const M={};$&256&&(M.id=T[8]),!h&&$&4&&(h=!0,M.value=T[2],ve(()=>h=!1)),!m&&$&1&&(m=!0,M.formattedValue=T[0],ve(()=>m=!1)),d.$set(M)},i(T){g||(A(d.$$.fragment,T),g=!0)},o(T){L(d.$$.fragment,T),g=!1},d(T){T&&(k(e),k(f),k(c)),_&&_.d(T),V(d,T)}}}function i5(n){let e,t;return e=new ge({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[n5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&775&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function s5(n,e,t){let{field:i}=e,{value:s=void 0}=e,l=s;function o(c){c.detail&&c.detail.length==3&&t(0,s=c.detail[1])}function r(){t(0,s="")}const a=()=>r();function u(c){l=c,t(2,l),t(0,s)}function f(c){s=c,t(0,s)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,s=c.value)},n.$$.update=()=>{n.$$.dirty&1&&s&&s.length>19&&t(0,s=s.substring(0,19)),n.$$.dirty&5&&l!=s&&t(2,l=s)},[s,i,l,o,r,a,u,f]}class l5 extends be{constructor(e){super(),_e(this,e,s5,i5,me,{field:1,value:0})}}function Bp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=v("div"),t=W("Select up to "),s=W(i),l=W(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&le(s,i)},d(o){o&&k(e)}}}function o5(n){var S,C,T,$,M,O;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m;function g(D){n[3](D)}let _={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((C=n[1].options)==null?void 0:C.maxSelect),items:(T=n[1].options)==null?void 0:T.values,searchable:((M=($=n[1].options)==null?void 0:$.values)==null?void 0:M.length)>5};n[0]!==void 0&&(_.selected=n[0]),f=new z1({props:_}),te.push(()=>he(f,"selected",g));let y=((O=n[1].options)==null?void 0:O.maxSelect)>1&&Bp(n);return{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),z(f.$$.fragment),d=E(),y&&y.c(),h=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m(D,I){w(D,e,I),b(e,t),b(e,s),b(e,l),b(l,r),w(D,u,I),H(f,D,I),w(D,d,I),y&&y.m(D,I),w(D,h,I),m=!0},p(D,I){var P,F,R,q,B,Z;(!m||I&2&&i!==(i=j.getFieldTypeIcon(D[1].type)))&&p(t,"class",i),(!m||I&2)&&o!==(o=D[1].name+"")&&le(r,o),(!m||I&16&&a!==(a=D[4]))&&p(e,"for",a);const N={};I&16&&(N.id=D[4]),I&6&&(N.toggle=!D[1].required||D[2]),I&4&&(N.multiple=D[2]),I&7&&(N.closable=!D[2]||((P=D[0])==null?void 0:P.length)>=((F=D[1].options)==null?void 0:F.maxSelect)),I&2&&(N.items=(R=D[1].options)==null?void 0:R.values),I&2&&(N.searchable=((B=(q=D[1].options)==null?void 0:q.values)==null?void 0:B.length)>5),!c&&I&1&&(c=!0,N.selected=D[0],ve(()=>c=!1)),f.$set(N),((Z=D[1].options)==null?void 0:Z.maxSelect)>1?y?y.p(D,I):(y=Bp(D),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(D){m||(A(f.$$.fragment,D),m=!0)},o(D){L(f.$$.fragment,D),m=!1},d(D){D&&(k(e),k(u),k(d),k(h)),V(f,D),y&&y.d(D)}}}function r5(n){let e,t;return e=new ge({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[o5,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&55&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function a5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e;function o(r){l=r,t(0,l),t(2,i),t(1,s)}return n.$$set=r=>{"field"in r&&t(1,s=r.field),"value"in r&&t(0,l=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=s.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof l>"u"&&t(0,l=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(l.length-s.options.maxSelect))},[l,s,i,o]}class u5 extends be{constructor(e){super(),_e(this,e,a5,r5,me,{field:1,value:0})}}function f5(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function c5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function d5(n){let e;return{c(){e=v("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function p5(n){let e,t,i;var s=n[3];function l(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return s&&(e=Nt(s,l(n)),e.$on("change",n[5])),{c(){e&&z(e.$$.fragment),t=ye()},m(o,r){e&&H(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&s!==(s=o[3])){if(e){re();const a=e;L(a.$$.fragment,1,0,()=>{V(a,1)}),ae()}s?(e=Nt(s,l(o)),e.$on("change",o[5]),z(e.$$.fragment),A(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&A(e.$$.fragment,o),i=!0)},o(o){e&&L(e.$$.fragment,o),i=!1},d(o){o&&k(t),e&&V(e,o)}}}function h5(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,m,g,_,y,S;function C(I,N){return I[4]?c5:f5}let T=C(n),$=T(n);const M=[p5,d5],O=[];function D(I,N){return I[3]?0:1}return h=D(n),m=O[h]=M[h](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),a=E(),u=v("span"),$.c(),d=E(),m.c(),g=ye(),p(t,"class",i=ii(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(l,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(I,N){w(I,e,N),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),b(e,u),$.m(u,null),w(I,d,N),O[h].m(I,N),w(I,g,N),_=!0,y||(S=Ce(f=Be.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(I,N){(!_||N&2&&i!==(i=ii(j.getFieldTypeIcon(I[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!_||N&2)&&o!==(o=I[1].name+"")&&le(r,o),T!==(T=C(I))&&($.d(1),$=T(I),$&&($.c(),$.m(u,null))),f&&Et(f.update)&&N&16&&f.update.call(null,{position:"left",text:I[4]?"Valid JSON":"Invalid JSON"}),(!_||N&64&&c!==(c=I[6]))&&p(e,"for",c);let P=h;h=D(I),h===P?O[h].p(I,N):(re(),L(O[P],1,1,()=>{O[P]=null}),ae(),m=O[h],m?m.p(I,N):(m=O[h]=M[h](I),m.c()),A(m,1),m.m(g.parentNode,g))},i(I){_||(A(m),_=!0)},o(I){L(m),_=!1},d(I){I&&(k(e),k(d),k(g)),$.d(),O[h].d(I),y=!1,S()}}}function m5(n){let e,t;return e=new ge({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[h5,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&2&&(l.class="form-field "+(i[1].required?"required":"")),s&2&&(l.name=i[1].name),s&223&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Up(n){return JSON.stringify(typeof n>"u"?null:n,null,2)}function g5(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function _5(n,e,t){let i,{field:s}=e,{value:l=void 0}=e,o,r=Up(l);Kt(async()=>{try{t(3,o=(await ft(()=>import("./CodeEditor-c648ece6.js"),["./CodeEditor-c648ece6.js","./index-30dee195.js"],import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,l=r.trim())};return n.$$set=u=>{"field"in u&&t(1,s=u.field),"value"in u&&t(0,l=u.value)},n.$$.update=()=>{n.$$.dirty&5&&l!==(r==null?void 0:r.trim())&&(t(2,r=Up(l)),t(0,l=r)),n.$$.dirty&4&&t(4,i=g5(r))},[l,s,r,o,i,a]}class b5 extends be{constructor(e){super(),_e(this,e,_5,m5,me,{field:1,value:0})}}function v5(n){let e,t;return{c(){e=v("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function y5(n){let e,t,i;return{c(){e=v("img"),p(e,"draggable",!1),fn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!fn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function k5(n){let e;function t(l,o){return l[2]?y5:v5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function w5(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){j.hasImageExtension(s==null?void 0:s.name)?j.generateThumb(s,l,l).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,s=r.file),"size"in r&&t(1,l=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&o()},t(2,i=""),[s,l,i]}class S5 extends be{constructor(e){super(),_e(this,e,w5,k5,me,{file:0,size:1})}}function Wp(n){let e;function t(l,o){return l[4]==="image"?C5:T5}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function T5(n){let e,t;return{c(){e=v("object"),t=W("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&4&&p(e,"title",i[2]),s&2&&p(e,"data",i[1])},d(i){i&&k(e)}}}function C5(n){let e,t,i;return{c(){e=v("img"),fn(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&2&&!fn(e.src,t=s[1])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function $5(n){var s;let e=(s=n[3])==null?void 0:s.isActive(),t,i=e&&Wp(n);return{c(){i&&i.c(),t=ye()},m(l,o){i&&i.m(l,o),w(l,t,o)},p(l,o){var r;o&8&&(e=(r=l[3])==null?void 0:r.isActive()),e?i?i.p(l,o):(i=Wp(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&k(t),i&&i.d(l)}}}function M5(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[0])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function O5(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("a"),t=W(n[2]),i=E(),s=v("i"),l=E(),o=v("div"),r=E(),a=v("button"),a.textContent="Close",p(s,"class","ri-external-link-line"),p(e,"href",n[1]),p(e,"title",n[2]),p(e,"target","_blank"),p(e,"rel","noreferrer noopener"),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=Y(a,"click",n[0]),u=!0)},p(c,d){d&4&&le(t,c[2]),d&2&&p(e,"href",c[1]),d&4&&p(e,"title",c[2])},d(c){c&&(k(e),k(l),k(o),k(r),k(a)),u=!1,f()}}}function E5(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[O5],header:[M5],default:[$5]},$$scope:{ctx:n}};return e=new rn({props:i}),n[7](e),e.$on("show",n[8]),e.$on("hide",n[9]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.class="preview preview-"+s[4]),l&1054&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[7](null),V(e,s)}}}function D5(n,e,t){let i,s,l,o,r="";function a(h){h!==""&&(t(1,r=h),o==null||o.show())}function u(){return o==null?void 0:o.hide()}function f(h){te[h?"unshift":"push"](()=>{o=h,t(3,o)})}function c(h){Re.call(this,n,h)}function d(h){Re.call(this,n,h)}return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=r.indexOf("?")),n.$$.dirty&66&&t(2,s=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,l=j.getFileType(s))},[u,r,s,o,l,a,i,f,c,d]}class A5 extends be{constructor(e){super(),_e(this,e,D5,E5,me,{show:5,hide:0})}get show(){return this.$$.ctx[5]}get hide(){return this.$$.ctx[0]}}function I5(n){let e,t,i,s,l;function o(u,f){return u[3]==="image"?F5:u[3]==="video"||u[3]==="audio"?N5:P5}let r=o(n),a=r(n);return{c(){e=v("a"),a.c(),p(e,"draggable",!1),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:"")),p(e,"href",n[6]),p(e,"target","_blank"),p(e,"rel","noreferrer"),p(e,"title",i=(n[7]?"Preview":"Download")+" "+n[0])},m(u,f){w(u,e,f),a.m(e,null),s||(l=Y(e,"click",Sn(n[11])),s=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&2&&t!==(t="thumb "+(u[1]?`thumb-${u[1]}`:""))&&p(e,"class",t),f&64&&p(e,"href",u[6]),f&129&&i!==(i=(u[7]?"Preview":"Download")+" "+u[0])&&p(e,"title",i)},d(u){u&&k(e),a.d(),s=!1,l()}}}function L5(n){let e,t;return{c(){e=v("div"),p(e,"class",t="thumb "+(n[1]?`thumb-${n[1]}`:""))},m(i,s){w(i,e,s)},p(i,s){s&2&&t!==(t="thumb "+(i[1]?`thumb-${i[1]}`:""))&&p(e,"class",t)},d(i){i&&k(e)}}}function P5(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function N5(n){let e;return{c(){e=v("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function F5(n){let e,t,i,s,l;return{c(){e=v("img"),p(e,"draggable",!1),fn(e.src,t=n[5])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),p(e,"loading","lazy")},m(o,r){w(o,e,r),s||(l=Y(e,"error",n[8]),s=!0)},p(o,r){r&32&&!fn(e.src,t=o[5])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i)},d(o){o&&k(e),s=!1,l()}}}function Yp(n){let e,t,i={};return e=new A5({props:i}),n[12](e),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[12](null),V(e,s)}}}function R5(n){let e,t,i;function s(a,u){return a[2]?L5:I5}let l=s(n),o=l(n),r=n[7]&&Yp(n);return{c(){o.c(),e=E(),r&&r.c(),t=ye()},m(a,u){o.m(a,u),w(a,e,u),r&&r.m(a,u),w(a,t,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e))),a[7]?r?(r.p(a,u),u&128&&A(r,1)):(r=Yp(a),r.c(),A(r,1),r.m(t.parentNode,t)):r&&(re(),L(r,1,1,()=>{r=null}),ae())},i(a){i||(A(r),i=!0)},o(a){L(r),i=!1},d(a){a&&(k(e),k(t)),o.d(a),r&&r.d(a)}}}function q5(n,e,t){let i,s,{record:l=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c="",d=!0;h();async function h(){t(2,d=!0);try{t(10,c=await ce.getAdminFileToken(l.collectionId))}catch(y){console.warn("File token failure:",y)}t(2,d=!1)}function m(){t(5,u="")}const g=y=>{s&&(y.preventDefault(),a==null||a.show(f))};function _(y){te[y?"unshift":"push"](()=>{a=y,t(4,a)})}return n.$$set=y=>{"record"in y&&t(9,l=y.record),"filename"in y&&t(0,o=y.filename),"size"in y&&t(1,r=y.size)},n.$$.update=()=>{n.$$.dirty&1&&t(3,i=j.getFileType(o)),n.$$.dirty&9&&t(7,s=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&1541&&t(6,f=d?"":ce.files.getUrl(l,o,{token:c})),n.$$.dirty&1541&&t(5,u=d?"":ce.files.getUrl(l,o,{thumb:"100x100",token:c}))},[o,r,d,i,a,u,f,s,m,l,c,g,_]}class au extends be{constructor(e){super(),_e(this,e,q5,R5,me,{record:9,filename:0,size:1})}}function Kp(n,e,t){const i=n.slice();return i[29]=e[t],i[31]=t,i}function Jp(n,e,t){const i=n.slice();i[34]=e[t],i[31]=t;const s=i[2].includes(i[34]);return i[35]=s,i}function j5(n){let e,t,i;function s(){return n[17](n[34])}return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(l,o){w(l,e,o),t||(i=[Ce(Be.call(null,e,"Remove file")),Y(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,$e(i)}}}function H5(n){let e,t,i;function s(){return n[16](n[34])}return{c(){e=v("button"),e.innerHTML='Restore',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(l,o){w(l,e,o),t||(i=Y(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function V5(n){let e,t,i,s,l,o,r=n[34]+"",a,u,f,c,d,h;i=new au({props:{record:n[3],filename:n[34]}});function m(y,S){return y[35]?H5:j5}let g=m(n),_=g(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("a"),a=W(r),c=E(),d=v("div"),_.c(),Q(t,"fade",n[35]),p(o,"draggable",!1),p(o,"href",u=ce.files.getUrl(n[3],n[34],{token:n[10]})),p(o,"class",f="txt-ellipsis "+(n[35]?"txt-strikethrough txt-hint":"link-primary")),p(o,"title","Download"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(l,"class","content"),p(d,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(y,S){w(y,e,S),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(o,a),b(e,c),b(e,d),_.m(d,null),h=!0},p(y,S){const C={};S[0]&8&&(C.record=y[3]),S[0]&32&&(C.filename=y[34]),i.$set(C),(!h||S[0]&36)&&Q(t,"fade",y[35]),(!h||S[0]&32)&&r!==(r=y[34]+"")&&le(a,r),(!h||S[0]&1064&&u!==(u=ce.files.getUrl(y[3],y[34],{token:y[10]})))&&p(o,"href",u),(!h||S[0]&36&&f!==(f="txt-ellipsis "+(y[35]?"txt-strikethrough txt-hint":"link-primary")))&&p(o,"class",f),g===(g=m(y))&&_?_.p(y,S):(_.d(1),_=g(y),_&&(_.c(),_.m(d,null))),(!h||S[1]&2)&&Q(e,"dragging",y[32]),(!h||S[1]&4)&&Q(e,"dragover",y[33])},i(y){h||(A(i.$$.fragment,y),h=!0)},o(y){L(i.$$.fragment,y),h=!1},d(y){y&&k(e),V(i),_.d()}}}function Gp(n,e){let t,i,s,l;function o(a){e[18](a)}let r={group:e[4].name+"_uploaded",index:e[31],disabled:!e[6],$$slots:{default:[V5,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&1068|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.list=e[0],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function z5(n){let e,t,i,s,l,o,r,a,u=n[29].name+"",f,c,d,h,m,g,_;i=new S5({props:{file:n[29]}});function y(){return n[19](n[31])}return{c(){e=v("div"),t=v("figure"),z(i.$$.fragment),s=E(),l=v("div"),o=v("small"),o.textContent="New",r=E(),a=v("span"),f=W(u),d=E(),h=v("button"),h.innerHTML='',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename m-r-auto"),p(l,"title",c=n[29].name),p(h,"type","button"),p(h,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),Q(e,"dragging",n[32]),Q(e,"dragover",n[33])},m(S,C){w(S,e,C),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),b(l,r),b(l,a),b(a,f),b(e,d),b(e,h),m=!0,g||(_=[Ce(Be.call(null,h,"Remove file")),Y(h,"click",y)],g=!0)},p(S,C){n=S;const T={};C[0]&2&&(T.file=n[29]),i.$set(T),(!m||C[0]&2)&&u!==(u=n[29].name+"")&&le(f,u),(!m||C[0]&2&&c!==(c=n[29].name))&&p(l,"title",c),(!m||C[1]&2)&&Q(e,"dragging",n[32]),(!m||C[1]&4)&&Q(e,"dragover",n[33])},i(S){m||(A(i.$$.fragment,S),m=!0)},o(S){L(i.$$.fragment,S),m=!1},d(S){S&&k(e),V(i),g=!1,$e(_)}}}function Zp(n,e){let t,i,s,l;function o(a){e[20](a)}let r={group:e[4].name+"_new",index:e[31],disabled:!e[6],$$slots:{default:[z5,({dragging:a,dragover:u})=>({32:a,33:u}),({dragging:a,dragover:u})=>[0,(a?2:0)|(u?4:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[31]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&70&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&2&&(s=!0,f.list=e[1],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function B5(n){let e,t,i,s,l,o=n[4].name+"",r,a,u,f,c=[],d=new Map,h,m=[],g=new Map,_,y,S,C,T,$,M,O,D,I,N,P,F=pe(n[5]);const R=Z=>Z[34]+Z[3].id;for(let Z=0;ZZ[29].name+Z[31];for(let Z=0;Z({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(t,e,null),i=!0,s||(l=[Y(e,"dragover",Ze(n[25])),Y(e,"dragleave",n[26]),Y(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=` - form-field form-field-list form-field-file - `+(o[4].required?"required":"")+` - `+(o[9]?"dragover":"")+` - `),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),V(t),s=!1,$e(l)}}}function W5(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,h=!1,m="";function g(B){j.removeByValue(f,B),t(2,f)}function _(B){j.pushUnique(f,B),t(2,f)}function y(B){j.isEmpty(u[B])||u.splice(B,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function C(B){var X,J;B.preventDefault(),t(9,h=!1);const Z=((X=B.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Z.length)){for(const U of Z){const oe=s.length+u.length-f.length;if(((J=r.options)==null?void 0:J.maxSelect)<=oe)break;u.push(U)}t(1,u)}}Kt(async()=>{t(10,m=await ce.getAdminFileToken(o.collectionId))});const T=B=>g(B),$=B=>_(B);function M(B){a=B,t(0,a),t(6,i),t(4,r)}const O=B=>y(B);function D(B){u=B,t(1,u)}function I(B){te[B?"unshift":"push"](()=>{c=B,t(7,c)})}const N=()=>{for(let B of c.files)u.push(B);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function F(B){te[B?"unshift":"push"](()=>{d=B,t(8,d)})}const R=()=>{t(9,h=!0)},q=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"field"in B&&t(4,r=B.field),"value"in B&&t(0,a=B.value),"uploadedFiles"in B&&t(1,u=B.uploadedFiles),"deletedFileNames"in B&&t(2,f=B.deletedFileNames)},n.$$.update=()=>{var B,Z;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=j.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((B=r.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=j.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,h,m,l,g,_,y,C,T,$,M,O,D,I,N,P,F,R,q]}class Y5 extends be{constructor(e){super(),_e(this,e,W5,U5,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Xp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function K5(n,e){e=Xp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Xp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Qp(n,e,t){const i=n.slice();i[5]=e[t];const s=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=s,i}function xp(n,e,t){const i=n.slice();return i[9]=e[t],i}function eh(n){let e,t;return e=new au({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&5&&(l.filename=i[9]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function th(n){let e=!j.isEmpty(n[9]),t,i,s=e&&eh(n);return{c(){s&&s.c(),t=ye()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&5&&(e=!j.isEmpty(l[9])),e?s?(s.p(l,o),o&5&&A(s,1)):(s=eh(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(re(),L(s,1,1,()=>{s=null}),ae())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){l&&k(t),s&&s.d(l)}}}function nh(n){let e,t,i=pe(n[6]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;oL(h[g],1,1,()=>{h[g]=null});return{c(){e=v("div"),t=v("i"),s=E();for(let g=0;gt(4,o=a));let{record:r}=e;return n.$$set=a=>{"record"in a&&t(0,r=a.record)},n.$$.update=()=>{var a,u,f,c;n.$$.dirty&17&&t(3,i=o==null?void 0:o.find(d=>d.id==(r==null?void 0:r.collectionId))),n.$$.dirty&8&&t(2,s=((u=(a=i==null?void 0:i.schema)==null?void 0:a.filter(d=>d.presentable&&d.type=="file"))==null?void 0:u.map(d=>d.name))||[]),n.$$.dirty&8&&t(1,l=((c=(f=i==null?void 0:i.schema)==null?void 0:f.filter(d=>d.presentable&&d.type!="file"))==null?void 0:c.map(d=>d.name))||[])},[r,l,s,i,o]}class nr extends be{constructor(e){super(),_e(this,e,G5,J5,me,{record:0})}}function ih(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function sh(n,e,t){const i=n.slice();i[49]=e[t];const s=i[9](i[49]);return i[6]=s,i}function lh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='
    New record
    ',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function oh(n){let e,t=!n[13]&&rh(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[13]?t&&(t.d(1),t=null):t?t.p(i,s):(t=rh(i),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function rh(n){var l;let e,t,i,s=((l=n[2])==null?void 0:l.length)&&ah(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?s?s.p(o,r):(s=ah(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function ah(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[35]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Z5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function X5(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uh(n){let e,t,i,s;function l(){return n[32](n[49])}return{c(){e=v("div"),t=v("button"),t.innerHTML='',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),b(e,t),i||(s=[Ce(Be.call(null,t,"Edit")),Y(t,"keydown",Sn(n[27])),Y(t,"click",Sn(l))],i=!0)},p(o,r){n=o},d(o){o&&k(e),i=!1,$e(s)}}}function fh(n,e){let t,i,s,l,o,r,a,u;function f(_,y){return _[6]?X5:Z5}let c=f(e),d=c(e);l=new nr({props:{record:e[49]}});let h=!e[11]&&uh(e);function m(){return e[33](e[49])}function g(..._){return e[34](e[49],..._)}return{key:n,first:null,c(){t=v("div"),d.c(),i=E(),s=v("div"),z(l.$$.fragment),o=E(),h&&h.c(),p(s,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),Q(t,"selected",e[6]),Q(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(_,y){w(_,t,y),d.m(t,null),b(t,i),b(t,s),H(l,s,null),b(t,o),h&&h.m(t,null),r=!0,a||(u=[Y(t,"click",m),Y(t,"keydown",g)],a=!0)},p(_,y){e=_,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),l.$set(S),e[11]?h&&(h.d(1),h=null):h?h.p(e,y):(h=uh(e),h.c(),h.m(t,null)),(!r||y[0]&768)&&Q(t,"selected",e[6]),(!r||y[0]&1808)&&Q(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(_){r||(A(l.$$.fragment,_),r=!0)},o(_){L(l.$$.fragment,_),r=!1},d(_){_&&k(t),d.d(),V(l),h&&h.d(),a=!1,$e(u)}}}function ch(n){let e;return{c(){e=v("div"),e.innerHTML='
    ',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dh(n){let e,t=n[6].length+"",i,s,l,o;return{c(){e=W("("),i=W(t),s=W(" of MAX "),l=W(n[4]),o=W(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,s,a),w(r,l,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&le(i,t),a[0]&16&&le(l,r[4])},d(r){r&&(k(e),k(i),k(s),k(l),k(o))}}}function Q5(n){let e;return{c(){e=v("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function x5(n){let e,t,i=pe(n[6]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){e=v("div");for(let o=0;o',l=E(),p(s,"type","button"),p(s,"title","Remove"),p(s,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),Q(e,"label-danger",n[52]),Q(e,"label-warning",n[53])},m(f,c){w(f,e,c),H(t,e,null),b(e,i),b(e,s),w(f,l,c),o=!0,r||(a=Y(s,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&Q(e,"label-danger",n[52]),(!o||c[1]&4194304)&&Q(e,"label-warning",n[53])},i(f){o||(A(t.$$.fragment,f),o=!0)},o(f){L(t.$$.fragment,f),o=!1},d(f){f&&(k(e),k(l)),V(t),r=!1,a()}}}function ph(n){let e,t,i;function s(o){n[38](o)}let l={index:n[51],$$slots:{default:[eO,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(l.list=n[6]),e=new Fl({props:l}),te.push(()=>he(e,"list",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function tO(n){let e,t,i,s,l,o=[],r=new Map,a,u,f,c,d,h,m,g,_,y,S,C;t=new Dl({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let T=!n[11]&&lh(n),$=pe(n[8]);const M=R=>R[49].id;for(let R=0;R<$.length;R+=1){let q=sh(n,$,R),B=M(q);r.set(B,o[R]=fh(B,q))}let O=null;$.length||(O=oh(n));let D=n[13]&&ch(),I=n[4]>1&&dh(n);const N=[x5,Q5],P=[];function F(R,q){return R[6].length?0:1}return m=F(n),g=P[m]=N[m](n),{c(){e=v("div"),z(t.$$.fragment),i=E(),T&&T.c(),s=E(),l=v("div");for(let R=0;R1?I?I.p(R,q):(I=dh(R),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let Z=m;m=F(R),m===Z?P[m].p(R,q):(re(),L(P[Z],1,1,()=>{P[Z]=null}),ae(),g=P[m],g?g.p(R,q):(g=P[m]=N[m](R),g.c()),A(g,1),g.m(_.parentNode,_))},i(R){if(!y){A(t.$$.fragment,R);for(let q=0;q<$.length;q+=1)A(o[q]);A(g),y=!0}},o(R){L(t.$$.fragment,R);for(let q=0;qCancel',t=E(),i=v("button"),i.innerHTML='Set selection',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[28]),Y(i,"click",n[29])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function sO(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[iO],header:[nO],default:[tO]},$$scope:{ctx:n}};for(let a=0;at(26,h=Te));const m=pt(),g="picker_"+j.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",$=[],M=[],O=1,D=0,I=!1,N=!1;function P(){return t(2,T=""),t(8,$=[]),t(6,M=[]),R(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function R(){const Te=j.toArray(_);if(!s||!Te.length)return;t(24,N=!0);let ot=[];const At=Te.slice(),nn=[];for(;At.length>0;){const sn=[];for(const an of At.splice(0,lo))sn.push(`id="${an}"`);nn.push(ce.collection(s).getFullList({batch:lo,filter:sn.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(nn).then(sn=>{ot=ot.concat(...sn)}),t(6,M=[]);for(const sn of Te){const an=j.findByKey(ot,"id",sn);an&&M.push(an)}T.trim()||t(8,$=j.filterDuplicatesByKey(M.concat($))),t(24,N=!1)}catch(sn){sn.isAbort||(ce.error(sn),t(24,N=!1))}}async function q(Te=!1){if(s){t(3,I=!0),Te&&(T.trim()?t(8,$=[]):t(8,$=j.toArray(M).slice()));try{const ot=Te?1:O+1,At=j.getAllCollectionIdentifiers(l),nn=await ce.collection(s).getList(ot,lo,{filter:j.normalizeSearchFilter(T,At),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:g+"loadList"});t(8,$=j.filterDuplicatesByKey($.concat(nn.items))),O=nn.page,t(23,D=nn.items.length),t(3,I=!1)}catch(ot){ot.isAbort||(ce.error(ot),t(3,I=!1))}}}function B(Te){i==1?t(6,M=[Te]):u&&(j.pushOrReplaceByKey(M,Te),t(6,M))}function Z(Te){j.removeByKey(M,"id",Te.id),t(6,M)}function X(Te){f(Te)?Z(Te):B(Te)}function J(){var Te;i!=1?t(20,_=M.map(ot=>ot.id)):t(20,_=((Te=M==null?void 0:M[0])==null?void 0:Te.id)||""),m("save",M),F()}function U(Te){Re.call(this,n,Te)}const oe=()=>F(),ee=()=>J(),se=Te=>t(2,T=Te.detail),Ee=()=>C==null?void 0:C.show(),qe=Te=>C==null?void 0:C.show(Te),Ve=Te=>X(Te),We=(Te,ot)=>{(ot.code==="Enter"||ot.code==="Space")&&(ot.preventDefault(),ot.stopPropagation(),X(Te))},ke=()=>t(2,T=""),Me=()=>{a&&!I&&q()},Je=Te=>Z(Te);function dt(Te){M=Te,t(6,M)}function Se(Te){te[Te?"unshift":"push"](()=>{S=Te,t(1,S)})}function we(Te){Re.call(this,n,Te)}function Ue(Te){Re.call(this,n,Te)}function nt(Te){te[Te?"unshift":"push"](()=>{C=Te,t(7,C)})}const ne=Te=>{j.removeByKey($,"id",Te.detail.record.id),$.unshift(Te.detail.record),t(8,$),B(Te.detail.record)},Ne=Te=>{j.removeByKey($,"id",Te.detail.id),t(8,$),Z(Te.detail)};return n.$$set=Te=>{e=je(je({},e),xt(Te)),t(19,d=tt(e,c)),"value"in Te&&t(20,_=Te.value),"field"in Te&&t(21,y=Te.field)},n.$$.update=()=>{var Te,ot;n.$$.dirty[0]&2097152&&t(4,i=((Te=y==null?void 0:y.options)==null?void 0:Te.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,s=(ot=y==null?void 0:y.options)==null?void 0:ot.collectionId),n.$$.dirty[0]&100663296&&t(5,l=h.find(At=>At.id==s)||null),n.$$.dirty[0]&6&&typeof T<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(l==null?void 0:l.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=I||N),n.$$.dirty[0]&8388608&&t(12,a=D==lo),n.$$.dirty[0]&80&&t(10,u=i===null||i>M.length),n.$$.dirty[0]&64&&t(9,f=function(At){return j.findByKey(M,"id",At.id)})},[F,S,T,I,i,l,M,C,$,f,u,o,a,r,q,B,Z,X,J,d,_,y,P,D,N,s,h,U,oe,ee,se,Ee,qe,Ve,We,ke,Me,Je,dt,Se,we,Ue,nt,ne,Ne]}class oO extends be{constructor(e){super(),_e(this,e,lO,sO,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function hh(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function mh(n,e,t){const i=n.slice();return i[26]=e[t],i}function gh(n){let e,t,i,s;return{c(){e=v("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(l,o){w(l,e,o),i||(s=Ce(t=Be.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(l,o){t&&Et(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+l[6].join(", ")})},d(l){l&&k(e),i=!1,s()}}}function _h(n){let e,t=n[5]&&bh(n);return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[5]?t?t.p(i,s):(t=bh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&k(e),t&&t.d(i)}}}function bh(n){let e,t=pe(j.toArray(n[0]).slice(0,10)),i=[];for(let s=0;s ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function rO(n){let e,t,i,s,l,o,r,a,u,f;i=new nr({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='',r=E(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[24]),Q(e,"dragover",n[25])},m(d,h){w(d,e,h),b(e,t),H(i,t,null),b(e,s),b(e,l),b(l,o),w(d,r,h),a=!0,u||(f=[Ce(Be.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(d,h){n=d;const m={};h&16&&(m.record=n[21]),i.$set(m),(!a||h&16777216)&&Q(e,"dragging",n[24]),(!a||h&33554432)&&Q(e,"dragover",n[25])},i(d){a||(A(i.$$.fragment,d),a=!0)},o(d){L(i.$$.fragment,d),a=!1},d(d){d&&(k(e),k(r)),V(i),u=!1,$e(f)}}}function yh(n,e){let t,i,s,l;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[rO,({dragging:a,dragover:u})=>({24:a,25:u}),({dragging:a,dragover:u})=>(a?16777216:0)|(u?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Fl({props:r}),te.push(()=>he(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[23]),u&128&&(f.disabled=!e[7]),u&587202576&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function aO(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h=[],m=new Map,g,_,y,S,C,T,$=n[6].length&&gh(n),M=pe(n[4]);const O=I=>I[21].id;for(let I=0;I Open picker',p(t,"class",i=ii(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(_,"class","list-item list-item-btn"),p(c,"class","list")},m(I,N){w(I,e,N),b(e,t),b(e,s),b(e,l),b(l,r),b(e,a),$&&$.m(e,null),w(I,f,N),w(I,c,N),b(c,d);for(let P=0;P({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new ge({props:l}),n[15](e);let o={value:n[0],field:n[2]};return i=new oO({props:o}),n[16](i),i.$on("save",n[17]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&537919735&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){r&&k(t),n[15](null),V(e,r),n[16](null),V(i,r)}}}const kh=100;function fO(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const O=j.toArray(l);return t(4,a=a.filter(D=>O.includes(D.id))),O.length!=a.length}async function h(){var N,P;const O=j.toArray(l);if(t(4,a=[]),t(6,c=[]),!((N=s==null?void 0:s.options)!=null&&N.collectionId)||!O.length){t(5,u=!1);return}t(5,u=!0);const D=O.slice(),I=[];for(;D.length>0;){const F=[];for(const R of D.splice(0,kh))F.push(`id="${R}"`);I.push(ce.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(kh,{filter:F.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let F=[];await Promise.all(I).then(R=>{F=F.concat(...R)});for(const R of O){const q=j.findByKey(F,"id",R);q?a.push(q):c.push(R)}t(4,a),g()}catch(F){ce.error(F)}t(5,u=!1)}function m(O){j.removeByKey(a,"id",O.id),t(4,a),g()}function g(){var O;i?t(0,l=a.map(D=>D.id)):t(0,l=((O=a[0])==null?void 0:O.id)||"")}Cl(()=>{clearTimeout(f)});const _=O=>m(O);function y(O){a=O,t(4,a)}const S=()=>{g()},C=()=>o==null?void 0:o.show();function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function $(O){te[O?"unshift":"push"](()=>{o=O,t(1,o)})}const M=O=>{var D;t(4,a=O.detail||[]),t(0,l=i?a.map(I=>I.id):((D=a[0])==null?void 0:D.id)||"")};return n.$$set=O=>{"field"in O&&t(2,s=O.field),"value"in O&&t(0,l=O.value),"picker"in O&&t(1,o=O.picker)},n.$$.update=()=>{var O;n.$$.dirty&4&&t(7,i=((O=s.options)==null?void 0:O.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(h,0)))},[l,o,s,r,a,u,c,i,m,g,f,_,y,S,C,T,$,M]}class cO extends be{constructor(e){super(),_e(this,e,fO,uO,me,{field:2,value:0,picker:1})}}function dO(n){let e;return{c(){e=v("textarea"),p(e,"id",n[0]),zr(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[15](null)}}}function pO(n){let e;return{c(){e=v("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&k(e),n[14](null)}}}function hO(n){let e;function t(l,o){return l[1]?pO:dO}let i=t(n),s=i(n);return{c(){e=v("div"),s.c(),p(e,"class",n[2])},m(l,o){w(l,e,o),s.m(e,null),n[16](e)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null))),o&4&&p(e,"class",l[2])},i:x,o:x,d(l){l&&k(e),s.d(),n[16](null)}}}function mO(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,s,l){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=s,o.onload=()=>{l()},i.head&&i.head.appendChild(o)}function t(i,s,l){n.scriptLoaded?l():(n.listeners.push(l),n.injected||e(i,s,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let gO=mO();function qr(){return window&&window.tinymce?window.tinymce:null}function _O(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:s=void 0}=e,{disabled:l=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],h=(D,I)=>{d.forEach(N=>{D.on(N,P=>{I(N.toLowerCase(),{eventName:N,event:P,editor:D})})})};let m,g,_,y=u,S=l;const C=pt();function T(){const D={...r,target:g,inline:s!==void 0?s:r.inline!==void 0?r.inline:!1,readonly:l,setup:I=>{t(11,_=I),I.on("init",()=>{I.setContent(u),I.on(a,()=>{t(12,y=I.getContent()),y!==u&&(t(5,u=y),t(6,f=I.getContent({format:"text"})))})}),h(I,C),typeof r.setup=="function"&&r.setup(I)}};t(4,g.style.visibility="",g),qr().init(D)}Kt(()=>(qr()!==null?T():gO.load(m.ownerDocument,o,()=>{m&&T()}),()=>{var D;try{_&&((D=qr())==null||D.remove(_))}catch{}}));function $(D){te[D?"unshift":"push"](()=>{g=D,t(4,g)})}function M(D){te[D?"unshift":"push"](()=>{g=D,t(4,g)})}function O(D){te[D?"unshift":"push"](()=>{m=D,t(3,m)})}return n.$$set=D=>{"id"in D&&t(0,i=D.id),"inline"in D&&t(1,s=D.inline),"disabled"in D&&t(7,l=D.disabled),"scriptSrc"in D&&t(8,o=D.scriptSrc),"conf"in D&&t(9,r=D.conf),"modelEvents"in D&&t(10,a=D.modelEvents),"value"in D&&t(5,u=D.value),"text"in D&&t(6,f=D.text),"cssClass"in D&&t(2,c=D.cssClass)},n.$$.update=()=>{var D;if(n.$$.dirty&14496)try{_&&y!==u&&(_.setContent(u),t(6,f=_.getContent({format:"text"}))),_&&l!==S&&(t(13,S=l),typeof((D=_.mode)==null?void 0:D.set)=="function"?_.mode.set(l?"readonly":"design"):_.setMode(l?"readonly":"design"))}catch(I){console.warn("TinyMCE reactive error:",I)}},[i,s,c,m,g,u,f,l,o,r,a,_,y,S,$,M,O]}class uu extends be{constructor(e){super(),_e(this,e,_O,hO,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function wh(n,e,t){const i=n.slice();i[44]=e[t];const s=i[19](i[44]);return i[45]=s,i}function Sh(n,e,t){const i=n.slice();return i[48]=e[t],i}function Th(n,e,t){const i=n.slice();return i[51]=e[t],i}function bO(n){let e,t,i=[],s=new Map,l,o,r,a,u,f,c,d,h,m,g,_=pe(n[7]);const y=S=>S[51].id;for(let S=0;S<_.length;S+=1){let C=Th(n,_,S),T=y(C);s.set(T,i[S]=Ch(T,C))}return a=new Dl({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Go({props:{class:"files-list",vThreshold:100,$$slots:{default:[TO]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=v("div"),t=v("aside");for(let S=0;SNew record',c=E(),z(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,C){w(S,e,C),b(e,t);for(let T=0;Tfile field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Ch(n,e){let t,i=e[51].name+"",s,l,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=v("button"),s=W(i),l=E(),p(t,"type","button"),p(t,"class","sidebar-item"),Q(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),b(t,s),b(t,l),o||(r=Y(t,"click",Ze(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&le(s,i),f[0]&384&&Q(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&k(t),o=!1,r()}}}function yO(n){var l;let e,t,i,s=((l=n[4])==null?void 0:l.length)&&$h(n);return{c(){e=v("div"),t=v("span"),t.textContent="No records with images found.",i=E(),s&&s.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),b(e,t),b(e,i),s&&s.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?s?s.p(o,r):(s=$h(o),s.c(),s.m(e,null)):s&&(s.d(1),s=null)},d(o){o&&k(e),s&&s.d()}}}function kO(n){let e=[],t=new Map,i,s=pe(n[5]);const l=o=>o[44].id;for(let o=0;oClear filter',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",Ze(n[17])),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function wO(n){let e;return{c(){e=v("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function SO(n){let e,t,i;return{c(){e=v("img"),p(e,"loading","lazy"),fn(e.src,t=ce.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(s,l){w(s,e,l)},p(s,l){l[0]&32&&!fn(e.src,t=ce.files.getUrl(s[44],s[48],{thumb:"100x100"}))&&p(e,"src",t),l[0]&32&&i!==(i=s[48])&&p(e,"alt",i)},d(s){s&&k(e)}}}function Mh(n){let e,t,i,s,l,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(f[48])),t?SO:wO}let a=r(n,[-1,-1]),u=a(n);return{c(){e=v("button"),u.c(),i=E(),p(e,"type","button"),p(e,"class","thumb handle"),Q(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),b(e,i),l||(o=[Ce(s=Be.call(null,e,n[48]+` -(record: `+n[44].id+")")),Y(e,"click",Ze(function(){Et(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],l=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),s&&Et(s.update)&&c[0]&32&&s.update.call(null,n[48]+` -(record: `+n[44].id+")"),c[0]&589856&&Q(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&k(e),u.d(),l=!1,$e(o)}}}function Oh(n,e){let t,i,s=pe(e[45]),l=[];for(let o=0;o',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function TO(n){let e,t;function i(r,a){if(r[15])return kO;if(!r[6])return yO}let s=i(n),l=s&&s(n),o=n[6]&&Eh();return{c(){l&&l.c(),e=E(),o&&o.c(),t=ye()},m(r,a){l&&l.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){s===(s=i(r))&&l?l.p(r,a):(l&&l.d(1),l=s&&s(r),l&&(l.c(),l.m(e.parentNode,e))),r[6]?o||(o=Eh(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(k(e),k(t)),l&&l.d(r),o&&o.d(r)}}}function CO(n){let e,t,i,s;const l=[vO,bO],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function $O(n){let e,t;return{c(){e=v("h4"),t=W(n[0])},m(i,s){w(i,e,s),b(e,t)},p(i,s){s[0]&1&&le(t,i[0])},d(i){i&&k(e)}}}function Dh(n){let e,t;return e=new ge({props:{class:"form-field file-picker-size-select",$$slots:{default:[MO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&8402944|s[1]&8388608&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function MO(n){let e,t,i;function s(o){n[28](o)}let l={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(l.keyOfSelected=n[12]),e=new Ei({props:l}),te.push(()=>he(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function OO(n){var m;let e,t,i,s=j.hasImageExtension((m=n[9])==null?void 0:m.name),l,o,r,a,u,f,c,d,h=s&&Dh(n);return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),h&&h.c(),l=E(),o=v("button"),r=v("span"),a=W(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(g,_){w(g,e,_),b(e,t),w(g,i,_),h&&h.m(g,_),w(g,l,_),w(g,o,_),b(o,r),b(r,a),f=!0,c||(d=[Y(e,"click",n[2]),Y(o,"click",n[21])],c=!0)},p(g,_){var y;(!f||_[0]&64)&&(e.disabled=g[6]),_[0]&512&&(s=j.hasImageExtension((y=g[9])==null?void 0:y.name)),s?h?(h.p(g,_),_[0]&512&&A(h,1)):(h=Dh(g),h.c(),A(h,1),h.m(l.parentNode,l)):h&&(re(),L(h,1,1,()=>{h=null}),ae()),(!f||_[0]&2)&&le(a,g[1]),(!f||_[0]&8192&&u!==(u=!g[13]))&&(o.disabled=u)},i(g){f||(A(h),f=!0)},o(g){L(h),f=!1},d(g){g&&(k(e),k(i),k(l),k(o)),h&&h.d(g),c=!1,$e(d)}}}function EO(n){let e,t,i,s;const l=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[OO],header:[$O],default:[CO]},$$scope:{ctx:n}};for(let a=0;at(27,u=we));const f=pt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:h="Insert"}=e,{fileTypes:m=["image","document","video","audio","file"]}=e,g,_,y="",S=[],C=1,T=0,$=!1,M=[],O=[],D=[],I={},N={},P="";function F(){return Z(!0),g==null?void 0:g.show()}function R(){return g==null?void 0:g.hide()}function q(){t(5,S=[]),t(9,N={}),t(12,P="")}function B(){t(4,y="")}async function Z(we=!1){if(I!=null&&I.id){t(6,$=!0),we&&q();try{const Ue=we?1:C+1,nt=j.getAllCollectionIdentifiers(I);let ne=j.normalizeSearchFilter(y,nt)||"";ne&&(ne+=" && "),ne+="("+O.map(Te=>`${Te.name}:length>0`).join("||")+")";const Ne=await ce.collection(I.id).getList(Ue,Ah,{filter:ne,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(Ne.items))),C=Ne.page,t(26,T=Ne.items.length),t(6,$=!1)}catch(Ue){Ue.isAbort||(ce.error(Ue),t(6,$=!1))}}}function X(){var Ue,nt;let we=["100x100"];if((Ue=N==null?void 0:N.record)!=null&&Ue.id){for(const ne of O)if(j.toArray(N.record[ne.name]).includes(N.name)){we=we.concat(j.toArray((nt=ne.options)==null?void 0:nt.thumbs));break}}t(11,D=[{label:"Original size",value:""}]);for(const ne of we)D.push({label:`${ne} thumb`,value:ne});P&&!we.includes(P)&&t(12,P="")}function J(we){let Ue=[];for(const nt of O){const ne=j.toArray(we[nt.name]);for(const Ne of ne)m.includes(j.getFileType(Ne))&&Ue.push(Ne)}return Ue}function U(we,Ue){t(9,N={record:we,name:Ue})}function oe(){o&&(f("submit",Object.assign({size:P},N)),R())}function ee(we){P=we,t(12,P)}const se=we=>{t(8,I=we)},Ee=we=>t(4,y=we.detail),qe=()=>_==null?void 0:_.show(),Ve=()=>{l&&Z()};function We(we){te[we?"unshift":"push"](()=>{g=we,t(3,g)})}function ke(we){Re.call(this,n,we)}function Me(we){Re.call(this,n,we)}function Je(we){te[we?"unshift":"push"](()=>{_=we,t(10,_)})}const dt=we=>{j.removeByKey(S,"id",we.detail.record.id),S.unshift(we.detail.record),t(5,S);const Ue=J(we.detail.record);Ue.length>0&&U(we.detail.record,Ue[0])},Se=we=>{var Ue;((Ue=N==null?void 0:N.record)==null?void 0:Ue.id)==we.detail.id&&t(9,N={}),j.removeByKey(S,"id",we.detail.id),t(5,S)};return n.$$set=we=>{e=je(je({},e),xt(we)),t(22,a=tt(e,r)),"title"in we&&t(0,d=we.title),"submitText"in we&&t(1,h=we.submitText),"fileTypes"in we&&t(24,m=we.fileTypes)},n.$$.update=()=>{var we;n.$$.dirty[0]&134217728&&t(7,M=u.filter(Ue=>Ue.type!=="view"&&!!j.toArray(Ue.schema).find(nt=>{var ne,Ne,Te,ot,At;return nt.type==="file"&&!((ne=nt.options)!=null&&ne.protected)&&(!((Te=(Ne=nt.options)==null?void 0:Ne.mimeTypes)!=null&&Te.length)||!!((At=(ot=nt.options)==null?void 0:ot.mimeTypes)!=null&&At.find(nn=>nn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(I!=null&&I.id)&&M.length>0&&t(8,I=M[0]),n.$$.dirty[0]&256&&(O=(we=I==null?void 0:I.schema)==null?void 0:we.filter(Ue=>{var nt;return Ue.type==="file"&&!((nt=Ue.options)!=null&&nt.protected)})),n.$$.dirty[0]&256&&I!=null&&I.id&&(B(),X()),n.$$.dirty[0]&512&&N!=null&&N.name&&X(),n.$$.dirty[0]&280&&typeof y<"u"&&I!=null&&I.id&&g!=null&&g.isActive()&&Z(!0),n.$$.dirty[0]&512&&t(16,i=(Ue,nt)=>{var ne;return(N==null?void 0:N.name)==nt&&((ne=N==null?void 0:N.record)==null?void 0:ne.id)==Ue.id}),n.$$.dirty[0]&32&&t(15,s=S.find(Ue=>J(Ue).length>0)),n.$$.dirty[0]&67108928&&t(14,l=!$&&T==Ah),n.$$.dirty[0]&576&&t(13,o=!$&&!!(N!=null&&N.name))},[d,h,R,g,y,S,$,M,I,N,_,D,P,o,l,s,i,B,Z,J,U,oe,a,c,m,F,T,u,ee,se,Ee,qe,Ve,We,ke,Me,Je,dt,Se]}class AO extends be{constructor(e){super(),_e(this,e,DO,EO,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function IO(n){let e;return{c(){e=v("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function LO(n){let e,t,i;function s(o){n[6](o)}let l={id:n[11],conf:n[5]};return n[0]!==void 0&&(l.value=n[0]),e=new uu({props:l}),te.push(()=>he(e,"value",s)),e.$on("init",n[7]),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function PO(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;const m=[LO,IO],g=[];function _(y,S){return y[4]?0:1}return f=_(n),c=g[f]=m[f](n),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=W(o),u=E(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),b(e,t),b(e,s),b(e,l),b(l,r),w(y,u,S),g[f].m(y,S),w(y,d,S),h=!0},p(y,S){(!h||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!h||S&2)&&o!==(o=y[1].name+"")&&le(r,o),(!h||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let C=f;f=_(y),f===C?g[f].p(y,S):(re(),L(g[C],1,1,()=>{g[C]=null}),ae(),c=g[f],c?c.p(y,S):(c=g[f]=m[f](y),c.c()),A(c,1),c.m(d.parentNode,d))},i(y){h||(A(c),h=!0)},o(y){L(c),h=!1},d(y){y&&(k(e),k(u),k(d)),g[f].d(y)}}}function NO(n){let e,t,i,s;e=new ge({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[PO,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let l={title:"Select an image",fileTypes:["image"]};return i=new AO({props:l}),n[8](i),i.$on("submit",n[9]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),s=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){L(e.$$.fragment,o),L(i.$$.fragment,o),s=!1},d(o){o&&k(t),V(e,o),n[8](null),V(i,o)}}}function FO(n,e,t){let i,{field:s}=e,{value:l=""}=e,o,r,a=!1,u=null;Kt(async()=>(typeof l>"u"&&t(0,l=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(m){l=m,t(0,l)}const c=m=>{t(3,r=m.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(m){te[m?"unshift":"push"](()=>{o=m,t(2,o)})}const h=m=>{r==null||r.execCommand("InsertImage",!1,ce.files.getUrl(m.detail.record,m.detail.name,{thumb:m.detail.size}))};return n.$$set=m=>{"field"in m&&t(1,s=m.field),"value"in m&&t(0,l=m.value)},n.$$.update=()=>{var m;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(m=s.options)==null?void 0:m.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof l>"u"&&t(0,l="")},[l,s,o,r,a,i,f,c,d,h]}class RO extends be{constructor(e){super(),_e(this,e,FO,NO,me,{field:1,value:0})}}function qO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Auth URL"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].authUrl),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].authUrl&&de(l,u[0].authUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function jO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Token URL"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].tokenUrl),r||(a=Y(l,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].tokenUrl&&de(l,u[0].tokenUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function HO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("User API URL"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","url"),p(l,"id",o=n[8]),l.required=n[3]},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].userApiUrl),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&8&&(l.required=u[3]),f&1&&l.value!==u[0].userApiUrl&&de(l,u[0].userApiUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function VO(n){let e,t,i,s,l,o,r,a,u;return s=new ge({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[qO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[jO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new ge({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[HO,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=W(n[2]),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),b(e,t),w(f,i,c),H(s,f,c),w(f,l,c),H(o,f,c),w(f,r,c),H(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&le(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".tokenUrl"),c&777&&(h.$$scope={dirty:c,ctx:f}),o.$set(h);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".userApiUrl"),c&777&&(m.$$scope={dirty:c,ctx:f}),a.$set(m)},i(f){u||(A(s.$$.fragment,f),A(o.$$.fragment,f),A(a.$$.fragment,f),u=!0)},o(f){L(s.$$.fragment,f),L(o.$$.fragment,f),L(a.$$.fragment,f),u=!1},d(f){f&&(k(e),k(i),k(l),k(r)),V(s,f),V(o,f),V(a,f)}}}function zO(n,e,t){let i,{key:s=""}=e,{config:l={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){l.authUrl=this.value,t(0,l)}function u(){l.tokenUrl=this.value,t(0,l)}function f(){l.userApiUrl=this.value,t(0,l)}return n.$$set=c=>{"key"in c&&t(1,s=c.key),"config"in c&&t(0,l=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(l==null?void 0:l.enabled))},[l,s,r,i,o,a,u,f]}class vs extends be{constructor(e){super(),_e(this,e,zO,VO,me,{key:1,config:0,required:4,title:2})}}function BO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=W("Auth URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[0].authUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[2]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].authUrl&&de(l,d[0].authUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function UO(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=W("Token URL"),s=E(),l=v("input"),a=E(),u=v("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(l,"type","url"),p(l,"id",o=n[4]),l.required=r=n[0].enabled,p(u,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[0].tokenUrl),w(d,a,h),w(d,u,h),f||(c=Y(l,"input",n[3]),f=!0)},p(d,h){h&16&&i!==(i=d[4])&&p(e,"for",i),h&16&&o!==(o=d[4])&&p(l,"id",o),h&1&&r!==(r=d[0].enabled)&&(l.required=r),h&1&&l.value!==d[0].tokenUrl&&de(l,d[0].tokenUrl)},d(d){d&&(k(e),k(s),k(l),k(a),k(u)),f=!1,c()}}}function WO(n){let e,t,i,s,l,o;return i=new ge({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[BO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),l=new ge({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[UO,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.textContent="Azure AD endpoints",t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(e),k(t),k(s)),V(i,r),V(l,r)}}}function YO(n,e,t){let{key:i=""}=e,{config:s={}}=e;function l(){s.authUrl=this.value,t(0,s)}function o(){s.tokenUrl=this.value,t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,s=r.config)},[s,i,l,o]}class KO extends be{constructor(e){super(),_e(this,e,YO,WO,me,{key:1,config:0})}}function JO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[2]),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&4&&l.value!==u[2]&&de(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function GO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Team ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[3]),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&8&&l.value!==u[3]&&de(l,u[3])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function ZO(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Key ID"),s=E(),l=v("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[4]),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&16&&l.value!==u[4]&&de(l,u[4])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function XO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="Duration (in seconds)",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",ho),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[6]),u||(f=[Ce(Be.call(null,s,{text:`Max ${ho} seconds (~${ho/(60*60*24*30)<<0} months).`,position:"top"})),Y(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&l!==(l=c[23])&&p(e,"for",l),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&de(r,c[6])},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function QO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Private key"),s=E(),l=v("textarea"),r=E(),a=v("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(l,"id",o=n[23]),l.required=!0,p(l,"rows","8"),p(l,"placeholder",`-----BEGIN PRIVATE KEY----- -... ------END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&de(l,c[5])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function xO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S;return s=new ge({props:{class:"form-field required",name:"clientId",$$slots:{default:[JO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field required",name:"teamId",$$slots:{default:[GO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new ge({props:{class:"form-field required",name:"keyId",$$slots:{default:[ZO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new ge({props:{class:"form-field required",name:"duration",$$slots:{default:[XO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),g=new ge({props:{class:"form-field required",name:"privateKey",$$slots:{default:[QO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),m=E(),z(g.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(C,T){w(C,e,T),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(t,m),H(g,t,null),_=!0,y||(S=Y(e,"submit",Ze(n[17])),y=!0)},p(C,T){const $={};T&25165828&&($.$$scope={dirty:T,ctx:C}),s.$set($);const M={};T&25165832&&(M.$$scope={dirty:T,ctx:C}),r.$set(M);const O={};T&25165840&&(O.$$scope={dirty:T,ctx:C}),f.$set(O);const D={};T&25165888&&(D.$$scope={dirty:T,ctx:C}),h.$set(D);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:C}),g.$set(I)},i(C){_||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(h.$$.fragment,C),A(g.$$.fragment,C),_=!0)},o(C){L(s.$$.fragment,C),L(r.$$.fragment,C),L(f.$$.fragment,C),L(h.$$.fragment,C),L(g.$$.fragment,C),_=!1},d(C){C&&k(e),V(s),V(r),V(f),V(h),V(g),y=!1,S()}}}function eE(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function tE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=W("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function nE(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[tE],header:[eE],default:[xO]},$$scope:{ctx:n}};return e=new rn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),V(e,s)}}}const ho=15777e3;function iE(n,e,t){let i;const s=pt(),l="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function h(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,c=N.duration||ho),on({}),o==null||o.show()}function m(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const N=await ce.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),zt("Successfully generated client secret."),s("submit",N),o==null||o.hide()}catch(N){ce.error(N)}t(7,d=!1)}function _(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function C(){c=this.value,t(6,c)}function T(){f=this.value,t(5,f)}const $=()=>g(),M=()=>!d;function O(N){te[N?"unshift":"push"](()=>{o=N,t(1,o)})}function D(N){Re.call(this,n,N)}function I(N){Re.call(this,n,N)}return t(8,i=!0),[m,o,r,a,u,f,c,d,i,l,g,h,_,y,S,C,T,$,M,O,D,I]}class sE extends be{constructor(e){super(),_e(this,e,iE,nE,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function lE(n){let e,t,i,s,l,o,r,a,u,f,c={};return r=new sE({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=v("button"),t=v("i"),i=E(),s=v("span"),s.textContent="Generate secret",o=E(),z(r.$$.fragment),p(t,"class","ri-key-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",l="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,h){w(d,e,h),b(e,t),b(e,i),b(e,s),w(d,o,h),H(r,d,h),a=!0,u||(f=Y(e,"click",n[3]),u=!0)},p(d,[h]){(!a||h&2&&l!==(l="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",l);const m={};r.$set(m)},i(d){a||(A(r.$$.fragment,d),a=!0)},o(d){L(r.$$.fragment,d),a=!1},d(d){d&&(k(e),k(o)),n[4](null),V(r,d),u=!1,f()}}}function oE(n,e,t){let{key:i=""}=e,{config:s={}}=e,l;const o=()=>l==null?void 0:l.show({clientId:s.clientId});function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{var f;t(0,s.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",s)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class rE extends be{constructor(e){super(),_e(this,e,oE,lE,me,{key:1,config:0})}}const mo=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:rE},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:KO},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:vs,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:vs,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:vs,optionsComponentProps:{required:!0}},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:vs,optionsComponentProps:{required:!0}},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:vs,optionsComponentProps:{required:!0}},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:vs,optionsComponentProps:{required:!0}}];function Ih(n,e,t){const i=n.slice();return i[9]=e[t],i}function aE(n){let e;return{c(){e=v("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function uE(n){let e,t=pe(n[1]),i=[];for(let s=0;s',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Lh(n){let e,t,i,s,l,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",h,m,g,_,y,S;function C(){return n[6](n[9])}return{c(){var T;e=v("div"),t=v("figure"),i=v("img"),l=E(),o=v("span"),a=W(r),u=E(),f=v("div"),c=W("ID: "),h=W(d),m=E(),g=v("button"),g.innerHTML='',_=E(),fn(i.src,s="./images/oauth2/"+((T=n[3](n[9].provider))==null?void 0:T.logo))||p(i,"src",s),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(g,"type","button"),p(g,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(e,l),b(e,o),b(o,a),b(e,u),b(e,f),b(f,c),b(f,h),b(e,m),b(e,g),b(e,_),y||(S=Y(g,"click",C),y=!0)},p(T,$){var M;n=T,$&2&&!fn(i.src,s="./images/oauth2/"+((M=n[3](n[9].provider))==null?void 0:M.logo))&&p(i,"src",s),$&2&&r!==(r=n[4](n[9].provider)+"")&&le(a,r),$&2&&d!==(d=n[9].providerId+"")&&le(h,d)},d(T){T&&k(e),y=!1,S()}}}function cE(n){let e;function t(l,o){var r;return l[2]?fE:(r=l[0])!=null&&r.id&&l[1].length?uE:aE}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function dE(n,e,t){const i=pt();let{record:s}=e,l=[],o=!1;function r(d){return mo.find(h=>h.key==d+"Auth")||{}}function a(d){var h;return((h=r(d))==null?void 0:h.title)||j.sentenize(d,!1)}async function u(){if(!(s!=null&&s.id)){t(1,l=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,l=await ce.collection(s.collectionId).listExternalAuths(s.id))}catch(d){ce.error(d)}t(2,o=!1)}function f(d){!(s!=null&&s.id)||!d||_n(`Do you really want to unlink the ${a(d)} provider?`,()=>ce.collection(s.collectionId).unlinkExternalAuth(s.id,d).then(()=>{zt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(h=>{ce.error(h)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,s=d.record)},[s,l,o,r,a,f,c]}class pE extends be{constructor(e){super(),_e(this,e,dE,cE,me,{record:0})}}function Ph(n,e,t){const i=n.slice();return i[69]=e[t],i[70]=e,i[71]=t,i}function Nh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=W(`The record has previous unsaved changes. - `),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),h=!0,m||(g=[Y(r,"click",n[38]),Ce(Be.call(null,u,"Discard draft")),Y(u,"click",Ze(n[39]))],m=!0)},p:x,i(_){h||(d&&d.end(1),h=!0)},o(_){_&&(d=ka(e,lt,{duration:150})),h=!1},d(_){_&&k(e),_&&d&&d.end(),m=!1,$e(g)}}}function Fh(n){let e,t,i;return t=new U1({props:{model:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.model=s[3]),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function hE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y=!n[6]&&Fh(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),y&&y.c(),u=E(),f=v("input"),p(t,"class",ii(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[72]),p(f,"type","text"),p(f,"id",c=n[72]),p(f,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=h=!n[6]},m(S,C){w(S,e,C),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(S,a,C),y&&y.m(S,C),w(S,u,C),w(S,f,C),de(f,n[3].id),m=!0,g||(_=Y(f,"input",n[40]),g=!0)},p(S,C){(!m||C[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?y&&(re(),L(y,1,1,()=>{y=null}),ae()):y?(y.p(S,C),C[0]&64&&A(y,1)):(y=Fh(S),y.c(),A(y,1),y.m(u.parentNode,u)),(!m||C[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!m||C[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!m||C[0]&64&&h!==(h=!S[6]))&&(f.readOnly=h),C[0]&8&&f.value!==S[3].id&&de(f,S[3].id)},i(S){m||(A(y),m=!0)},o(S){L(y),m=!1},d(S){S&&(k(e),k(a),k(u),k(f)),y&&y.d(S),g=!1,_()}}}function Rh(n){var u,f;let e,t,i,s,l;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new I6({props:r}),te.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&qh();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=ye()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var m,g;const h={};d[0]&64&&(h.isNew=c[6]),d[0]&1&&(h.collection=c[0]),!t&&d[0]&8&&(t=!0,h.record=c[3],ve(()=>t=!1)),e.$set(h),(g=(m=c[0])==null?void 0:m.schema)!=null&&g.length?a||(a=qh(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){c&&(k(i),k(s)),V(e,c),a&&a.d(c)}}}function qh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function mE(n){let e,t,i;function s(o){n[54](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new cO({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function gE(n){let e,t,i,s,l;function o(f){n[51](f,n[69])}function r(f){n[52](f,n[69])}function a(f){n[53](f,n[69])}let u={field:n[69],record:n[3]};return n[3][n[69].name]!==void 0&&(u.value=n[3][n[69].name]),n[4][n[69].name]!==void 0&&(u.uploadedFiles=n[4][n[69].name]),n[5][n[69].name]!==void 0&&(u.deletedFileNames=n[5][n[69].name]),e=new Y5({props:u}),te.push(()=>he(e,"value",o)),te.push(()=>he(e,"uploadedFiles",r)),te.push(()=>he(e,"deletedFileNames",a)),{c(){z(e.$$.fragment)},m(f,c){H(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[69]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[69].name],ve(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ve(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[69].name],ve(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function _E(n){let e,t,i;function s(o){n[50](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new b5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function bE(n){let e,t,i;function s(o){n[49](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new u5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function vE(n){let e,t,i;function s(o){n[48](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new l5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function yE(n){let e,t,i;function s(o){n[47](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new RO({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function kE(n){let e,t,i;function s(o){n[46](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new t5({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function wE(n){let e,t,i;function s(o){n[45](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new X6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function SE(n){let e,t,i;function s(o){n[44](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new K6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function TE(n){let e,t,i;function s(o){n[43](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new B6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CE(n){let e,t,i;function s(o){n[42](o,n[69])}let l={field:n[69]};return n[3][n[69].name]!==void 0&&(l.value=n[3][n[69].name]),e=new j6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function jh(n,e){let t,i,s,l,o;const r=[CE,TE,SE,wE,kE,yE,vE,bE,_E,gE,mE],a=[];function u(f,c){return f[69].type==="text"?0:f[69].type==="number"?1:f[69].type==="bool"?2:f[69].type==="email"?3:f[69].type==="url"?4:f[69].type==="editor"?5:f[69].type==="date"?6:f[69].type==="select"?7:f[69].type==="json"?8:f[69].type==="file"?9:f[69].type==="relation"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),s&&s.c(),l=ye(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(re(),L(a[d],1,1,()=>{a[d]=null}),ae()),~i?(s=a[i],s?s.p(e,c):(s=a[i]=r[i](e),s.c()),A(s,1),s.m(l.parentNode,l)):s=null)},i(f){o||(A(s),o=!0)},o(f){L(s),o=!1},d(f){f&&(k(t),k(l)),~i&&a[i].d(f)}}}function Hh(n){let e,t,i;return t=new pE({props:{record:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[13]===wl)},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.record=s[3]),t.$set(o),(!i||l[0]&8192)&&Q(e,"active",s[13]===wl)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function $E(n){var S;let e,t,i,s,l,o,r=[],a=new Map,u,f,c,d,h=!n[8]&&n[10]&&!n[7]&&Nh(n);s=new ge({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[hE,({uniqueId:C})=>({72:C}),({uniqueId:C})=>[0,0,C?1024:0]]},$$scope:{ctx:n}}});let m=n[14]&&Rh(n),g=pe(((S=n[0])==null?void 0:S.schema)||[]);const _=C=>C[69].name;for(let C=0;C{h=null}),ae());const $={};T[0]&64&&($.class="form-field "+(C[6]?"":"readonly")),T[0]&200|T[2]&3072&&($.$$scope={dirty:T,ctx:C}),s.$set($),C[14]?m?(m.p(C,T),T[0]&16384&&A(m,1)):(m=Rh(C),m.c(),A(m,1),m.m(t,o)):m&&(re(),L(m,1,1,()=>{m=null}),ae()),T[0]&57&&(g=pe(((M=C[0])==null?void 0:M.schema)||[]),re(),r=gt(r,T,_,1,C,g,a,t,qt,jh,null,Ph),ae()),(!f||T[0]&128)&&Q(t,"no-pointer-events",C[7]),(!f||T[0]&8192)&&Q(t,"active",C[13]===rs),C[14]&&!C[6]?y?(y.p(C,T),T[0]&16448&&A(y,1)):(y=Hh(C),y.c(),A(y,1),y.m(e,null)):y&&(re(),L(y,1,1,()=>{y=null}),ae())},i(C){if(!f){A(h),A(s.$$.fragment,C),A(m);for(let T=0;T{d=null}),ae()):d?(d.p(m,g),g[0]&64&&A(d,1)):(d=Vh(m),d.c(),A(d,1),d.m(f.parentNode,f))},i(m){c||(A(d),c=!0)},o(m){L(d),c=!1},d(m){m&&(k(e),k(u),k(f)),d&&d.d(m)}}}function OE(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,i:x,o:x,d(s){s&&(k(e),k(t),k(i))}}}function Vh(n){let e,t,i,s,l,o,r;return o=new Pn({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[EE]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),i=v("button"),s=v("i"),l=E(),z(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"aria-label","More"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),b(i,s),b(i,l),H(o,i,null),r=!0},p(a,u){const f={};u[0]&16388|u[2]&2048&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){L(o.$$.fragment,a),r=!1},d(a){a&&(k(e),k(t),k(i)),V(o)}}}function zh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send verification email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Bh(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send password reset email',p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[33]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function EE(n){let e,t,i,s,l,o,r,a=n[14]&&!n[2].verified&&n[2].email&&zh(n),u=n[14]&&n[2].email&&Bh(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=' Duplicate',s=E(),l=v("button"),l.innerHTML=' Delete',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[Y(i,"click",n[34]),Y(l,"click",Sn(Ze(n[35])))],o=!0)},p(f,c){f[14]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=zh(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[14]&&f[2].email?u?u.p(f,c):(u=Bh(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(k(e),k(t),k(i),k(s),k(l)),a&&a.d(f),u&&u.d(f),o=!1,$e(r)}}}function Uh(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[13]===rs),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[13]===wl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[Y(t,"click",n[36]),Y(s,"click",n[37])],l=!0)},p(r,a){a[0]&8192&&Q(t,"active",r[13]===rs),a[0]&8192&&Q(s,"active",r[13]===wl)},d(r){r&&k(e),l=!1,$e(o)}}}function DE(n){let e,t,i,s,l;const o=[OE,ME],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[14]&&!n[6]&&Uh(n);return{c(){t.c(),i=E(),u&&u.c(),s=ye()},m(f,c){r[e].m(f,c),w(f,i,c),u&&u.m(f,c),w(f,s,c),l=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(re(),L(r[d],1,1,()=>{r[d]=null}),ae(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),A(t,1),t.m(i.parentNode,i)),f[14]&&!f[6]?u?u.p(f,c):(u=Uh(f),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(f){l||(A(t),l=!0)},o(f){L(t),l=!1},d(f){f&&(k(i),k(s)),r[e].d(f),u&&u.d(f)}}}function AE(n){let e,t,i,s,l,o,r=n[6]?"Create":"Save changes",a,u,f,c;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=W(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[17]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[15]||n[11],Q(l,"btn-loading",n[11]||n[7])},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),b(l,o),b(o,a),f||(c=Y(e,"click",n[31]),f=!0)},p(d,h){h[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),h[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&le(a,r),h[0]&34816&&u!==(u=!d[15]||d[11])&&(l.disabled=u),h[0]&2176&&Q(l,"btn-loading",d[11]||d[7])},d(d){d&&(k(e),k(s),k(l)),f=!1,c()}}}function IE(n){let e,t,i={class:` - record-panel - `+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+` - `+(n[14]&&!n[6]?"colored-header":"")+` - `,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[AE],header:[DE],default:[$E]},$$scope:{ctx:n}};return e=new rn({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&81984&&(o.class=` - record-panel - `+(s[16]?"overlay-panel-xl":"overlay-panel-lg")+` - `+(s[14]&&!s[6]?"colored-header":"")+` - `),l[0]&128&&(o.btnClose=!s[7]),l[0]&128&&(o.escClose=!s[7]),l[0]&128&&(o.overlayClose=!s[7]),l[0]&4352&&(o.beforeHide=s[55]),l[0]&60925|l[2]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[56](null),V(e,s)}}}const rs="form",wl="providers";function LE(n,e,t){let i,s,l,o,r;const a=pt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d={},h={},m=null,g=!1,_=!1,y={},S={},C=JSON.stringify(d),T=C,$=rs,M=!0,O=!0;function D(ue){return F(ue),t(12,_=!0),t(13,$=rs),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}function N(){t(12,_=!1),I()}async function P(ue){if(ue&&typeof ue=="string"){try{return await ce.collection(f.id).getOne(ue)}catch(De){De.isAbort||(N(),console.warn("resolveModel:",De),Ci(`Unable to load record with id "${ue}"`))}return null}return ue}async function F(ue){t(7,O=!0),on({}),t(4,y={}),t(5,S={}),t(2,d=typeof ue=="string"?{id:ue,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:ue||{}),t(3,h=structuredClone(d)),t(2,d=await P(ue)||{}),t(3,h=structuredClone(d)),await ln(),t(10,m=B()),!m||J(h,m)?t(10,m=null):(delete m.password,delete m.passwordConfirm),t(28,C=JSON.stringify(h)),t(7,O=!1)}async function R(ue){var Xe,Jt;on({}),t(2,d=ue||{}),t(4,y={}),t(5,S={});const De=((Jt=(Xe=f==null?void 0:f.schema)==null?void 0:Xe.filter(it=>it.type!="file"))==null?void 0:Jt.map(it=>it.name))||[];for(let it in ue)De.includes(it)||t(3,h[it]=ue[it],h);await ln(),t(28,C=JSON.stringify(h)),U()}function q(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function B(ue){try{const De=window.localStorage.getItem(q());if(De)return JSON.parse(De)}catch{}return ue}function Z(ue){try{window.localStorage.setItem(q(),ue)}catch(De){console.warn("updateDraft failure:",De),window.localStorage.removeItem(q())}}function X(){m&&(t(3,h=m),t(10,m=null))}function J(ue,De){var Lt;const Xe=structuredClone(ue||{}),Jt=structuredClone(De||{}),it=(Lt=f==null?void 0:f.schema)==null?void 0:Lt.filter(Rn=>Rn.type==="file");for(let Rn of it)delete Xe[Rn.name],delete Jt[Rn.name];const It=["expand","password","passwordConfirm"];for(let Rn of It)delete Xe[Rn],delete Jt[Rn];return JSON.stringify(Xe)==JSON.stringify(Jt)}function U(){t(10,m=null),window.localStorage.removeItem(q())}async function oe(ue=!0){if(!(g||!r||!(f!=null&&f.id))){t(11,g=!0);try{const De=se();let Xe;M?Xe=await ce.collection(f.id).create(De):Xe=await ce.collection(f.id).update(h.id,De),zt(M?"Successfully created record.":"Successfully updated record."),U(),ue?N():R(Xe),a("save",{isNew:M,record:Xe})}catch(De){ce.error(De)}t(11,g=!1)}}function ee(){d!=null&&d.id&&_n("Do you really want to delete the selected record?",()=>ce.collection(d.collectionId).delete(d.id).then(()=>{I(),zt("Successfully deleted record."),a("delete",d)}).catch(ue=>{ce.error(ue)}))}function se(){const ue=structuredClone(h||{}),De=new FormData,Xe={id:ue.id},Jt={};for(const it of(f==null?void 0:f.schema)||[])Xe[it.name]=!0,it.type=="json"&&(Jt[it.name]=!0);i&&(Xe.username=!0,Xe.email=!0,Xe.emailVisibility=!0,Xe.password=!0,Xe.passwordConfirm=!0,Xe.verified=!0);for(const it in ue)if(Xe[it]){if(typeof ue[it]>"u"&&(ue[it]=null),Jt[it]&&ue[it]!=="")try{JSON.parse(ue[it])}catch(It){const Lt={};throw Lt[it]={code:"invalid_json",message:It.toString()},new Kn({status:400,response:{data:Lt}})}j.addValueToFormData(De,it,ue[it])}for(const it in y){const It=j.toArray(y[it]);for(const Lt of It)De.append(it,Lt)}for(const it in S){const It=j.toArray(S[it]);for(const Lt of It)De.append(it+"."+Lt,"")}return De}function Ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||_n(`Do you really want to sent verification email to ${d.email}?`,()=>ce.collection(f.id).requestVerification(d.email).then(()=>{zt(`Successfully sent verification email to ${d.email}.`)}).catch(ue=>{ce.error(ue)}))}function qe(){!(f!=null&&f.id)||!(d!=null&&d.email)||_n(`Do you really want to sent password reset email to ${d.email}?`,()=>ce.collection(f.id).requestPasswordReset(d.email).then(()=>{zt(`Successfully sent password reset email to ${d.email}.`)}).catch(ue=>{ce.error(ue)}))}function Ve(){o?_n("You have unsaved changes. Do you really want to discard them?",()=>{We()}):We()}async function We(){let ue=d?structuredClone(d):null;if(ue){ue.id="",ue.created="",ue.updated="";const De=(f==null?void 0:f.schema)||[];for(const Xe of De)Xe.type==="file"&&delete ue[Xe.name]}U(),D(ue),await ln(),t(28,C="")}function ke(ue){(ue.ctrlKey||ue.metaKey)&&ue.code=="KeyS"&&(ue.preventDefault(),ue.stopPropagation(),oe(!1))}const Me=()=>I(),Je=()=>Ee(),dt=()=>qe(),Se=()=>Ve(),we=()=>ee(),Ue=()=>t(13,$=rs),nt=()=>t(13,$=wl),ne=()=>X(),Ne=()=>U();function Te(){h.id=this.value,t(3,h)}function ot(ue){h=ue,t(3,h)}function At(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function nn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function sn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function an(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Nn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function _i(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Fn(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Ie(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function Ot(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function oi(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}function cn(ue,De){n.$$.not_equal(y[De.name],ue)&&(y[De.name]=ue,t(4,y))}function Xn(ue,De){n.$$.not_equal(S[De.name],ue)&&(S[De.name]=ue,t(5,S))}function Ai(ue,De){n.$$.not_equal(h[De.name],ue)&&(h[De.name]=ue,t(3,h))}const Cn=()=>o&&_?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{N()}),!1):(on({}),U(),!0);function Qn(ue){te[ue?"unshift":"push"](()=>{c=ue,t(9,c)})}function en(ue){Re.call(this,n,ue)}function et(ue){Re.call(this,n,ue)}return n.$$set=ue=>{"collection"in ue&&t(0,f=ue.collection)},n.$$.update=()=>{var ue;n.$$.dirty[0]&1&&t(14,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(16,s=!!((ue=f==null?void 0:f.schema)!=null&&ue.find(De=>De.type==="editor"))),n.$$.dirty[0]&48&&t(30,l=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,T=JSON.stringify(h)),n.$$.dirty[0]&1879048192&&t(8,o=l||C!=T),n.$$.dirty[0]&4&&t(6,M=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!O&&(M||o)),n.$$.dirty[0]&536871040&&(O||Z(T))},[f,I,d,h,y,S,M,O,o,c,m,g,_,$,i,r,s,u,N,X,U,oe,ee,Ee,qe,Ve,ke,D,C,T,l,Me,Je,dt,Se,we,Ue,nt,ne,Ne,Te,ot,At,nn,sn,an,Nn,_i,Fn,Ie,Ot,oi,cn,Xn,Ai,Cn,Qn,en,et]}class fu extends be{constructor(e){super(),_e(this,e,LE,IE,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function Wh(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Yh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Kh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function Jh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function PE(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function NE(n){var l,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(l=e[0])==null?void 0:l.expand)==null?void 0:o[e[1].name]);e[10]=i;const s=e[2]?20:500;return e[11]=s,e}function FE(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function RE(n){let e,t;return{c(){e=v("div"),t=W(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function qE(n){let e,t=j.truncate(n[3])+"",i,s;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=j.truncate(n[3]))},m(l,o){w(l,e,o),b(e,i)},p(l,o){o&8&&t!==(t=j.truncate(l[3])+"")&&le(i,t),o&8&&s!==(s=j.truncate(l[3]))&&p(e,"title",s)},i:x,o:x,d(l){l&&k(e)}}}function jE(n){let e,t=[],i=new Map,s,l,o=pe(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;un[17]&&Zh();return{c(){var u;e=v("div");for(let f=0;fu[17]?a||(a=Zh(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!l||f&2)&&Q(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!l){for(let f=0;fn[11]&&xh();return{c(){e=v("div"),i.c(),s=E(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),b(e,s),u&&u.m(e,null),l=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(re(),L(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),A(i,1),i.m(e,s)),f[9].length>f[11]?u||(u=xh(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){f&&k(e),r[t].d(),u&&u.d()}}}function VE(n){let e,t=[],i=new Map,s=pe(j.toArray(n[3]));const l=o=>o[8]+o[6];for(let o=0;o{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function UE(n){let e,t=j.truncate(n[3])+"",i,s,l;return{c(){e=v("a"),i=W(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),b(e,i),s||(l=[Ce(Be.call(null,e,"Open in new tab")),Y(e,"click",Sn(n[4]))],s=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&le(i,t),r&8&&p(e,"href",o[3])},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function WE(n){let e,t;return{c(){e=v("span"),t=W(n[3]),p(e,"class","txt")},m(i,s){w(i,e,s),b(e,t)},p(i,s){s&8&&le(t,i[3])},i:x,o:x,d(i){i&&k(e)}}}function YE(n){let e,t=n[3]?"True":"False",i;return{c(){e=v("span"),i=W(t),p(e,"class","txt")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[3]?"True":"False")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function KE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function JE(n){let e,t,i,s;const l=[eD,xE],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),L(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){a&&k(i),o[e].d(a)}}}function Gh(n,e){let t,i,s;return i=new au({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Zh(n){let e;return{c(){e=W("...")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function GE(n){let e,t=pe(n[9].slice(0,n[11])),i=[];for(let s=0;sr[8]+r[6];for(let r=0;r500&&tm(n);return{c(){e=v("span"),i=W(t),s=E(),r&&r.c(),l=ye(),p(e,"class","txt")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),r&&r.m(a,u),w(a,l,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&le(i,t),a[5].length>500?r?(r.p(a,u),u&8&&A(r,1)):(r=tm(a),r.c(),A(r,1),r.m(l.parentNode,l)):r&&(re(),L(r,1,1,()=>{r=null}),ae())},i(a){o||(A(r),o=!0)},o(a){L(r),o=!1},d(a){a&&(k(e),k(s),k(l)),r&&r.d(a)}}}function eD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=j.truncate(s[5])+"")&&le(i,t)},i:x,o:x,d(s){s&&k(e)}}}function tm(n){let e,t;return e=new js({props:{value:JSON.stringify(n[3],null,2)}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&8&&(l.value=JSON.stringify(i[3],null,2)),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function tD(n){let e,t,i,s,l;const o=[JE,KE,YE,WE,UE,BE,zE,VE,HE,jE,qE,RE],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?FE(f):c===8?NE(f):c===9?PE(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),s=ye()},m(f,c){r[t].m(f,c),w(f,s,c),l=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(re(),L(r[d],1,1,()=>{r[d]=null}),ae(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),A(i,1),i.m(s.parentNode,s))},i(f){l||(A(i),l=!0)},o(f){L(i),l=!1},d(f){f&&k(s),r[t].d(f)}}}function nD(n,e,t){let i,{record:s}=e,{field:l}=e,{short:o=!1}=e;function r(a){Re.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,s=a.record),"field"in a&&t(1,l=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=s==null?void 0:s[l.name])},[s,l,o,i,r]}class Y1 extends be{constructor(e){super(),_e(this,e,nD,tD,me,{record:0,field:1,short:2})}}function nm(n,e,t){const i=n.slice();return i[13]=e[t],i}function im(n){let e,t,i=n[13].name+"",s,l,o,r,a;return r=new Y1({props:{field:n[13],record:n[3]}}),{c(){e=v("tr"),t=v("td"),s=W(i),l=E(),o=v("td"),z(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),b(e,t),b(t,s),b(e,l),b(e,o),H(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&le(s,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){L(r.$$.fragment,u),a=!1},d(u){u&&k(e),V(r)}}}function sm(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].created}}),{c(){e=v("tr"),t=v("td"),t.textContent="created",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function lm(n){let e,t,i,s,l,o;return l=new $i({props:{date:n[3].updated}}),{c(){e=v("tr"),t=v("td"),t.textContent="updated",i=E(),s=v("td"),z(l.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(s,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),H(l,s,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),l.$set(u)},i(r){o||(A(l.$$.fragment,r),o=!0)},o(r){L(l.$$.fragment,r),o=!1},d(r){r&&k(e),V(l)}}}function iD(n){var M;let e,t,i,s,l,o,r,a,u,f,c=(n[3].id||"...")+"",d,h,m,g,_;a=new js({props:{value:n[3].id}});let y=pe((M=n[0])==null?void 0:M.schema),S=[];for(let O=0;OL(S[O],1,1,()=>{S[O]=null});let T=n[3].created&&sm(n),$=n[3].updated&&lm(n);return{c(){e=v("table"),t=v("tbody"),i=v("tr"),s=v("td"),s.textContent="id",l=E(),o=v("td"),r=v("div"),z(a.$$.fragment),u=E(),f=v("span"),d=W(c),h=E();for(let O=0;O{T=null}),ae()),O[3].updated?$?($.p(O,D),D&8&&A($,1)):($=lm(O),$.c(),A($,1),$.m(t,null)):$&&(re(),L($,1,1,()=>{$=null}),ae()),(!_||D&16)&&Q(e,"table-loading",O[4])},i(O){if(!_){A(a.$$.fragment,O);for(let D=0;DClose',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[7]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function oD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[lD],header:[sD],default:[iD]},$$scope:{ctx:n}};return e=new rn({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&32&&(o.class="record-preview-panel "+(s[5]?"overlay-panel-xl":"overlay-panel-lg")),l&65561&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[8](null),V(e,s)}}}function rD(n,e,t){let i,{collection:s}=e,l,o={},r=!1;function a(_){return f(_),l==null?void 0:l.show()}function u(){return t(4,r=!1),l==null?void 0:l.hide()}async function f(_){t(3,o={}),t(4,r=!0),t(3,o=await c(_)||{}),t(4,r=!1)}async function c(_){if(_&&typeof _=="string"){try{return await ce.collection(s.id).getOne(_)}catch(y){y.isAbort||(u(),console.warn("resolveModel:",y),Ci(`Unable to load record with id "${_}"`))}return null}return _}const d=()=>u();function h(_){te[_?"unshift":"push"](()=>{l=_,t(2,l)})}function m(_){Re.call(this,n,_)}function g(_){Re.call(this,n,_)}return n.$$set=_=>{"collection"in _&&t(0,s=_.collection)},n.$$.update=()=>{var _;n.$$.dirty&1&&t(5,i=!!((_=s==null?void 0:s.schema)!=null&&_.find(y=>y.type==="editor")))},[s,u,l,o,r,i,a,d,h,m,g]}class aD extends be{constructor(e){super(),_e(this,e,rD,oD,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function om(n,e,t){const i=n.slice();return i[63]=e[t],i}function rm(n,e,t){const i=n.slice();return i[66]=e[t],i}function am(n,e,t){const i=n.slice();return i[66]=e[t],i}function um(n,e,t){const i=n.slice();return i[59]=e[t],i}function fm(n){let e;function t(l,o){return l[13]?fD:uD}let i=t(n),s=i(n);return{c(){e=v("th"),s.c(),p(e,"class","bulk-select-col min-width")},m(l,o){w(l,e,o),s.m(e,null)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e,null)))},d(l){l&&k(e),s.d()}}}function uD(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("input"),s=E(),l=v("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(l,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),o||(r=Y(t,"change",n[32]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&k(e),o=!1,r()}}}function fD(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function cm(n){let e,t,i;function s(o){n[33](o)}let l={class:"col-type-text col-field-id",name:"id",$$slots:{default:[cD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function cD(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function dm(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l,o=e&&pm(n),r=i&&hm(n);return{c(){o&&o.c(),t=E(),r&&r.c(),s=ye()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,s,u),l=!0},p(a,u){u[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,u),u[0]&32&&A(o,1)):(o=pm(a),o.c(),A(o,1),o.m(t.parentNode,t)):o&&(re(),L(o,1,1,()=>{o=null}),ae()),u[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,u),u[0]&32&&A(r,1)):(r=hm(a),r.c(),A(r,1),r.m(s.parentNode,s)):r&&(re(),L(r,1,1,()=>{r=null}),ae())},i(a){l||(A(o),A(r),l=!0)},o(a){L(o),L(r),l=!1},d(a){a&&(k(t),k(s)),o&&o.d(a),r&&r.d(a)}}}function pm(n){let e,t,i;function s(o){n[34](o)}let l={class:"col-type-text col-field-id",name:"username",$$slots:{default:[dD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function dD(n){let e;return{c(){e=v("div"),e.innerHTML=` username`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function hm(n){let e,t,i;function s(o){n[35](o)}let l={class:"col-type-email col-field-email",name:"email",$$slots:{default:[pD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function pD(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function hD(n){let e,t,i,s,l,o=n[66].name+"",r;return{c(){e=v("div"),t=v("i"),s=E(),l=v("span"),r=W(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(l,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),b(e,t),b(e,s),b(e,l),b(l,r)},p(a,u){u[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[66].name+"")&&le(r,o)},d(a){a&&k(e)}}}function mm(n,e){let t,i,s,l;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[hD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new hn({props:r}),te.push(()=>he(i,"sort",o)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[66].type+" col-field-"+e[66].name),u[0]&524288&&(f.name=e[66].name),u[0]&524288|u[2]&512&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],ve(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function gm(n){let e,t,i;function s(o){n[37](o)}let l={class:"col-type-date col-field-created",name:"created",$$slots:{default:[mD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function mD(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _m(n){let e,t,i;function s(o){n[38](o)}let l={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[gD]},$$scope:{ctx:n}};return n[0]!==void 0&&(l.sort=n[0]),e=new hn({props:l}),te.push(()=>he(e,"sort",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function gD(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function bm(n){let e;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:x,d(t){t&&k(e),n[39](null)}}}function vm(n){let e;function t(l,o){return l[13]?bD:_D}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function _D(n){let e,t,i,s;function l(a,u){var f;if((f=a[1])!=null&&f.length)return yD;if(!a[10])return vD}let o=l(n),r=o&&o(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No records found.",s=E(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),r&&r.m(t,null)},p(a,u){o===(o=l(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&k(e),r&&r.d()}}}function bD(n){let e;return{c(){e=v("tr"),e.innerHTML=''},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function vD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[44]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function yD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[43]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function ym(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[40](n[63])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[63].id),i.checked=l=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,h){w(d,e,h),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[Y(i,"change",c),Y(t,"click",Sn(n[30]))],u=!0)},p(d,h){n=d,h[0]&8&&s!==(s="checkbox_"+n[63].id)&&p(i,"id",s),h[0]&24&&l!==(l=n[4][n[63].id])&&(i.checked=l),h[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,$e(f)}}}function km(n){let e,t,i,s,l,o,r=n[63].id+"",a,u,f;s=new js({props:{value:n[63].id}});let c=n[9]&&wm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),a=W(r),u=E(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,h){w(d,e,h),b(e,t),b(t,i),H(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,h){const m={};h[0]&8&&(m.value=d[63].id),s.$set(m),(!f||h[0]&8)&&r!==(r=d[63].id+"")&&le(a,r),d[9]?c?c.p(d,h):(c=wm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){L(s.$$.fragment,d),f=!1},d(d){d&&k(e),V(s),c&&c.d()}}}function wm(n){let e;function t(l,o){return l[63].verified?wD:kD}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function kD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=Ce(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function wD(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=Ce(Be.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function Sm(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),s,l=e&&Tm(n),o=i&&Cm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=ye()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?l?l.p(r,a):(l=Tm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Cm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){r&&(k(t),k(s)),l&&l.d(r),o&&o.d(r)}}}function Tm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?TD:SD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function SD(n){let e,t=n[63].username+"",i,s;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[63].username)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[63].username+"")&&le(i,t),o[0]&8&&s!==(s=l[63].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function TD(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Cm(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?$D:CD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&k(e),l.d()}}}function CD(n){let e,t=n[63].email+"",i,s;return{c(){e=v("span"),i=W(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[63].email)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[63].email+"")&&le(i,t),o[0]&8&&s!==(s=l[63].email)&&p(e,"title",s)},d(l){l&&k(e)}}}function $D(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function $m(n,e){let t,i,s,l;return i=new Y1({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=v("td"),z(i.$$.fragment),p(t,"class",s="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),H(i,t,null),l=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!l||r[0]&524288&&s!==(s="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",s)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){L(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Mm(n){let e,t,i;return t=new $i({props:{date:n[63].created}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[63].created),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function Om(n){let e,t,i;return t=new $i({props:{date:n[63].updated}}),{c(){e=v("td"),z(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.date=s[63].updated),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function Em(n,e){let t,i,s=!e[5].includes("@id"),l,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),h,m,g,_,y,S=!e[10]&&ym(e),C=s&&km(e),T=e[9]&&Sm(e),$=pe(e[19]);const M=P=>P[66].name;for(let P=0;P<$.length;P+=1){let F=rm(e,$,P),R=M(F);a.set(R,r[P]=$m(R,F))}let O=f&&Mm(e),D=d&&Om(e);function I(){return e[41](e[63])}function N(...P){return e[42](e[63],...P)}return{key:n,first:null,c(){t=v("tr"),S&&S.c(),i=E(),C&&C.c(),l=E(),T&&T.c(),o=E();for(let P=0;P',p(m,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(P,F){w(P,t,F),S&&S.m(t,null),b(t,i),C&&C.m(t,null),b(t,l),T&&T.m(t,null),b(t,o);for(let R=0;R{C=null}),ae()),e[9]?T?T.p(e,F):(T=Sm(e),T.c(),T.m(t,o)):T&&(T.d(1),T=null),F[0]&524296&&($=pe(e[19]),re(),r=gt(r,F,M,1,e,$,a,t,qt,$m,u,rm),ae()),F[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?O?(O.p(e,F),F[0]&288&&A(O,1)):(O=Mm(e),O.c(),A(O,1),O.m(t,c)):O&&(re(),L(O,1,1,()=>{O=null}),ae()),F[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?D?(D.p(e,F),F[0]&160&&A(D,1)):(D=Om(e),D.c(),A(D,1),D.m(t,h)):D&&(re(),L(D,1,1,()=>{D=null}),ae())},i(P){if(!g){A(C);for(let F=0;F<$.length;F+=1)A(r[F]);A(O),A(D),g=!0}},o(P){L(C);for(let F=0;FJ[66].name;for(let J=0;JJ[10]?J[63]:J[63].id;for(let J=0;J{O=null}),ae()),J[9]?D?(D.p(J,U),U[0]&512&&A(D,1)):(D=dm(J),D.c(),A(D,1),D.m(i,r)):D&&(re(),L(D,1,1,()=>{D=null}),ae()),U[0]&524289&&(I=pe(J[19]),re(),a=gt(a,U,N,1,J,I,u,i,qt,mm,f,am),ae()),U[0]&288&&(c=J[8]&&!J[5].includes("@created")),c?P?(P.p(J,U),U[0]&288&&A(P,1)):(P=gm(J),P.c(),A(P,1),P.m(i,d)):P&&(re(),L(P,1,1,()=>{P=null}),ae()),U[0]&160&&(h=J[7]&&!J[5].includes("@updated")),h?F?(F.p(J,U),U[0]&160&&A(F,1)):(F=_m(J),F.c(),A(F,1),F.m(i,m)):F&&(re(),L(F,1,1,()=>{F=null}),ae()),J[16].length?R?R.p(J,U):(R=bm(J),R.c(),R.m(g,null)):R&&(R.d(1),R=null),U[0]&9971642&&(q=pe(J[3]),re(),S=gt(S,U,B,1,J,q,C,y,qt,Em,T,om),ae(),!q.length&&Z?Z.p(J,U):q.length?Z&&(Z.d(1),Z=null):(Z=vm(J),Z.c(),Z.m(y,T))),J[3].length&&J[18]?X?X.p(J,U):(X=Dm(J),X.c(),X.m(y,null)):X&&(X.d(1),X=null),(!$||U[0]&8192)&&Q(e,"table-loading",J[13])},i(J){if(!$){A(O),A(D);for(let U=0;U({62:l}),({uniqueId:l})=>[0,0,l?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),H(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function ED(n){let e,t,i=[],s=new Map,l,o,r=pe(n[16]);const a=u=>u[59].id+u[59].name;for(let u=0;u{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){s&&k(e),i&&i.d(s)}}}function Lm(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,m,g,_,y,S;return{c(){e=v("div"),t=v("div"),i=W("Selected "),s=v("strong"),l=W(n[6]),o=E(),a=W(r),u=E(),f=v("button"),f.innerHTML='Reset',c=E(),d=v("div"),h=E(),m=v("button"),m.innerHTML='Delete selected',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-sm btn-transparent btn-danger"),Q(m,"btn-loading",n[14]),Q(m,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(s,l),b(t,o),b(t,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,h),b(e,m),_=!0,y||(S=[Y(f,"click",n[47]),Y(m,"click",n[48])],y=!0)},p(C,T){(!_||T[0]&64)&&le(l,C[6]),(!_||T[0]&64)&&r!==(r=C[6]===1?"record":"records")&&le(a,r),(!_||T[0]&16384)&&Q(f,"btn-disabled",C[14]),(!_||T[0]&16384)&&Q(m,"btn-loading",C[14]),(!_||T[0]&16384)&&Q(m,"btn-disabled",C[14])},i(C){_||(C&&xe(()=>{_&&(g||(g=He(e,mi,{duration:150,y:5},!0)),g.run(1))}),_=!0)},o(C){C&&(g||(g=He(e,mi,{duration:150,y:5},!1)),g.run(0)),_=!1},d(C){C&&k(e),C&&g&&g.end(),y=!1,$e(S)}}}function AD(n){let e,t,i,s,l={class:"table-wrapper",$$slots:{before:[DD],default:[MD]},$$scope:{ctx:n}};e=new Go({props:l}),n[46](e);let o=n[6]&&Lm(n);return{c(){z(e.$$.fragment),t=E(),o&&o.c(),i=ye()},m(r,a){H(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),s=!0},p(r,a){const u={};a[0]&1030075|a[2]&512&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&A(o,1)):(o=Lm(r),o.c(),A(o,1),o.m(i.parentNode,i)):o&&(re(),L(o,1,1,()=>{o=null}),ae())},i(r){s||(A(e.$$.fragment,r),A(o),s=!0)},o(r){L(e.$$.fragment,r),L(o),s=!1},d(r){r&&(k(t),k(i)),n[46](null),V(e,r),o&&o.d(r)}}}const ID=/^([\+\-])?(\w+)$/,Pm=40;function LD(n,e,t){let i,s,l,o,r,a,u,f,c,d,h,m;Ge(n,Zn,Ie=>t(53,m=Ie));const g=pt();let{collection:_}=e,{sort:y=""}=e,{filter:S=""}=e,C,T=[],$=1,M=0,O={},D=!0,I=!1,N=0,P,F=[],R=[],q="";function B(){_!=null&&_.id&&(F.length?localStorage.setItem(q,JSON.stringify(F)):localStorage.removeItem(q))}function Z(){if(t(5,F=[]),!!(_!=null&&_.id))try{const Ie=localStorage.getItem(q);Ie&&t(5,F=JSON.parse(Ie)||[])}catch{}}function X(Ie){return!!T.find(Ot=>Ot.id)}async function J(){const Ie=$;for(let Ot=1;Ot<=Ie;Ot++)(Ot===1||u)&&await U(Ot,!1)}async function U(Ie=1,Ot=!0){var Qn,en,et;if(!(_!=null&&_.id))return;t(13,D=!0);let oi=y;const cn=oi.match(ID),Xn=cn?r.find(ue=>ue.name===cn[2]):null;if(cn&&Xn){const ue=((et=(en=(Qn=m==null?void 0:m.find(Xe=>{var Jt;return Xe.id==((Jt=Xn.options)==null?void 0:Jt.collectionId)}))==null?void 0:Qn.schema)==null?void 0:en.filter(Xe=>Xe.presentable))==null?void 0:et.map(Xe=>Xe.name))||[],De=[];for(const Xe of ue)De.push((cn[1]||"")+cn[2]+"."+Xe);De.length>0&&(oi=De.join(","))}const Ai=j.getAllCollectionIdentifiers(_),Cn=o.map(ue=>ue.name+":excerpt(200)").concat(r.map(ue=>"expand."+ue.name+".*:excerpt(200)"));return Cn.length&&Cn.unshift("*"),ce.collection(_.id).getList(Ie,Pm,{sort:oi,skipTotal:1,filter:j.normalizeSearchFilter(S,Ai),expand:r.map(ue=>ue.name).join(","),fields:Cn.join(","),requestKey:"records_list"}).then(async ue=>{var De;if(Ie<=1&&oe(),t(13,D=!1),t(12,$=ue.page),t(28,M=ue.items.length),g("load",T.concat(ue.items)),o.length)for(let Xe of ue.items)Xe._partial=!0;if(Ot){const Xe=++N;for(;(De=ue.items)!=null&&De.length&&N==Xe;)t(3,T=T.concat(ue.items.splice(0,20))),await j.yieldToMain()}else t(3,T=T.concat(ue.items))}).catch(ue=>{ue!=null&&ue.isAbort||(t(13,D=!1),console.warn(ue),oe(),ce.error(ue,(ue==null?void 0:ue.status)!=400))})}function oe(){C==null||C.resetVerticalScroll(),t(3,T=[]),t(12,$=1),t(28,M=0),t(4,O={})}function ee(){c?se():Ee()}function se(){t(4,O={})}function Ee(){for(const Ie of T)t(4,O[Ie.id]=Ie,O);t(4,O)}function qe(Ie){O[Ie.id]?delete O[Ie.id]:t(4,O[Ie.id]=Ie,O),t(4,O)}function Ve(){_n(`Do you really want to delete the selected ${f===1?"record":"records"}?`,We)}async function We(){if(I||!f||!(_!=null&&_.id))return;let Ie=[];for(const Ot of Object.keys(O))Ie.push(ce.collection(_.id).delete(Ot));return t(14,I=!0),Promise.all(Ie).then(()=>{zt(`Successfully deleted the selected ${f===1?"record":"records"}.`),g("delete",O),se()}).catch(Ot=>{ce.error(Ot)}).finally(()=>(t(14,I=!1),J()))}function ke(Ie){Re.call(this,n,Ie)}const Me=(Ie,Ot)=>{Ot.target.checked?j.removeByValue(F,Ie.id):j.pushUnique(F,Ie.id),t(5,F)},Je=()=>ee();function dt(Ie){y=Ie,t(0,y)}function Se(Ie){y=Ie,t(0,y)}function we(Ie){y=Ie,t(0,y)}function Ue(Ie){y=Ie,t(0,y)}function nt(Ie){y=Ie,t(0,y)}function ne(Ie){y=Ie,t(0,y)}function Ne(Ie){te[Ie?"unshift":"push"](()=>{P=Ie,t(15,P)})}const Te=Ie=>qe(Ie),ot=Ie=>g("select",Ie),At=(Ie,Ot)=>{Ot.code==="Enter"&&(Ot.preventDefault(),g("select",Ie))},nn=()=>t(1,S=""),sn=()=>g("new"),an=()=>U($+1);function Nn(Ie){te[Ie?"unshift":"push"](()=>{C=Ie,t(11,C)})}const _i=()=>se(),Fn=()=>Ve();return n.$$set=Ie=>{"collection"in Ie&&t(25,_=Ie.collection),"sort"in Ie&&t(0,y=Ie.sort),"filter"in Ie&&t(1,S=Ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&_!=null&&_.id&&(q=_.id+"@hiddenColumns",Z(),oe()),n.$$.dirty[0]&33554432&&t(10,i=(_==null?void 0:_.type)==="view"),n.$$.dirty[0]&33554432&&t(9,s=(_==null?void 0:_.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,l=(_==null?void 0:_.schema)||[]),n.$$.dirty[0]&536870912&&(o=l.filter(Ie=>Ie.type==="editor")),n.$$.dirty[0]&536870912&&(r=l.filter(Ie=>Ie.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=l.filter(Ie=>!F.includes(Ie.id))),n.$$.dirty[0]&33554435&&_!=null&&_.id&&y!==-1&&S!==-1&&U(1),n.$$.dirty[0]&268435456&&t(18,u=M>=Pm),n.$$.dirty[0]&16&&t(6,f=Object.keys(O).length),n.$$.dirty[0]&72&&t(17,c=T.length&&f===T.length),n.$$.dirty[0]&32&&F!==-1&&B(),n.$$.dirty[0]&1032&&t(8,d=!i||T.length>0&&typeof T[0].created<"u"),n.$$.dirty[0]&1032&&t(7,h=!i||T.length>0&&typeof T[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,R=[].concat(s?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],l.map(Ie=>({id:Ie.id,name:Ie.name})),d?{id:"@created",name:"created"}:[],h?{id:"@updated",name:"updated"}:[]))},[y,S,U,T,O,F,f,h,d,s,i,C,$,D,I,P,R,c,u,a,g,ee,se,qe,Ve,_,X,J,M,l,ke,Me,Je,dt,Se,we,Ue,nt,ne,Ne,Te,ot,At,nn,sn,an,Nn,_i,Fn]}class PD extends be{constructor(e){super(),_e(this,e,LD,AD,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function ND(n){let e,t,i,s,l=(n[2]?"...":n[0])+"",o,r;return{c(){e=v("div"),t=v("span"),t.textContent="Total found:",i=E(),s=v("span"),o=W(l),p(t,"class","txt"),p(s,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),b(e,t),b(e,i),b(e,s),b(s,o)},p(a,[u]){u&5&&l!==(l=(a[2]?"...":a[0])+"")&&le(o,l),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:x,o:x,d(a){a&&k(e)}}}function FD(n,e,t){const i=pt();let{collection:s}=e,{filter:l=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(s!=null&&s.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(s),c=await ce.collection(s.id).getList(1,1,{filter:j.normalizeSearchFilter(l,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,s=f.collection),"filter"in f&&t(4,l=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&s!=null&&s.id&&l!==-1&&u()},[o,r,a,s,l,u]}class RD extends be{constructor(e){super(),_e(this,e,FD,ND,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function qD(n){let e,t,i,s;return e=new a6({}),i=new Tn({props:{class:"flex-content",$$slots:{footer:[zD],default:[VD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function jD(n){let e,t;return e=new Tn({props:{center:!0,$$slots:{default:[WD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&4112|s[1]&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function HD(n){let e,t;return e=new Tn({props:{center:!0,$$slots:{default:[YD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[1]&8192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Nm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(s,l){w(s,e,l),t||(i=[Ce(Be.call(null,e,{text:"Edit collection",position:"right"})),Y(e,"click",n[20])],t=!0)},p:x,d(s){s&&k(e),t=!1,$e(i)}}}function Fm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' New record',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[23]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function VD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O,D,I,N,P=!n[12]&&Nm(n);c=new Jo({}),c.$on("refresh",n[21]);let F=n[2].type!=="view"&&Fm(n);y=new Dl({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function R(Z){n[26](Z)}function q(Z){n[27](Z)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),$=new PD({props:B}),n[25]($),te.push(()=>he($,"filter",R)),te.push(()=>he($,"sort",q)),$.$on("select",n[28]),$.$on("delete",n[29]),$.$on("new",n[30]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=W(o),a=E(),u=v("div"),P&&P.c(),f=E(),z(c.$$.fragment),d=E(),h=v("div"),m=v("button"),m.innerHTML=' API Preview',g=E(),F&&F.c(),_=E(),z(y.$$.fragment),S=E(),C=v("div"),T=E(),z($.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(m,"type","button"),p(m,"class","btn btn-outline"),p(h,"class","btns-group"),p(e,"class","page-header"),p(C,"class","clearfix m-b-sm")},m(Z,X){w(Z,e,X),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),P&&P.m(u,null),b(u,f),H(c,u,null),b(e,d),b(e,h),b(h,m),b(h,g),F&&F.m(h,null),w(Z,_,X),H(y,Z,X),w(Z,S,X),w(Z,C,X),w(Z,T,X),H($,Z,X),D=!0,I||(N=Y(m,"click",n[22]),I=!0)},p(Z,X){(!D||X[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[12]?P&&(P.d(1),P=null):P?P.p(Z,X):(P=Nm(Z),P.c(),P.m(u,f)),Z[2].type!=="view"?F?F.p(Z,X):(F=Fm(Z),F.c(),F.m(h,null)):F&&(F.d(1),F=null);const J={};X[0]&1&&(J.value=Z[0]),X[0]&4&&(J.autocompleteCollection=Z[2]),y.$set(J);const U={};X[0]&4&&(U.collection=Z[2]),!M&&X[0]&1&&(M=!0,U.filter=Z[0],ve(()=>M=!1)),!O&&X[0]&2&&(O=!0,U.sort=Z[1],ve(()=>O=!1)),$.$set(U)},i(Z){D||(A(c.$$.fragment,Z),A(y.$$.fragment,Z),A($.$$.fragment,Z),D=!0)},o(Z){L(c.$$.fragment,Z),L(y.$$.fragment,Z),L($.$$.fragment,Z),D=!1},d(Z){Z&&(k(e),k(_),k(S),k(C),k(T)),P&&P.d(),V(c),F&&F.d(),V(y,Z),n[25](null),V($,Z),I=!1,N()}}}function zD(n){let e,t,i;function s(o){n[19](o)}let l={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(l.totalCount=n[10]),e=new RD({props:l}),n[18](e),te.push(()=>he(e,"totalCount",s)),{c(){z(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ve(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){n[18](null),V(e,o)}}}function BD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("button"),i.innerHTML=' Create new collection',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[17]),s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,l()}}}function UD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function WD(n){let e,t,i;function s(r,a){return r[12]?UD:BD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='',i=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&k(e),o.d()}}}function YD(n){let e;return{c(){e=v("div"),e.innerHTML='

    Loading collections...

    ',p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function KD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[HD,jD,qD],h=[];function m(C,T){return C[3]&&!C[11].length?0:C[11].length?2:1}e=m(n),t=h[e]=d[e](n);let g={};s=new ru({props:g}),n[31](s);let _={};o=new g6({props:_}),n[32](o);let y={collection:n[2]};a=new fu({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return f=new aD({props:S}),n[37](f),f.$on("hide",n[38]),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(C,T){h[e].m(C,T),w(C,i,T),H(s,C,T),w(C,l,T),H(o,C,T),w(C,r,T),H(a,C,T),w(C,u,T),H(f,C,T),c=!0},p(C,T){let $=e;e=m(C),e===$?h[e].p(C,T):(re(),L(h[$],1,1,()=>{h[$]=null}),ae(),t=h[e],t?t.p(C,T):(t=h[e]=d[e](C),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const O={};o.$set(O);const D={};T[0]&4&&(D.collection=C[2]),a.$set(D);const I={};T[0]&4&&(I.collection=C[2]),f.$set(I)},i(C){c||(A(t),A(s.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),A(f.$$.fragment,C),c=!0)},o(C){L(t),L(s.$$.fragment,C),L(o.$$.fragment,C),L(a.$$.fragment,C),L(f.$$.fragment,C),c=!1},d(C){C&&(k(i),k(l),k(r),k(u)),h[e].d(C),n[31](null),V(s,C),n[32](null),V(o,C),n[33](null),V(a,C),n[37](null),V(f,C)}}}function JD(n,e,t){let i,s,l,o,r,a,u;Ge(n,hi,Se=>t(2,s=Se)),Ge(n,Ft,Se=>t(39,l=Se)),Ge(n,wo,Se=>t(3,o=Se)),Ge(n,wa,Se=>t(16,r=Se)),Ge(n,Zn,Se=>t(11,a=Se)),Ge(n,Es,Se=>t(12,u=Se));const f=new URLSearchParams(r);let c,d,h,m,g,_,y=f.get("filter")||"",S=f.get("sort")||"-created",C=f.get("collectionId")||(s==null?void 0:s.id),T=0;nk(C);async function $(Se){await ln(),(s==null?void 0:s.type)==="view"?m.show(Se):h==null||h.show(Se)}function M(){t(14,C=s==null?void 0:s.id),t(0,y=""),t(1,S="-created"),D({recordId:null}),O()}async function O(){if(!S)return;const Se=j.getAllCollectionIdentifiers(s),we=S.split(",").map(Ue=>Ue.startsWith("+")||Ue.startsWith("-")?Ue.substring(1):Ue);we.filter(Ue=>Se.includes(Ue)).length!=we.length&&(Se.includes("created")?t(1,S="-created"):t(1,S=""))}function D(Se={}){const we=Object.assign({collectionId:(s==null?void 0:s.id)||"",filter:y,sort:S},Se);j.replaceHashQueryParams(we)}const I=()=>c==null?void 0:c.show();function N(Se){te[Se?"unshift":"push"](()=>{_=Se,t(9,_)})}function P(Se){T=Se,t(10,T)}const F=()=>c==null?void 0:c.show(s),R=()=>{g==null||g.load(),_==null||_.reload()},q=()=>d==null?void 0:d.show(s),B=()=>h==null?void 0:h.show(),Z=Se=>t(0,y=Se.detail);function X(Se){te[Se?"unshift":"push"](()=>{g=Se,t(8,g)})}function J(Se){y=Se,t(0,y)}function U(Se){S=Se,t(1,S)}const oe=Se=>{D({recordId:Se.detail.id});let we=Se.detail._partial?Se.detail.id:Se.detail;s.type==="view"?m==null||m.show(we):h==null||h.show(we)},ee=()=>{_==null||_.reload()},se=()=>h==null?void 0:h.show();function Ee(Se){te[Se?"unshift":"push"](()=>{c=Se,t(4,c)})}function qe(Se){te[Se?"unshift":"push"](()=>{d=Se,t(5,d)})}function Ve(Se){te[Se?"unshift":"push"](()=>{h=Se,t(6,h)})}const We=()=>{D({recordId:null})},ke=Se=>{y?_==null||_.reload():Se.detail.isNew&&t(10,T++,T),g==null||g.reloadLoadedPages()},Me=Se=>{(!y||g!=null&&g.hasRecord(Se.detail.id))&&t(10,T--,T),g==null||g.reloadLoadedPages()};function Je(Se){te[Se?"unshift":"push"](()=>{m=Se,t(7,m)})}const dt=()=>{D({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=C&&xy(i.get("collectionId")),n.$$.dirty[0]&16388&&s!=null&&s.id&&C!=s.id&&M(),n.$$.dirty[0]&4&&s!=null&&s.id&&O(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&$(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||s!=null&&s.id)&&D(),n.$$.dirty[0]&4&&un(Ft,l=(s==null?void 0:s.name)||"Collections",l)},[y,S,s,o,c,d,h,m,g,_,T,a,u,D,C,i,r,I,N,P,F,R,q,B,Z,X,J,U,oe,ee,se,Ee,qe,Ve,We,ke,Me,Je,dt]}class GD extends be{constructor(e){super(),_e(this,e,JD,KD,me,{},null,[-1,-1])}}function ZD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O,D,I,N;return{c(){e=v("div"),t=v("div"),t.textContent="System",i=E(),s=v("a"),s.innerHTML=' Application',l=E(),o=v("a"),o.innerHTML=' Mail settings',r=E(),a=v("a"),a.innerHTML=' Files storage',u=E(),f=v("a"),f.innerHTML=' Backups',c=E(),d=v("div"),d.innerHTML='Sync',h=E(),m=v("a"),m.innerHTML=' Export collections',g=E(),_=v("a"),_.innerHTML=' Import collections',y=E(),S=v("div"),S.textContent="Authentication",C=E(),T=v("a"),T.innerHTML=' Auth providers',$=E(),M=v("a"),M.innerHTML=' Token options',O=E(),D=v("a"),D.innerHTML=' Admins',p(t,"class","sidebar-title"),p(s,"href","/settings"),p(s,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(d,"class","sidebar-title"),p(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(_,"href","/settings/import-collections"),p(_,"class","sidebar-list-item"),p(S,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(D,"href","/settings/admins"),p(D,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(P,F){w(P,e,F),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),b(e,r),b(e,a),b(e,u),b(e,f),b(e,c),b(e,d),b(e,h),b(e,m),b(e,g),b(e,_),b(e,y),b(e,S),b(e,C),b(e,T),b(e,$),b(e,M),b(e,O),b(e,D),I||(N=[Ce(zn.call(null,s,{path:"/settings"})),Ce(dn.call(null,s)),Ce(zn.call(null,o,{path:"/settings/mail/?.*"})),Ce(dn.call(null,o)),Ce(zn.call(null,a,{path:"/settings/storage/?.*"})),Ce(dn.call(null,a)),Ce(zn.call(null,f,{path:"/settings/backups/?.*"})),Ce(dn.call(null,f)),Ce(zn.call(null,m,{path:"/settings/export-collections/?.*"})),Ce(dn.call(null,m)),Ce(zn.call(null,_,{path:"/settings/import-collections/?.*"})),Ce(dn.call(null,_)),Ce(zn.call(null,T,{path:"/settings/auth-providers/?.*"})),Ce(dn.call(null,T)),Ce(zn.call(null,M,{path:"/settings/tokens/?.*"})),Ce(dn.call(null,M)),Ce(zn.call(null,D,{path:"/settings/admins/?.*"})),Ce(dn.call(null,D))],I=!0)},p:x,d(P){P&&k(e),I=!1,$e(N)}}}function XD(n){let e,t;return e=new R1({props:{class:"settings-sidebar",$$slots:{default:[ZD]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&1&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}class Di extends be{constructor(e){super(),_e(this,e,null,XD,me,{})}}function Rm(n,e,t){const i=n.slice();return i[31]=e[t],i}function qm(n){let e,t;return e=new ge({props:{class:"form-field readonly",name:"id",$$slots:{default:[QD,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return a=new U1({props:{model:n[1]}}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),z(a.$$.fragment),u=E(),f=v("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"class","form-field-addon"),p(f,"type","text"),p(f,"id",c=n[30]),f.value=d=n[1].id,f.readOnly=!0},m(m,g){w(m,e,g),b(e,t),b(e,i),b(e,s),w(m,o,g),w(m,r,g),H(a,r,null),w(m,u,g),w(m,f,g),h=!0},p(m,g){(!h||g[0]&1073741824&&l!==(l=m[30]))&&p(e,"for",l);const _={};g[0]&2&&(_.model=m[1]),a.$set(_),(!h||g[0]&1073741824&&c!==(c=m[30]))&&p(f,"id",c),(!h||g[0]&2&&d!==(d=m[1].id)&&f.value!==d)&&(f.value=d)},i(m){h||(A(a.$$.fragment,m),h=!0)},o(m){L(a.$$.fragment,m),h=!1},d(m){m&&(k(e),k(o),k(r),k(u),k(f)),V(a)}}}function jm(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=E(),fn(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(u,f){w(u,e,f),b(e,t),b(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function xD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",j.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[3]),u||(f=Y(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&de(r,c[3])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function Hm(n){let e,t;return e=new ge({props:{class:"form-field form-field-toggle",$$slots:{default:[eA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function eA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Vm(n){let e,t,i,s,l,o,r,a,u;return s=new ge({props:{class:"form-field required",name:"password",$$slots:{default:[tA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[nA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742848|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(t,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=He(t,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function tA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m;return c=new W1({}),{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),u=E(),f=v("div"),z(c.$$.fragment),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(g,_){w(g,e,_),b(e,t),b(e,i),b(e,s),w(g,o,_),w(g,r,_),de(r,n[9]),w(g,u,_),w(g,f,_),H(c,f,null),d=!0,h||(m=Y(r,"input",n[21]),h=!0)},p(g,_){(!d||_[0]&1073741824&&l!==(l=g[30]))&&p(e,"for",l),(!d||_[0]&1073741824&&a!==(a=g[30]))&&p(r,"id",a),_[0]&512&&r.value!==g[9]&&de(r,g[9])},i(g){d||(A(c.$$.fragment,g),d=!0)},o(g){L(c.$$.fragment,g),d=!1},d(g){g&&(k(e),k(o),k(r),k(u),k(f)),V(c),h=!1,m()}}}function nA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[10]),u||(f=Y(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&de(r,c[10])},d(c){c&&(k(e),k(o),k(r)),u=!1,f()}}}function iA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m=!n[5]&&qm(n),g=pe([0,1,2,3,4,5,6,7,8,9]),_=[];for(let C=0;C<10;C+=1)_[C]=jm(Rm(n,g,C));a=new ge({props:{class:"form-field required",name:"email",$$slots:{default:[xD,({uniqueId:C})=>({30:C}),({uniqueId:C})=>[C?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Hm(n),S=(n[5]||n[4])&&Vm(n);return{c(){e=v("form"),m&&m.c(),t=E(),i=v("div"),s=v("p"),s.textContent="Avatar",l=E(),o=v("div");for(let C=0;C<10;C+=1)_[C].c();r=E(),z(a.$$.fragment),u=E(),y&&y.c(),f=E(),S&&S.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(C,T){w(C,e,T),m&&m.m(e,null),b(e,t),b(e,i),b(i,s),b(i,l),b(i,o);for(let $=0;$<10;$+=1)_[$]&&_[$].m(o,null);b(e,r),H(a,e,null),b(e,u),y&&y.m(e,null),b(e,f),S&&S.m(e,null),c=!0,d||(h=Y(e,"submit",Ze(n[13])),d=!0)},p(C,T){if(C[5]?m&&(re(),L(m,1,1,()=>{m=null}),ae()):m?(m.p(C,T),T[0]&32&&A(m,1)):(m=qm(C),m.c(),A(m,1),m.m(e,t)),T[0]&4){g=pe([0,1,2,3,4,5,6,7,8,9]);let M;for(M=0;M<10;M+=1){const O=Rm(C,g,M);_[M]?_[M].p(O,T):(_[M]=jm(O),_[M].c(),_[M].m(o,null))}for(;M<10;M+=1)_[M].d(1)}const $={};T[0]&1073741832|T[1]&8&&($.$$scope={dirty:T,ctx:C}),a.$set($),C[5]?y&&(re(),L(y,1,1,()=>{y=null}),ae()):y?(y.p(C,T),T[0]&32&&A(y,1)):(y=Hm(C),y.c(),A(y,1),y.m(e,f)),C[5]||C[4]?S?(S.p(C,T),T[0]&48&&A(S,1)):(S=Vm(C),S.c(),A(S,1),S.m(e,null)):S&&(re(),L(S,1,1,()=>{S=null}),ae())},i(C){c||(A(m),A(a.$$.fragment,C),A(y),A(S),c=!0)},o(C){L(m),L(a.$$.fragment,C),L(y),L(S),c=!1},d(C){C&&k(e),m&&m.d(),vt(_,C),V(a),y&&y.d(),S&&S.d(),d=!1,h()}}}function sA(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=v("h4"),i=W(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l[0]&32&&t!==(t=s[5]?"New admin":"Edit admin")&&le(i,t)},d(s){s&&k(e)}}}function zm(n){let e,t,i,s,l,o,r,a,u;return o=new Pn({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[lA]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("span"),i=E(),s=v("i"),l=E(),z(o.$$.fragment),r=E(),a=v("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"aria-label","More"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),b(e,t),b(e,i),b(e,s),b(e,l),H(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){L(o.$$.fragment,f),u=!1},d(f){f&&(k(e),k(r),k(a)),V(o)}}}function lA(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Delete',p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function oA(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,h=!n[5]&&zm(n);return{c(){h&&h.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=W(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(m,g){h&&h.m(m,g),w(m,e,g),w(m,t,g),b(t,i),w(m,s,g),w(m,l,g),b(l,o),b(o,a),f=!0,c||(d=Y(t,"click",n[17]),c=!0)},p(m,g){m[5]?h&&(re(),L(h,1,1,()=>{h=null}),ae()):h?(h.p(m,g),g[0]&32&&A(h,1)):(h=zm(m),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||g[0]&128)&&(t.disabled=m[7]),(!f||g[0]&32)&&r!==(r=m[5]?"Create":"Save changes")&&le(a,r),(!f||g[0]&2176&&u!==(u=!m[11]||m[7]))&&(l.disabled=u),(!f||g[0]&128)&&Q(l,"btn-loading",m[7])},i(m){f||(A(h),f=!0)},o(m){L(h),f=!1},d(m){m&&(k(e),k(t),k(s),k(l)),h&&h.d(m),c=!1,d()}}}function rA(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[oA],header:[sA],default:[iA]},$$scope:{ctx:n}};return e=new rn({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function aA(n,e,t){let i,s;const l=pt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",h="",m="",g=!1;function _(X){return S(X),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),C()}function C(){t(4,g=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,h=""),t(10,m=""),on({})}function T(){if(u||!s)return;t(7,u=!0);const X={email:d,avatar:c};(i||g)&&(X.password=h,X.passwordConfirm=m);let J;i?J=ce.admins.create(X):J=ce.admins.update(a.id,X),J.then(async U=>{var oe;t(8,f=!1),y(),zt(i?"Successfully created admin.":"Successfully updated admin."),((oe=ce.authStore.model)==null?void 0:oe.id)===U.id&&ce.authStore.save(ce.authStore.token,U),l("save",U)}).catch(U=>{ce.error(U)}).finally(()=>{t(7,u=!1)})}function $(){a!=null&&a.id&&_n("Do you really want to delete the selected admin?",()=>ce.admins.delete(a.id).then(()=>{t(8,f=!1),y(),zt("Successfully deleted admin."),l("delete",a)}).catch(X=>{ce.error(X)}))}const M=()=>$(),O=()=>y(),D=X=>t(2,c=X);function I(){d=this.value,t(3,d)}function N(){g=this.checked,t(4,g)}function P(){h=this.value,t(9,h)}function F(){m=this.value,t(10,m)}const R=()=>s&&f?(_n("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function B(X){Re.call(this,n,X)}function Z(X){Re.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||g||d!==a.email||c!==a.avatar)},[y,a,c,d,g,i,r,u,f,h,m,s,o,T,$,_,M,O,D,I,N,P,F,R,q,B,Z]}class uA extends be{constructor(e){super(),_e(this,e,aA,rA,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Bm(n,e,t){const i=n.slice();return i[24]=e[t],i}function fA(n){let e;return{c(){e=v("div"),e.innerHTML=` id`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function cA(n){let e;return{c(){e=v("div"),e.innerHTML=` email`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function dA(n){let e;return{c(){e=v("div"),e.innerHTML=` created`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function pA(n){let e;return{c(){e=v("div"),e.innerHTML=` updated`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Um(n){let e;function t(l,o){return l[5]?mA:hA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function hA(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Wm(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No admins found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Wm(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function mA(n){let e;return{c(){e=v("tr"),e.innerHTML=' '},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Wm(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear filters',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Ym(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Km(n,e){let t,i,s,l,o,r,a,u,f,c,d,h=e[24].id+"",m,g,_,y,S,C=e[24].email+"",T,$,M,O,D,I,N,P,F,R,q,B,Z,X;f=new js({props:{value:e[24].id}});let J=e[24].id===e[7].id&&Ym();D=new $i({props:{date:e[24].created}}),P=new $i({props:{date:e[24].updated}});function U(){return e[15](e[24])}function oe(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),z(f.$$.fragment),c=E(),d=v("span"),m=W(h),g=E(),J&&J.c(),_=E(),y=v("td"),S=v("span"),T=W(C),M=E(),O=v("td"),z(D.$$.fragment),I=E(),N=v("td"),z(P.$$.fragment),F=E(),R=v("td"),R.innerHTML='',q=E(),fn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",$=e[24].email),p(y,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(N,"class","col-type-date col-field-updated"),p(R,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,se){w(ee,t,se),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),H(f,u,null),b(u,c),b(u,d),b(d,m),b(a,g),J&&J.m(a,null),b(t,_),b(t,y),b(y,S),b(S,T),b(t,M),b(t,O),H(D,O,null),b(t,I),b(t,N),H(P,N,null),b(t,F),b(t,R),b(t,q),B=!0,Z||(X=[Y(t,"click",U),Y(t,"keydown",oe)],Z=!0)},p(ee,se){e=ee,(!B||se&16&&!fn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Ee={};se&16&&(Ee.value=e[24].id),f.$set(Ee),(!B||se&16)&&h!==(h=e[24].id+"")&&le(m,h),e[24].id===e[7].id?J||(J=Ym(),J.c(),J.m(a,null)):J&&(J.d(1),J=null),(!B||se&16)&&C!==(C=e[24].email+"")&&le(T,C),(!B||se&16&&$!==($=e[24].email))&&p(S,"title",$);const qe={};se&16&&(qe.date=e[24].created),D.$set(qe);const Ve={};se&16&&(Ve.date=e[24].updated),P.$set(Ve)},i(ee){B||(A(f.$$.fragment,ee),A(D.$$.fragment,ee),A(P.$$.fragment,ee),B=!0)},o(ee){L(f.$$.fragment,ee),L(D.$$.fragment,ee),L(P.$$.fragment,ee),B=!1},d(ee){ee&&k(t),V(f),J&&J.d(),V(D),V(P),Z=!1,$e(X)}}}function gA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$=[],M=new Map,O;function D(U){n[11](U)}let I={class:"col-type-text",name:"id",$$slots:{default:[fA]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new hn({props:I}),te.push(()=>he(o,"sort",D));function N(U){n[12](U)}let P={class:"col-type-email col-field-email",name:"email",$$slots:{default:[cA]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),u=new hn({props:P}),te.push(()=>he(u,"sort",N));function F(U){n[13](U)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dA]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new hn({props:R}),te.push(()=>he(d,"sort",F));function q(U){n[14](U)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[pA]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),g=new hn({props:B}),te.push(()=>he(g,"sort",q));let Z=pe(n[4]);const X=U=>U[24].id;for(let U=0;Ur=!1)),o.$set(ee);const se={};oe&134217728&&(se.$$scope={dirty:oe,ctx:U}),!f&&oe&4&&(f=!0,se.sort=U[2],ve(()=>f=!1)),u.$set(se);const Ee={};oe&134217728&&(Ee.$$scope={dirty:oe,ctx:U}),!h&&oe&4&&(h=!0,Ee.sort=U[2],ve(()=>h=!1)),d.$set(Ee);const qe={};oe&134217728&&(qe.$$scope={dirty:oe,ctx:U}),!_&&oe&4&&(_=!0,qe.sort=U[2],ve(()=>_=!1)),g.$set(qe),oe&186&&(Z=pe(U[4]),re(),$=gt($,oe,X,1,U,Z,M,T,qt,Km,null,Bm),ae(),!Z.length&&J?J.p(U,oe):Z.length?J&&(J.d(1),J=null):(J=Um(U),J.c(),J.m(T,null))),(!O||oe&32)&&Q(e,"table-loading",U[5])},i(U){if(!O){A(o.$$.fragment,U),A(u.$$.fragment,U),A(d.$$.fragment,U),A(g.$$.fragment,U);for(let oe=0;oe New admin',m=E(),z(g.$$.fragment),_=E(),y=v("div"),S=E(),z(C.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(O,D){w(O,e,D),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),H(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),b(d,h),w(O,m,D),H(g,O,D),w(O,_,D),w(O,y,D),w(O,S,D),H(C,O,D),T=!0,$||(M=Y(h,"click",n[9]),$=!0)},p(O,D){(!T||D&64)&&le(o,O[6]);const I={};D&2&&(I.value=O[1]),g.$set(I);const N={};D&134217918&&(N.$$scope={dirty:D,ctx:O}),C.$set(N)},i(O){T||(A(a.$$.fragment,O),A(g.$$.fragment,O),A(C.$$.fragment,O),T=!0)},o(O){L(a.$$.fragment,O),L(g.$$.fragment,O),L(C.$$.fragment,O),T=!1},d(O){O&&(k(e),k(m),k(_),k(y),k(S)),V(a),V(g,O),V(C,O),$=!1,M()}}}function bA(n){let e,t,i=n[4].length+"",s;return{c(){e=v("div"),t=W("Total found: "),s=W(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(l,o){w(l,e,o),b(e,t),b(e,s)},p(l,o){o&16&&i!==(i=l[4].length+"")&&le(s,i)},d(l){l&&k(e)}}}function vA(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{footer:[bA],default:[_A]},$$scope:{ctx:n}}});let r={};return l=new uA({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[18](null),V(l,a)}}}function yA(n,e,t){let i,s,l;Ge(n,wa,P=>t(21,i=P)),Ge(n,Ft,P=>t(6,s=P)),Ge(n,Na,P=>t(7,l=P)),un(Ft,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const P=j.normalizeSearchFilter(f,["id","email","created","updated"]);return ce.admins.getFullList(100,{sort:c||"-created",filter:P}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),h(),ce.error(F,(F==null?void 0:F.status)!=400))})}function h(){t(4,a=[])}const m=()=>d(),g=()=>r==null?void 0:r.show(),_=P=>t(1,f=P.detail);function y(P){c=P,t(2,c)}function S(P){c=P,t(2,c)}function C(P){c=P,t(2,c)}function T(P){c=P,t(2,c)}const $=P=>r==null?void 0:r.show(P),M=(P,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(P))},O=()=>t(1,f="");function D(P){te[P?"unshift":"push"](()=>{r=P,t(3,r)})}const I=()=>d(),N=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const P=new URLSearchParams({filter:f,sort:c}).toString();us("/settings/admins?"+P),d()}},[d,f,c,r,a,u,s,l,m,g,_,y,S,C,T,$,M,O,D,I,N]}class kA extends be{constructor(e){super(),_e(this,e,yA,vA,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function wA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Email"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&de(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function SA(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=W("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[1]),w(d,r,h),w(d,a,h),b(a,u),f||(c=[Y(l,"input",n[5]),Ce(dn.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&de(l,d[1])},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),f=!1,$e(c)}}}function TA(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new ge({props:{class:"form-field required",name:"identity",$$slots:{default:[wA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field required",name:"password",$$slots:{default:[SA,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),t.innerHTML="

    Admin sign in

    ",i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),a=v("button"),a.innerHTML='Login ',p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),b(e,t),b(e,i),H(s,e,null),b(e,l),H(o,e,null),b(e,r),b(e,a),u=!0,f||(c=Y(e,"submit",Ze(n[3])),f=!0)},p(d,h){const m={};h&769&&(m.$$scope={dirty:h,ctx:d}),s.$set(m);const g={};h&770&&(g.$$scope={dirty:h,ctx:d}),o.$set(g),(!u||h&4)&&Q(a,"btn-disabled",d[2]),(!u||h&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function CA(n){let e,t;return e=new Nb({props:{$$slots:{default:[TA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $A(n,e,t){let i;Ge(n,wa,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ce.admins.authWithPassword(l,o).then(()=>{La(),us("/")}).catch(()=>{Ci("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class MA extends be{constructor(e){super(),_e(this,e,$A,CA,me,{})}}function OA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$;i=new ge({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[DA,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[AA,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new ge({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[IA,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new ge({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[LA,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Jm(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),d=v("div"),h=v("div"),m=E(),M&&M.c(),g=E(),_=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(h,"class","flex-fill"),p(y,"class","txt"),p(_,"type","submit"),p(_,"class","btn btn-expanded"),_.disabled=S=!n[3]||n[2],Q(_,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,D){w(O,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),H(a,e,null),b(e,u),H(f,e,null),b(e,c),b(e,d),b(d,h),b(d,m),M&&M.m(d,null),b(d,g),b(d,_),b(_,y),C=!0,T||($=Y(_,"click",n[13]),T=!0)},p(O,D){const I={};D&1572865&&(I.$$scope={dirty:D,ctx:O}),i.$set(I);const N={};D&1572865&&(N.$$scope={dirty:D,ctx:O}),o.$set(N);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:O}),a.$set(P);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:O}),f.$set(F),O[3]?M?M.p(O,D):(M=Jm(O),M.c(),M.m(d,g)):M&&(M.d(1),M=null),(!C||D&12&&S!==(S=!O[3]||O[2]))&&(_.disabled=S),(!C||D&4)&&Q(_,"btn-loading",O[2])},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),C=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),C=!1},d(O){O&&k(e),V(i),V(o),V(a),V(f),M&&M.d(),T=!1,$()}}}function EA(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function DA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&de(l,u[0].meta.appName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function AA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Application URL"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.appUrl),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&de(l,u[0].meta.appUrl)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function IA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Logs max days retention"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","number"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].logs.maxDays),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&yt(l.value)!==u[0].logs.maxDays&&de(l,u[0].logs.maxDays)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function LA(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Hide collection create and edit controls",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[19]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[19])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),Ce(Be.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&524288&&t!==(t=c[19])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&524288&&a!==(a=c[19])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function Jm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function PA(n){let e,t,i,s,l,o,r,a,u;const f=[EA,OA],c=[];function d(h,m){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=v("header"),e.innerHTML='',t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,m){w(h,e,m),w(h,t,m),w(h,i,m),b(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",Ze(n[4])),a=!0)},p(h,m){let g=l;l=d(h),l===g?c[l].p(h,m):(re(),L(c[g],1,1,()=>{c[g]=null}),ae(),o=c[l],o?o.p(h,m):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){L(o),r=!1},d(h){h&&(k(e),k(t),k(i)),c[l].d(),a=!1,u()}}}function NA(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function FA(n,e,t){let i,s,l,o;Ge(n,Es,M=>t(14,s=M)),Ge(n,To,M=>t(15,l=M)),Ge(n,Ft,M=>t(16,o=M)),un(Ft,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await ce.settings.getAll()||{};m(M)}catch(M){ce.error(M)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const M=await ce.settings.update(j.filterRedactedProps(a));m(M),zt("Successfully saved application settings.")}catch(M){ce.error(M)}t(2,f=!1)}}function m(M={}){var O,D;un(To,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),un(Es,s=!!((D=M==null?void 0:M.meta)!=null&&D.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.logs.maxDays=yt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>g(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,h,g,r,c,_,y,S,C,T,$]}class RA extends be{constructor(e){super(),_e(this,e,FA,NA,me,{})}}function qA(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),di(s,a)},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Ce(Be.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){di(s,a=_t(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(k(e),k(i),k(s)),l=!1,$e(o)}}}function HA(n){let e;function t(l,o){return l[3]?jA:qA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){l&&k(e),s.d(l)}}}function VA(n,e,t){const i=["value","mask"];let s=tt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ln(),r==null||r.focus()}const f=()=>u();function c(h){te[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),xt(h)),t(5,s=tt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class cu extends be{constructor(e){super(),_e(this,e,VA,HA,me,{value:0,mask:1})}}function zA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;return{c(){e=v("label"),t=W("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=W(`Available placeholder parameters: - `),f=v("button"),f.textContent="{APP_NAME} ",c=W(`, - `),d=v("button"),d.textContent="{APP_URL} ",h=W("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),w(_,l,y),de(l,n[0].subject),w(_,r,y),w(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),m||(g=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],m=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&p(e,"for",i),y[1]&1&&o!==(o=_[31])&&p(l,"id",o),y[0]&1&&l.value!==_[0].subject&&de(l,_[0].subject)},d(_){_&&(k(e),k(s),k(l),k(r),k(a)),m=!1,$e(g)}}}function BA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y;return{c(){e=v("label"),t=W("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=W(`Available placeholder parameters: - `),f=v("button"),f.textContent="{APP_NAME} ",c=W(`, - `),d=v("button"),d.textContent="{APP_URL} ",h=W(`, - `),m=v("button"),m.textContent="{TOKEN} ",g=W("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(m,"type","button"),p(m,"class","label label-sm link-primary txt-mono"),p(m,"title","Required parameter"),p(a,"class","help-block")},m(S,C){w(S,e,C),b(e,t),w(S,s,C),w(S,l,C),de(l,n[0].actionUrl),w(S,r,C),w(S,a,C),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,m),b(a,g),_||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(m,"click",n[19])],_=!0)},p(S,C){C[1]&1&&i!==(i=S[31])&&p(e,"for",i),C[1]&1&&o!==(o=S[31])&&p(l,"id",o),C[0]&1&&l.value!==S[0].actionUrl&&de(l,S[0].actionUrl)},d(S){S&&(k(e),k(s),k(l),k(r),k(a)),_=!1,$e(y)}}}function UA(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),de(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&de(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function WA(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Nt(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),s=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){re();const f=e;L(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Nt(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ve(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function YA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T;const $=[WA,UA],M=[];function O(D,I){return D[4]&&!D[5]?0:1}return l=O(n),o=M[l]=$[l](n),{c(){e=v("label"),t=W("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=W(`Available placeholder parameters: - `),f=v("button"),f.textContent="{APP_NAME} ",c=W(`, - `),d=v("button"),d.textContent="{APP_URL} ",h=W(`, - `),m=v("button"),m.textContent="{TOKEN} ",g=W(`, - `),_=v("button"),_.textContent="{ACTION_URL} ",y=W("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(m,"type","button"),p(m,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(D,I){w(D,e,I),b(e,t),w(D,s,I),M[l].m(D,I),w(D,r,I),w(D,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,m),b(a,g),b(a,_),b(a,y),S=!0,C||(T=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(m,"click",n[24]),Y(_,"click",n[25])],C=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let N=l;l=O(D),l===N?M[l].p(D,I):(re(),L(M[N],1,1,()=>{M[N]=null}),ae(),o=M[l],o?o.p(D,I):(o=M[l]=$[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&(k(e),k(s),k(r),k(a)),M[l].d(D),C=!1,$e(T)}}}function KA(n){let e,t,i,s,l,o;return e=new ge({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[zA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ge({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[BA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new ge({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[YA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,s,a),H(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(t),k(s)),V(e,r),V(i,r),V(l,r)}}}function Gm(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ce(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=He(e,Qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=He(e,Qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function JA(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Gm();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=W(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Gm(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),L(f,1,1,()=>{f=null}),ae())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function GA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[JA],default:[KA]},$$scope:{ctx:n}};for(let l=0;lt(12,o=U));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Zm,d=!1;function h(){f==null||f.expand()}function m(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await ft(()=>import("./CodeEditor-c648ece6.js"),["./CodeEditor-c648ece6.js","./index-30dee195.js"],import.meta.url)).default),Zm=c,t(5,d=!1))}function y(U){j.copyToClipboard(U),ko(`Copied ${U} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),T=()=>y("{APP_URL}");function $(){u.actionUrl=this.value,t(0,u)}const M=()=>y("{APP_NAME}"),O=()=>y("{APP_URL}"),D=()=>y("{TOKEN}");function I(U){n.$$.not_equal(u.body,U)&&(u.body=U,t(0,u))}function N(){u.body=this.value,t(0,u)}const P=()=>y("{APP_NAME}"),F=()=>y("{APP_URL}"),R=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function B(U){te[U?"unshift":"push"](()=>{f=U,t(3,f)})}function Z(U){Re.call(this,n,U)}function X(U){Re.call(this,n,U)}function J(U){Re.call(this,n,U)}return n.$$set=U=>{e=je(je({},e),xt(U)),t(8,l=tt(e,s)),"key"in U&&t(1,r=U.key),"title"in U&&t(2,a=U.title),"config"in U&&t(0,u=U.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||pi(r))},[u,r,a,f,c,d,i,y,l,h,m,g,o,S,C,T,$,M,O,D,I,N,P,F,R,q,B,Z,X,J]}class jr extends be{constructor(e){super(),_e(this,e,ZA,GA,me,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function Xm(n,e,t){const i=n.slice();return i[21]=e[t],i}function Qm(n,e){let t,i,s,l,o,r=e[21].label+"",a,u,f,c,d,h;return c=p0(e[11][0]),{key:n,first:null,c(){t=v("div"),i=v("input"),l=E(),o=v("label"),a=W(r),f=E(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",s=e[20]+e[21].value),i.__value=e[21].value,de(i,i.__value),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(m,g){w(m,t,g),b(t,i),i.checked=i.__value===e[2],b(t,l),b(t,o),b(o,a),b(t,f),d||(h=Y(i,"change",e[10]),d=!0)},p(m,g){e=m,g&1048576&&s!==(s=e[20]+e[21].value)&&p(i,"id",s),g&4&&(i.checked=i.__value===e[2]),g&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(m){m&&k(t),c.r(),d=!1,h()}}}function XA(n){let e=[],t=new Map,i,s=pe(n[7]);const l=o=>o[21].value;for(let o=0;o({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),s=new ge({props:{class:"form-field required m-0",name:"email",$$slots:{default:[QA,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),z(t.$$.fragment),i=E(),z(s.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),H(t,e,null),b(e,i),H(s,e,null),l=!0,o||(r=Y(e,"submit",Ze(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),s.$set(c)},i(a){l||(A(t.$$.fragment,a),A(s.$$.fragment,a),l=!0)},o(a){L(t.$$.fragment,a),L(s.$$.fragment,a),l=!1},d(a){a&&k(e),V(t),V(s),o=!1,r()}}}function e8(n){let e;return{c(){e=v("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function t8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=W("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","ri-mail-send-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(s.disabled=a),d&16&&Q(s,"btn-loading",c[4])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function n8(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[t8],header:[e8],default:[xA]},$$scope:{ctx:n}};return e=new rn({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[14]),l&16777270&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[15](null),V(e,s)}}}const Hr="last_email_test",xm="email_test_request";function i8(n,e,t){let i;const s=pt(),l="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(Hr),u=o[0].value,f=!1,c=null;function d(O="",D=""){t(1,a=O||localStorage.getItem(Hr)),t(2,u=D||o[0].value),on({}),r==null||r.show()}function h(){return clearTimeout(c),r==null?void 0:r.hide()}async function m(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(Hr,a),clearTimeout(c),c=setTimeout(()=>{ce.cancelRequest(xm),Ci("Test email send timeout.")},3e4);try{await ce.settings.testEmail(a,u,{$cancelKey:xm}),zt("Successfully sent test email."),s("submit"),t(4,f=!1),await ln(),h()}catch(O){t(4,f=!1),ce.error(O)}clearTimeout(c)}}const g=[[]];function _(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const S=()=>m(),C=()=>!f;function T(O){te[O?"unshift":"push"](()=>{r=O,t(3,r)})}function $(O){Re.call(this,n,O)}function M(O){Re.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[h,a,u,r,f,i,l,o,m,d,_,g,y,S,C,T,$,M]}class s8 extends be{constructor(e){super(),_e(this,e,i8,n8,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function l8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O,D,I,N;i=new ge({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[r8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[a8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});function P(ee){n[15](ee)}let F={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(F.config=n[0].meta.verificationTemplate),u=new jr({props:F}),te.push(()=>he(u,"config",P));function R(ee){n[16](ee)}let q={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(q.config=n[0].meta.resetPasswordTemplate),d=new jr({props:q}),te.push(()=>he(d,"config",R));function B(ee){n[17](ee)}let Z={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(Z.config=n[0].meta.confirmEmailChangeTemplate),g=new jr({props:Z}),te.push(()=>he(g,"config",B)),T=new ge({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[u8,({uniqueId:ee})=>({34:ee}),({uniqueId:ee})=>[0,ee?8:0]]},$$scope:{ctx:n}}});let X=n[0].smtp.enabled&&eg(n);function J(ee,se){return ee[5]?y8:v8}let U=J(n),oe=U(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),c=E(),z(d.$$.fragment),m=E(),z(g.$$.fragment),y=E(),S=v("hr"),C=E(),z(T.$$.fragment),$=E(),X&&X.c(),M=E(),O=v("div"),D=v("div"),I=E(),oe.c(),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(D,"class","flex-fill"),p(O,"class","flex")},m(ee,se){w(ee,e,se),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),w(ee,r,se),w(ee,a,se),H(u,a,null),b(a,c),H(d,a,null),b(a,m),H(g,a,null),w(ee,y,se),w(ee,S,se),w(ee,C,se),H(T,ee,se),w(ee,$,se),X&&X.m(ee,se),w(ee,M,se),w(ee,O,se),b(O,D),b(O,I),oe.m(O,null),N=!0},p(ee,se){const Ee={};se[0]&1|se[1]&24&&(Ee.$$scope={dirty:se,ctx:ee}),i.$set(Ee);const qe={};se[0]&1|se[1]&24&&(qe.$$scope={dirty:se,ctx:ee}),o.$set(qe);const Ve={};!f&&se[0]&1&&(f=!0,Ve.config=ee[0].meta.verificationTemplate,ve(()=>f=!1)),u.$set(Ve);const We={};!h&&se[0]&1&&(h=!0,We.config=ee[0].meta.resetPasswordTemplate,ve(()=>h=!1)),d.$set(We);const ke={};!_&&se[0]&1&&(_=!0,ke.config=ee[0].meta.confirmEmailChangeTemplate,ve(()=>_=!1)),g.$set(ke);const Me={};se[0]&1|se[1]&24&&(Me.$$scope={dirty:se,ctx:ee}),T.$set(Me),ee[0].smtp.enabled?X?(X.p(ee,se),se[0]&1&&A(X,1)):(X=eg(ee),X.c(),A(X,1),X.m(M.parentNode,M)):X&&(re(),L(X,1,1,()=>{X=null}),ae()),U===(U=J(ee))&&oe?oe.p(ee,se):(oe.d(1),oe=U(ee),oe&&(oe.c(),oe.m(O,null)))},i(ee){N||(A(i.$$.fragment,ee),A(o.$$.fragment,ee),A(u.$$.fragment,ee),A(d.$$.fragment,ee),A(g.$$.fragment,ee),A(T.$$.fragment,ee),A(X),N=!0)},o(ee){L(i.$$.fragment,ee),L(o.$$.fragment,ee),L(u.$$.fragment,ee),L(d.$$.fragment,ee),L(g.$$.fragment,ee),L(T.$$.fragment,ee),L(X),N=!1},d(ee){ee&&(k(e),k(r),k(a),k(y),k(S),k(C),k($),k(M),k(O)),V(i),V(o),V(u),V(d),V(g),V(T,ee),X&&X.d(ee),oe.d()}}}function o8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function r8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Sender name"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.senderName),r||(a=Y(l,"input",n[13]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderName&&de(l,u[0].meta.senderName)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function a8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Sender address"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","email"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].meta.senderAddress),r||(a=Y(l,"input",n[14]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].meta.senderAddress&&de(l,u[0].meta.senderAddress)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function u8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.innerHTML="Use SMTP mail server (recommended)",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[18]),Ce(Be.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function eg(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T;s=new ge({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[f8,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[c8,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),f=new ge({props:{class:"form-field",name:"smtp.username",$$slots:{default:[d8,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}}),h=new ge({props:{class:"form-field",name:"smtp.password",$$slots:{default:[p8,({uniqueId:I})=>({34:I}),({uniqueId:I})=>[0,I?8:0]]},$$scope:{ctx:n}}});function $(I,N){return I[4]?m8:h8}let M=$(n),O=M(n),D=n[4]&&tg(n);return{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),m=E(),g=v("button"),O.c(),_=E(),D&&D.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(I,N){w(I,e,N),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),b(t,a),b(t,u),H(f,u,null),b(t,c),b(t,d),H(h,d,null),b(e,m),b(e,g),O.m(g,null),b(e,_),D&&D.m(e,null),S=!0,C||(T=Y(g,"click",Ze(n[23])),C=!0)},p(I,N){const P={};N[0]&1|N[1]&24&&(P.$$scope={dirty:N,ctx:I}),s.$set(P);const F={};N[0]&1|N[1]&24&&(F.$$scope={dirty:N,ctx:I}),r.$set(F);const R={};N[0]&1|N[1]&24&&(R.$$scope={dirty:N,ctx:I}),f.$set(R);const q={};N[0]&1|N[1]&24&&(q.$$scope={dirty:N,ctx:I}),h.$set(q),M!==(M=$(I))&&(O.d(1),O=M(I),O&&(O.c(),O.m(g,null))),I[4]?D?(D.p(I,N),N[0]&16&&A(D,1)):(D=tg(I),D.c(),A(D,1),D.m(e,null)):D&&(re(),L(D,1,1,()=>{D=null}),ae())},i(I){S||(A(s.$$.fragment,I),A(r.$$.fragment,I),A(f.$$.fragment,I),A(h.$$.fragment,I),A(D),I&&xe(()=>{S&&(y||(y=He(e,lt,{duration:150},!0)),y.run(1))}),S=!0)},o(I){L(s.$$.fragment,I),L(r.$$.fragment,I),L(f.$$.fragment,I),L(h.$$.fragment,I),L(D),I&&(y||(y=He(e,lt,{duration:150},!1)),y.run(0)),S=!1},d(I){I&&k(e),V(s),V(r),V(f),V(h),O.d(),D&&D.d(),I&&y&&y.end(),C=!1,T()}}}function f8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("SMTP server host"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].smtp.host),r||(a=Y(l,"input",n[19]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.host&&de(l,u[0].smtp.host)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function c8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Port"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","number"),p(l,"id",o=n[34]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].smtp.port),r||(a=Y(l,"input",n[20]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&yt(l.value)!==u[0].smtp.port&&de(l,u[0].smtp.port)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function d8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Username"),s=E(),l=v("input"),p(e,"for",i=n[34]),p(l,"type","text"),p(l,"id",o=n[34])},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].smtp.username),r||(a=Y(l,"input",n[21]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(l,"id",o),f[0]&1&&l.value!==u[0].smtp.username&&de(l,u[0].smtp.username)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function p8(n){let e,t,i,s,l,o,r;function a(f){n[22](f)}let u={id:n[34]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new cu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=W("Password"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function h8(n){let e,t,i;return{c(){e=v("span"),e.textContent="Show more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function m8(n){let e,t,i;return{c(){e=v("span"),e.textContent="Hide more options",t=E(),i=v("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function tg(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new ge({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[g8,({uniqueId:m})=>({34:m}),({uniqueId:m})=>[0,m?8:0]]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[_8,({uniqueId:m})=>({34:m}),({uniqueId:m})=>[0,m?8:0]]},$$scope:{ctx:n}}}),u=new ge({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[b8,({uniqueId:m})=>({34:m}),({uniqueId:m})=>[0,m?8:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),p(t,"class","col-lg-3"),p(l,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(m,g){w(m,e,g),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),h=!0},p(m,g){const _={};g[0]&1|g[1]&24&&(_.$$scope={dirty:g,ctx:m}),i.$set(_);const y={};g[0]&1|g[1]&24&&(y.$$scope={dirty:g,ctx:m}),o.$set(y);const S={};g[0]&1|g[1]&24&&(S.$$scope={dirty:g,ctx:m}),u.$set(S)},i(m){h||(A(i.$$.fragment,m),A(o.$$.fragment,m),A(u.$$.fragment,m),m&&xe(()=>{h&&(d||(d=He(e,lt,{duration:150},!0)),d.run(1))}),h=!0)},o(m){L(i.$$.fragment,m),L(o.$$.fragment,m),L(u.$$.fragment,m),m&&(d||(d=He(e,lt,{duration:150},!1)),d.run(0)),h=!1},d(m){m&&k(e),V(i),V(o),V(u),m&&d&&d.end()}}}function g8(n){let e,t,i,s,l,o,r;function a(f){n[24](f)}let u={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new Ei({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=W("TLS encryption"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function _8(n){let e,t,i,s,l,o,r;function a(f){n[25](f)}let u={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),l=new Ei({props:u}),te.push(()=>he(l,"keyOfSelected",a)),{c(){e=v("label"),t=W("AUTH method"),s=E(),z(l.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function b8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("span"),t.textContent="EHLO/HELO domain",i=E(),s=v("i"),o=E(),r=v("input"),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),de(r,n[0].smtp.localName),u||(f=[Ce(Be.call(null,s,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),Y(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&l!==(l=c[34])&&p(e,"for",l),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&de(r,c[0].smtp.localName)},d(c){c&&(k(e),k(o),k(r)),u=!1,$e(f)}}}function v8(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=' Send test email',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[29]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function y8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[3],Q(s,"btn-loading",n[3])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"click",n[27]),Y(s,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&(k(e),k(i),k(s)),r=!1,$e(a)}}}function k8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_;const y=[o8,l8],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[6]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Configure common settings for sending emails.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),m=!0,g||(_=Y(u,"submit",Ze(n[30])),g=!0)},p(T,$){(!m||$[0]&64)&&le(o,T[6]);let M=d;d=C(T),d===M?S[d].p(T,$):(re(),L(S[M],1,1,()=>{S[M]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){m||(A(h),m=!0)},o(T){L(h),m=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function w8(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{default:[k8]},$$scope:{ctx:n}}});let r={};return l=new s8({props:r}),n[31](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&127|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[31](null),V(l,a)}}}function S8(n,e,t){let i,s,l;Ge(n,Ft,ee=>t(6,l=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];un(Ft,l="Mail settings",l);let a,u={},f={},c=!1,d=!1,h=!1;m();async function m(){t(2,c=!0);try{const ee=await ce.settings.getAll()||{};_(ee)}catch(ee){ce.error(ee)}t(2,c=!1)}async function g(){if(!(d||!s)){t(3,d=!0);try{const ee=await ce.settings.update(j.filterRedactedProps(f));_(ee),on({}),zt("Successfully saved mail settings.")}catch(ee){ce.error(ee)}t(3,d=!1)}}function _(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(11,u=JSON.parse(JSON.stringify(f)))}function y(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function C(){f.meta.senderAddress=this.value,t(0,f)}function T(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function $(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function M(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function O(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function I(){f.smtp.port=yt(this.value),t(0,f)}function N(){f.smtp.username=this.value,t(0,f)}function P(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const F=()=>{t(4,h=!h)};function R(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function q(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function B(){f.smtp.localName=this.value,t(0,f)}const Z=()=>y(),X=()=>g(),J=()=>a==null?void 0:a.show(),U=()=>g();function oe(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(u)),n.$$.dirty[0]&4097&&t(5,s=i!=JSON.stringify(f))},[f,a,c,d,h,s,l,o,r,g,y,u,i,S,C,T,$,M,O,D,I,N,P,F,R,q,B,Z,X,J,U,oe]}class T8 extends be{constructor(e){super(),_e(this,e,S8,w8,me,{},null,[-1,-1])}}const C8=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),ng=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function $8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&le(l,u[4]),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function ig(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M;return i=new ge({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[M8,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),o=new ge({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[O8,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),u=new ge({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[E8,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),d=new ge({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[D8,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),g=new ge({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[A8,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),S=new ge({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[I8,({uniqueId:O})=>({20:O}),({uniqueId:O})=>O?1048576:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),r=E(),a=v("div"),z(u.$$.fragment),f=E(),c=v("div"),z(d.$$.fragment),h=E(),m=v("div"),z(g.$$.fragment),_=E(),y=v("div"),z(S.$$.fragment),C=E(),T=v("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(m,"class","col-lg-6"),p(y,"class","col-lg-12"),p(T,"class","col-lg-12"),p(e,"class","grid")},m(O,D){w(O,e,D),b(e,t),H(i,t,null),b(e,s),b(e,l),H(o,l,null),b(e,r),b(e,a),H(u,a,null),b(e,f),b(e,c),H(d,c,null),b(e,h),b(e,m),H(g,m,null),b(e,_),b(e,y),H(S,y,null),b(e,C),b(e,T),M=!0},p(O,D){const I={};D&8&&(I.name=O[3]+".endpoint"),D&1081345&&(I.$$scope={dirty:D,ctx:O}),i.$set(I);const N={};D&8&&(N.name=O[3]+".bucket"),D&1081345&&(N.$$scope={dirty:D,ctx:O}),o.$set(N);const P={};D&8&&(P.name=O[3]+".region"),D&1081345&&(P.$$scope={dirty:D,ctx:O}),u.$set(P);const F={};D&8&&(F.name=O[3]+".accessKey"),D&1081345&&(F.$$scope={dirty:D,ctx:O}),d.$set(F);const R={};D&8&&(R.name=O[3]+".secret"),D&1081345&&(R.$$scope={dirty:D,ctx:O}),g.$set(R);const q={};D&8&&(q.name=O[3]+".forcePathStyle"),D&1081345&&(q.$$scope={dirty:D,ctx:O}),S.$set(q)},i(O){M||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(g.$$.fragment,O),A(S.$$.fragment,O),O&&xe(()=>{M&&($||($=He(e,lt,{duration:150},!0)),$.run(1))}),M=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(u.$$.fragment,O),L(d.$$.fragment,O),L(g.$$.fragment,O),L(S.$$.fragment,O),O&&($||($=He(e,lt,{duration:150},!1)),$.run(0)),M=!1},d(O){O&&k(e),V(i),V(o),V(u),V(d),V(g),V(S),O&&$&&$.end()}}}function M8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Endpoint"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].endpoint),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&de(l,u[0].endpoint)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function O8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Bucket"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].bucket),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&de(l,u[0].bucket)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function E8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Region"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].region),r||(a=Y(l,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].region&&de(l,u[0].region)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function D8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Access key"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[0].accessKey),r||(a=Y(l,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(l,"id",o),f&1&&l.value!==u[0].accessKey&&de(l,u[0].accessKey)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function A8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new cu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=W("Secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function I8(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Force path-style addressing",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[14]),Ce(Be.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function L8(n){let e,t,i,s,l;e=new ge({props:{class:"form-field form-field-toggle",$$slots:{default:[$8,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=Tt(o,n,n[15],ng);let a=n[0].enabled&&ig(n);return{c(){z(e.$$.fragment),t=E(),r&&r.c(),i=E(),a&&a.c(),s=ye()},m(u,f){H(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,s,f),l=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!l||f&32775)&&$t(r,o,u,u[15],l?Ct(o,u[15],f,C8):Mt(u[15]),ng),u[0].enabled?a?(a.p(u,f),f&1&&A(a,1)):(a=ig(u),a.c(),A(a,1),a.m(s.parentNode,s)):a&&(re(),L(a,1,1,()=>{a=null}),ae())},i(u){l||(A(e.$$.fragment,u),A(r,u),A(a),l=!0)},o(u){L(e.$$.fragment,u),L(r,u),L(a),l=!1},d(u){u&&(k(t),k(i),k(s)),V(e,u),r&&r.d(u),a&&a.d(u)}}}const Vr="s3_test_request";function P8(n,e,t){let{$$slots:i={},$$scope:s}=e,{originalConfig:l={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,h=null;function m(O){t(2,c=!0),clearTimeout(h),h=setTimeout(()=>{g()},O)}async function g(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;ce.cancelRequest(Vr),clearTimeout(d),d=setTimeout(()=>{ce.cancelRequest(Vr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let O;try{await ce.settings.testS3(u,{$cancelKey:Vr})}catch(D){O=D}return O!=null&&O.isAbort||(t(1,f=O),t(2,c=!1),clearTimeout(d)),f}Kt(()=>()=>{clearTimeout(d),clearTimeout(h)});function _(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function C(){o.region=this.value,t(0,o)}function T(){o.accessKey=this.value,t(0,o)}function $(O){n.$$.not_equal(o.secret,O)&&(o.secret=O,t(0,o))}function M(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=O=>{"originalConfig"in O&&t(5,l=O.originalConfig),"config"in O&&t(0,o=O.config),"configKey"in O&&t(3,r=O.configKey),"toggleLabel"in O&&t(4,a=O.toggleLabel),"testFilesystem"in O&&t(6,u=O.testFilesystem),"testError"in O&&t(1,f=O.testError),"isTesting"in O&&t(2,c=O.isTesting),"$$scope"in O&&t(15,s=O.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&l!=null&&l.enabled&&m(100),n.$$.dirty&9&&(o.enabled||pi(r))},[o,f,c,r,a,l,u,i,_,y,S,C,T,$,M,s]}class K1 extends be{constructor(e){super(),_e(this,e,P8,L8,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function N8(n){var O;let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_;function y(D){n[11](D)}function S(D){n[12](D)}function C(D){n[13](D)}let T={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[R8]},$$scope:{ctx:n}};n[1].s3!==void 0&&(T.config=n[1].s3),n[4]!==void 0&&(T.isTesting=n[4]),n[5]!==void 0&&(T.testError=n[5]),e=new K1({props:T}),te.push(()=>he(e,"config",y)),te.push(()=>he(e,"isTesting",S)),te.push(()=>he(e,"testError",C));let $=((O=n[1].s3)==null?void 0:O.enabled)&&!n[6]&&!n[3]&&lg(n),M=n[6]&&og(n);return{c(){z(e.$$.fragment),l=E(),o=v("div"),r=v("div"),a=E(),$&&$.c(),u=E(),M&&M.c(),f=E(),c=v("button"),d=v("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=h=!n[6]||n[3],Q(c,"btn-loading",n[3]),p(o,"class","flex")},m(D,I){H(e,D,I),w(D,l,I),w(D,o,I),b(o,r),b(o,a),$&&$.m(o,null),b(o,u),M&&M.m(o,null),b(o,f),b(o,c),b(c,d),m=!0,g||(_=Y(c,"click",n[15]),g=!0)},p(D,I){var P;const N={};I&1&&(N.originalConfig=D[0].s3),I&524291&&(N.$$scope={dirty:I,ctx:D}),!t&&I&2&&(t=!0,N.config=D[1].s3,ve(()=>t=!1)),!i&&I&16&&(i=!0,N.isTesting=D[4],ve(()=>i=!1)),!s&&I&32&&(s=!0,N.testError=D[5],ve(()=>s=!1)),e.$set(N),(P=D[1].s3)!=null&&P.enabled&&!D[6]&&!D[3]?$?$.p(D,I):($=lg(D),$.c(),$.m(o,u)):$&&($.d(1),$=null),D[6]?M?M.p(D,I):(M=og(D),M.c(),M.m(o,f)):M&&(M.d(1),M=null),(!m||I&72&&h!==(h=!D[6]||D[3]))&&(c.disabled=h),(!m||I&8)&&Q(c,"btn-loading",D[3])},i(D){m||(A(e.$$.fragment,D),m=!0)},o(D){L(e.$$.fragment,D),m=!1},d(D){D&&(k(l),k(o)),V(e,D),$&&$.d(),M&&M.d(),g=!1,_()}}}function F8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function sg(n){var I;let e,t,i,s,l,o,r,a=(I=n[0].s3)!=null&&I.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,m,g,_,y,S,C,T,$,M,O,D;return{c(){e=v("div"),t=v("div"),i=v("div"),i.innerHTML='',s=E(),l=v("div"),o=W(`If you have existing uploaded files, you'll have to migrate them manually - from the - `),r=v("strong"),u=W(a),f=W(` - to the - `),c=v("strong"),h=W(d),m=W(`. - `),g=v("br"),_=W(` - There are numerous command line tools that can help you, such as: - `),y=v("a"),y.textContent=`rclone - `,S=W(`, - `),C=v("a"),C.textContent=`s5cmd - `,T=W(", etc."),$=E(),M=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(N,P){w(N,e,P),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,h),b(l,m),b(l,g),b(l,_),b(l,y),b(l,S),b(l,C),b(l,T),b(e,$),b(e,M),D=!0},p(N,P){var F;(!D||P&1)&&a!==(a=(F=N[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!D||P&2)&&d!==(d=N[1].s3.enabled?"S3 storage":"local file system")&&le(h,d)},i(N){D||(N&&xe(()=>{D&&(O||(O=He(e,lt,{duration:150},!0)),O.run(1))}),D=!0)},o(N){N&&(O||(O=He(e,lt,{duration:150},!1)),O.run(0)),D=!1},d(N){N&&k(e),N&&O&&O.end()}}}function R8(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&sg(n);return{c(){t&&t.c(),e=ye()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=sg(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),L(t,1,1,()=>{t=null}),ae())},d(s){s&&k(e),t&&t.d(s)}}}function lg(n){let e;function t(l,o){return l[4]?H8:l[5]?j8:q8}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function q8(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function j8(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Ce(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function H8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function og(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function V8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_;const y=[F8,N8],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[7]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    By default PocketBase uses the local file system to store uploaded files.

    If you have limited disk space, you could optionally connect to an S3 compatible storage.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),m=!0,g||(_=Y(u,"submit",Ze(n[16])),g=!0)},p(T,$){(!m||$&128)&&le(o,T[7]);let M=d;d=C(T),d===M?S[d].p(T,$):(re(),L(S[M],1,1,()=>{S[M]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){m||(A(h),m=!0)},o(T){L(h),m=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function z8(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[V8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}const B8="s3_test_request";function U8(n,e,t){let i,s,l;Ge(n,Ft,M=>t(7,l=M)),un(Ft,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await ce.settings.getAll()||{};m(M)}catch(M){ce.error(M)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{ce.cancelRequest(B8);const M=await ce.settings.update(j.filterRedactedProps(r));on({}),await m(M),La(),c?Qy("Successfully saved but failed to establish S3 connection."):zt("Successfully saved files storage settings.")}catch(M){ce.error(M)}t(3,u=!1)}}async function m(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function _(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function y(M){f=M,t(4,f)}function S(M){c=M,t(5,c)}const C=()=>g(),T=()=>h(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,g,i,_,y,S,C,T,$]}class W8 extends be{constructor(e){super(),_e(this,e,U8,z8,me,{})}}function Y8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function K8(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=W("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),de(l,n[1].clientId),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&de(l,f[1].clientId)},d(f){f&&(k(e),k(s),k(l)),a=!1,u()}}}function J8(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new cu({props:u}),te.push(()=>he(l,"value",a)),{c(){e=v("label"),t=W("Client secret"),s=E(),z(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),H(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,ve(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&(k(e),k(s)),V(l,f)}}}function rg(n){let e,t,i,s;const l=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(u){n[14](u)}var r=n[3].optionsComponent;function a(u,f){let c={};if(f!==void 0&&f&8)c=_t(l,[{key:u[3].key},Dt(u[3].optionsComponentProps||{})]);else for(let d=0;dhe(t,"config",o))),{c(){e=v("div"),t&&z(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&H(t,e,null),s=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){re();const c=t;L(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(t=Nt(r,a(u,f)),te.push(()=>he(t,"config",o)),z(t.$$.fragment),A(t.$$.fragment,1),H(t,e,null)):t=null}else if(r){const c=f&8?_t(l,[{key:u[3].key},Dt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],ve(()=>i=!1)),t.$set(c)}},i(u){s||(t&&A(t.$$.fragment,u),s=!0)},o(u){t&&L(t.$$.fragment,u),s=!1},d(u){u&&k(e),t&&V(t)}}}function G8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new ge({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[Y8,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[K8,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}}),u=new ge({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[J8,({uniqueId:g})=>({20:g}),({uniqueId:g})=>g?1048576:0]},$$scope:{ctx:n}}});let m=n[3].optionsComponent&&rg(n);return{c(){e=v("form"),t=v("div"),z(i.$$.fragment),s=E(),l=v("button"),l.innerHTML='Clear all fields',o=E(),z(r.$$.fragment),a=E(),z(u.$$.fragment),f=E(),m&&m.c(),p(l,"type","button"),p(l,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(g,_){w(g,e,_),b(e,t),H(i,t,null),b(t,s),b(t,l),b(e,o),H(r,e,null),b(e,a),H(u,e,null),b(e,f),m&&m.m(e,null),c=!0,d||(h=[Y(l,"click",n[8]),Y(e,"submit",Ze(n[15]))],d=!0)},p(g,_){const y={};_&8&&(y.name=g[3].key+".enabled"),_&3145730&&(y.$$scope={dirty:_,ctx:g}),i.$set(y);const S={};_&2&&(S.class="form-field "+(g[1].enabled?"required":"")),_&8&&(S.name=g[3].key+".clientId"),_&3145730&&(S.$$scope={dirty:_,ctx:g}),r.$set(S);const C={};_&2&&(C.class="form-field "+(g[1].enabled?"required":"")),_&8&&(C.name=g[3].key+".clientSecret"),_&3145730&&(C.$$scope={dirty:_,ctx:g}),u.$set(C),g[3].optionsComponent?m?(m.p(g,_),_&8&&A(m,1)):(m=rg(g),m.c(),A(m,1),m.m(e,null)):m&&(re(),L(m,1,1,()=>{m=null}),ae())},i(g){c||(A(i.$$.fragment,g),A(r.$$.fragment,g),A(u.$$.fragment,g),A(m),c=!0)},o(g){L(i.$$.fragment,g),L(r.$$.fragment,g),L(u.$$.fragment,g),L(m),c=!1},d(g){g&&k(e),V(i),V(r),V(u),m&&m.d(),d=!1,$e(h)}}}function Z8(n){let e,t=(n[3].title||n[3].key)+"",i,s;return{c(){e=v("h4"),i=W(t),s=W(" provider"),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,i),b(e,s)},p(l,o){o&8&&t!==(t=(l[3].title||l[3].key)+"")&&le(i,t)},d(l){l&&k(e)}}}function X8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=W("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Q8(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[X8],header:[Z8],default:[G8]},$$scope:{ctx:n}};return e=new rn({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&2097210&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[16](null),V(e,s)}}}function x8(n,e,t){let i;const s=pt(),l="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(O,D){on({}),t(3,r=Object.assign({},O)),t(1,a=Object.assign({enabled:!0},D)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function h(){t(4,u=!0);try{const O={};O[r.key]=j.filterRedactedProps(a);const D=await ce.settings.update(O);on({}),zt("Successfully updated provider settings."),s("submit",D),d()}catch(O){ce.error(O)}t(4,u=!1)}function m(){for(let O in a)t(1,a[O]="",a);t(1,a.enabled=!1,a)}function g(){a.enabled=this.checked,t(1,a)}function _(){a.clientId=this.value,t(1,a)}function y(O){n.$$.not_equal(a.clientSecret,O)&&(a.clientSecret=O,t(1,a))}function S(O){a=O,t(1,a)}const C=()=>h();function T(O){te[O?"unshift":"push"](()=>{o=O,t(2,o)})}function $(O){Re.call(this,n,O)}function M(O){Re.call(this,n,O)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,l,h,m,c,f,g,_,y,S,C,T,$,M]}class eI extends be{constructor(e){super(),_e(this,e,x8,Q8,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function ag(n){let e,t,i;return{c(){e=v("img"),fn(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(s,l){w(s,e,l)},p(s,l){l&2&&!fn(e.src,t="./images/oauth2/"+s[1].logo)&&p(e,"src",t),l&2&&i!==(i=s[1].title+" logo")&&p(e,"alt",i)},d(s){s&&k(e)}}}function ug(n){let e;return{c(){e=v("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function tI(n){let e,t,i,s,l=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,h,m,g,_,y,S,C,T,$=n[1].logo&&ag(n),M=n[0].enabled&&ug(),O={};return y=new eI({props:O}),n[4](y),y.$on("submit",n[5]),{c(){e=v("div"),t=v("figure"),$&&$.c(),i=E(),s=v("div"),o=W(l),r=E(),a=v("em"),u=W("("),c=W(f),d=W(")"),h=E(),M&&M.c(),m=E(),g=v("button"),g.innerHTML='',_=E(),z(y.$$.fragment),p(t,"class","provider-logo"),p(s,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(g,"type","button"),p(g,"class","btn btn-circle btn-hint btn-transparent"),p(g,"aria-label","Provider settings"),p(e,"class","provider-card")},m(D,I){w(D,e,I),b(e,t),$&&$.m(t,null),b(e,i),b(e,s),b(s,o),b(e,r),b(e,a),b(a,u),b(a,c),b(a,d),b(e,h),M&&M.m(e,null),b(e,m),b(e,g),w(D,_,I),H(y,D,I),S=!0,C||(T=Y(g,"click",n[3]),C=!0)},p(D,[I]){D[1].logo?$?$.p(D,I):($=ag(D),$.c(),$.m(t,null)):$&&($.d(1),$=null),(!S||I&2)&&l!==(l=D[1].title+"")&&le(o,l),(!S||I&2)&&f!==(f=D[1].key.slice(0,-4)+"")&&le(c,f),D[0].enabled?M||(M=ug(),M.c(),M.m(e,m)):M&&(M.d(1),M=null);const N={};y.$set(N)},i(D){S||(A(y.$$.fragment,D),S=!0)},o(D){L(y.$$.fragment,D),S=!1},d(D){D&&(k(e),k(_)),$&&$.d(),M&&M.d(),n[4](null),V(y,D),C=!1,T()}}}function nI(n,e,t){let{provider:i={}}=e,{config:s={}}=e,l;const o=()=>{l==null||l.show(i,Object.assign({},s,{enabled:s.clientId?s.enabled:!0}))};function r(u){te[u?"unshift":"push"](()=>{l=u,t(2,l)})}const a=u=>{u.detail[i.key]&&t(0,s=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,s=u.config)},[s,i,l,o,r,a]}class J1 extends be{constructor(e){super(),_e(this,e,nI,tI,me,{provider:1,config:0})}}function fg(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function cg(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function iI(n){let e,t=[],i=new Map,s,l,o,r=[],a=new Map,u,f=pe(n[3]);const c=g=>g[9].key;for(let g=0;g0&&n[2].length>0&&pg(),h=pe(n[2]);const m=g=>g[9].key;for(let g=0;g0&&g[2].length>0?d||(d=pg(),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),_&5&&(h=pe(g[2]),re(),r=gt(r,_,m,1,g,h,a,o,qt,hg,null,fg),ae())},i(g){if(!u){for(let _=0;_he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!s&&f&9&&(s=!0,c.config=e[0][e[9].key],ve(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function pg(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hg(n,e){let t,i,s,l,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new J1({props:a}),te.push(()=>he(i,"config",r)),{key:n,first:null,c(){t=v("div"),z(i.$$.fragment),l=E(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),b(t,l),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!s&&f&5&&(s=!0,c.config=e[0][e[9].key],ve(()=>s=!1)),i.$set(c)},i(u){o||(A(i.$$.fragment,u),o=!0)},o(u){L(i.$$.fragment,u),o=!1},d(u){u&&k(t),V(i)}}}function lI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m;const g=[sI,iI],_=[];function y(S,C){return S[1]?0:1}return d=y(n),h=_[d]=g[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[4]),r=E(),a=v("div"),u=v("div"),f=v("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,C){w(S,e,C),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(S,r,C),w(S,a,C),b(a,u),b(u,f),b(u,c),_[d].m(u,null),m=!0},p(S,C){(!m||C&16)&&le(o,S[4]);let T=d;d=y(S),d===T?_[d].p(S,C):(re(),L(_[T],1,1,()=>{_[T]=null}),ae(),h=_[d],h?h.p(S,C):(h=_[d]=g[d](S),h.c()),A(h,1),h.m(u,null))},i(S){m||(A(h),m=!0)},o(S){L(h),m=!1},d(S){S&&(k(e),k(r),k(a)),_[d].d()}}}function oI(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[lI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function rI(n,e,t){let i,s,l;Ge(n,Ft,d=>t(4,l=d)),un(Ft,l="Auth providers",l);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await ce.settings.getAll()||{};u(d)}catch(d){ce.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const h of mo)t(0,r[h.key]=Object.assign({enabled:!1},d[h.key]),r)}function f(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}function c(d,h){n.$$.not_equal(r[h.key],d)&&(r[h.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=mo.filter(d=>{var h;return(h=r[d.key])==null?void 0:h.enabled})),n.$$.dirty&1&&t(2,s=mo.filter(d=>{var h;return!((h=r[d.key])!=null&&h.enabled)}))},[r,o,s,i,l,f,c]}class aI extends be{constructor(e){super(),_e(this,e,rI,oI,me,{})}}function uI(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=W(n[3]),i=W(" duration (in seconds)"),l=E(),o=v("input"),a=E(),u=v("div"),f=v("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",s=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),Q(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(h,m){w(h,e,m),b(e,t),b(e,i),w(h,l,m),w(h,o,m),de(o,n[0]),w(h,a,m),w(h,u,m),b(u,f),c||(d=[Y(o,"input",n[4]),Y(f,"click",n[5])],c=!0)},p(h,m){m&8&&le(t,h[3]),m&64&&s!==(s=h[6])&&p(e,"for",s),m&64&&r!==(r=h[6])&&p(o,"id",r),m&1&&yt(o.value)!==h[0]&&de(o,h[0]),m&2&&Q(f,"txt-success",!!h[1])},d(h){h&&(k(e),k(l),k(o),k(a),k(u)),c=!1,$e(d)}}}function fI(n){let e,t;return e=new ge({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[uI,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,[s]){const l={};s&4&&(l.name=i[2]+".duration"),s&203&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function cI(n,e,t){let{key:i}=e,{label:s}=e,{duration:l}=e,{secret:o}=e;function r(){l=yt(this.value),t(0,l)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,s=u.label),"duration"in u&&t(0,l=u.duration),"secret"in u&&t(1,o=u.secret)},[l,o,i,s,r,a]}class G1 extends be{constructor(e){super(),_e(this,e,cI,fI,me,{key:2,label:3,duration:0,secret:1})}}function mg(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function gg(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function dI(n){let e,t,i=[],s=new Map,l,o,r,a,u,f=[],c=new Map,d,h,m,g,_,y,S,C,T,$,M,O=pe(n[5]);const D=F=>F[19].key;for(let F=0;FF[19].key;for(let F=0;Fhe(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&33&&(s=!0,d.duration=e[0][e[19].key].duration,ve(()=>s=!1)),!l&&c&33&&(l=!0,d.secret=e[0][e[19].key].secret,ve(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function bg(n,e){let t,i,s,l,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new G1({props:u}),te.push(()=>he(i,"duration",r)),te.push(()=>he(i,"secret",a)),{key:n,first:null,c(){t=ye(),z(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!s&&c&65&&(s=!0,d.duration=e[0][e[19].key].duration,ve(()=>s=!1)),!l&&c&65&&(l=!0,d.secret=e[0][e[19].key].secret,ve(()=>l=!1)),i.$set(d)},i(f){o||(A(i.$$.fragment,f),o=!0)},o(f){L(i.$$.fragment,f),o=!1},d(f){f&&k(t),V(i,f)}}}function vg(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[15]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function hI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_;const y=[pI,dI],S=[];function C(T,$){return T[1]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[4]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="

    Adjust common token options.

    ",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),m=!0,g||(_=Y(u,"submit",Ze(n[7])),g=!0)},p(T,$){(!m||$&16)&&le(o,T[4]);let M=d;d=C(T),d===M?S[d].p(T,$):(re(),L(S[M],1,1,()=>{S[M]=null}),ae(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){m||(A(h),m=!0)},o(T){L(h),m=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),g=!1,_()}}}function mI(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[hI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function gI(n,e,t){let i,s,l;Ge(n,Ft,M=>t(4,l=M));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];un(Ft,l="Token options",l);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const M=await ce.settings.getAll()||{};m(M)}catch(M){ce.error(M)}t(1,f=!1)}async function h(){if(!(c||!s)){t(2,c=!0);try{const M=await ce.settings.update(j.filterRedactedProps(u));m(M),zt("Successfully saved tokens options.")}catch(M){ce.error(M)}t(2,c=!1)}}function m(M){var D;M=M||{},t(0,u={});const O=o.concat(r);for(const I of O)t(0,u[I.key]={duration:((D=M[I.key])==null?void 0:D.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function g(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function _(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function y(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}function S(M,O){n.$$.not_equal(u[O.key].duration,M)&&(u[O.key].duration=M,t(0,u))}function C(M,O){n.$$.not_equal(u[O.key].secret,M)&&(u[O.key].secret=M,t(0,u))}const T=()=>g(),$=()=>h();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,s=i!=JSON.stringify(u))},[u,f,c,s,l,o,r,h,g,a,i,_,y,S,C,T,$]}class _I extends be{constructor(e){super(),_e(this,e,gI,mI,me,{})}}function bI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m;return o=new N1({props:{content:n[2]}}),{c(){e=v("div"),e.innerHTML=`

    Below you'll find your current collections configuration that you could import in - another PocketBase environment.

    `,t=E(),i=v("div"),s=v("button"),s.innerHTML='Copy',l=E(),z(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=' Download as JSON',p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(g,_){w(g,e,_),w(g,t,_),w(g,i,_),b(i,s),b(i,l),H(o,i,null),n[8](i),w(g,r,_),w(g,a,_),b(a,u),b(a,f),b(a,c),d=!0,h||(m=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],h=!0)},p(g,_){const y={};_&4&&(y.content=g[2]),o.$set(y)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){L(o.$$.fragment,g),d=!1},d(g){g&&(k(e),k(t),k(i),k(r),k(a)),V(o),n[8](null),h=!1,$e(m)}}}function vI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function yI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[vI,bI],m=[];function g(_,y){return _[1]?0:1}return f=g(n),c=m[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[3]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),m[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&le(o,_[3]);let S=f;f=g(_),f===S?m[f].p(_,y):(re(),L(m[S],1,1,()=>{m[S]=null}),ae(),c=m[f],c?c.p(_,y):(c=m[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),m[f].d()}}}function kI(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[yI]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function wI(n,e,t){let i,s;Ge(n,Ft,_=>t(3,s=_)),un(Ft,s="Export collections",s);const l="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ce.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){ce.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),ko("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const m=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,m,g]}class SI extends be{constructor(e){super(),_e(this,e,wI,kI,me,{})}}function yg(n,e,t){const i=n.slice();return i[14]=e[t],i}function kg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function wg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Sg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Tg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Cg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function $g(n,e,t){const i=n.slice();return i[30]=e[t],i}function TI(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Mg(),a=n[0].name!==n[1].name&&Og(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=W(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=Mg(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Og(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function CI(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=E(),i=v("strong"),l=W(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function $I(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Added",t=E(),i=v("strong"),l=W(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&le(l,s)},d(r){r&&(k(e),k(t),k(i))}}}function Mg(n){let e;return{c(){e=v("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Og(n){let e,t=n[0].name+"",i,s,l;return{c(){e=v("strong"),i=W(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),b(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&le(i,t)},d(o){o&&(k(e),k(s),k(l))}}}function Eg(n){var m,g;let e,t,i,s,l,o,r=n[12]((m=n[0])==null?void 0:m[n[30]])+"",a,u,f,c,d=n[12]((g=n[1])==null?void 0:g[n[30]])+"",h;return{c(){var _,y,S,C,T,$;e=v("tr"),t=v("td"),i=v("span"),i.textContent=`${n[30]}`,s=E(),l=v("td"),o=v("pre"),a=W(r),u=E(),f=v("td"),c=v("pre"),h=W(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(l,"class","svelte-lmkr38"),Q(l,"changed-old-col",!n[10]&&yn((_=n[0])==null?void 0:_[n[30]],(y=n[1])==null?void 0:y[n[30]])),Q(l,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),Q(f,"changed-new-col",!n[5]&&yn((S=n[0])==null?void 0:S[n[30]],(C=n[1])==null?void 0:C[n[30]])),Q(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),Q(e,"txt-primary",yn((T=n[0])==null?void 0:T[n[30]],($=n[1])==null?void 0:$[n[30]]))},m(_,y){w(_,e,y),b(e,t),b(t,i),b(e,s),b(e,l),b(l,o),b(o,a),b(e,u),b(e,f),b(f,c),b(c,h)},p(_,y){var S,C,T,$,M,O,D,I;y[0]&1&&r!==(r=_[12]((S=_[0])==null?void 0:S[_[30]])+"")&&le(a,r),y[0]&3075&&Q(l,"changed-old-col",!_[10]&&yn((C=_[0])==null?void 0:C[_[30]],(T=_[1])==null?void 0:T[_[30]])),y[0]&1024&&Q(l,"changed-none-col",_[10]),y[0]&2&&d!==(d=_[12](($=_[1])==null?void 0:$[_[30]])+"")&&le(h,d),y[0]&2083&&Q(f,"changed-new-col",!_[5]&&yn((M=_[0])==null?void 0:M[_[30]],(O=_[1])==null?void 0:O[_[30]])),y[0]&32&&Q(f,"changed-none-col",_[5]),y[0]&2051&&Q(e,"txt-primary",yn((D=_[0])==null?void 0:D[_[30]],(I=_[1])==null?void 0:I[_[30]]))},d(_){_&&k(e)}}}function Dg(n){let e,t=pe(n[6]),i=[];for(let s=0;sProps Old New',l=E(),o=v("tbody");for(let T=0;T!["schema","created","updated"].includes(y));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function _(y){return typeof y>"u"?"":j.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,m,_]}class EI extends be{constructor(e){super(),_e(this,e,OI,MI,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function qg(n,e,t){const i=n.slice();return i[17]=e[t],i}function jg(n){let e,t;return e=new EI({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){H(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function DI(n){let e,t,i=pe(n[2]),s=[];for(let o=0;oL(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o{m()}):m()}async function m(){if(!u){t(4,u=!0);try{await ce.collections.import(o,a),zt("Successfully imported collections configuration."),i("submit")}catch(T){ce.error(T)}t(4,u=!1),c()}}const g=()=>h(),_=()=>!u;function y(T){te[T?"unshift":"push"](()=>{s=T,t(1,s)})}function S(T){Re.call(this,n,T)}function C(T){Re.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,g,_,y,S,C]}class NI extends be{constructor(e){super(),_e(this,e,PI,LI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Hg(n,e,t){const i=n.slice();return i[32]=e[t],i}function Vg(n,e,t){const i=n.slice();return i[35]=e[t],i}function zg(n,e,t){const i=n.slice();return i[32]=e[t],i}function FI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O;a=new ge({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[qI,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let D=!1,I=n[6]&&n[1].length&&!n[7]&&Ug(),N=n[6]&&n[1].length&&n[7]&&Wg(n),P=n[13].length&&n_(n),F=!!n[0]&&i_(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=W(`Paste below the collections configuration you want to import or - `),o=v("button"),o.innerHTML='Load from JSON file',r=E(),z(a.$$.fragment),u=E(),f=E(),I&&I.c(),c=E(),N&&N.c(),d=E(),P&&P.c(),h=E(),m=v("div"),F&&F.c(),g=E(),_=v("div"),y=E(),S=v("button"),C=v("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=T=!n[14],p(m,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),b(i,s),b(s,l),b(s,o),w(R,r,q),H(a,R,q),w(R,u,q),w(R,f,q),I&&I.m(R,q),w(R,c,q),N&&N.m(R,q),w(R,d,q),P&&P.m(R,q),w(R,h,q),w(R,m,q),F&&F.m(m,null),b(m,g),b(m,_),b(m,y),b(m,S),b(S,C),$=!0,M||(O=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(S,"click",n[26])],M=!0)},p(R,q){(!$||q[0]&4096)&&Q(o,"btn-loading",R[12]);const B={};q[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(B.$$scope={dirty:q,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?I||(I=Ug(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?N?N.p(R,q):(N=Wg(R),N.c(),N.m(d.parentNode,d)):N&&(N.d(1),N=null),R[13].length?P?P.p(R,q):(P=n_(R),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),R[0]?F?F.p(R,q):(F=i_(R),F.c(),F.m(m,g)):F&&(F.d(1),F=null),(!$||q[0]&16384&&T!==(T=!R[14]))&&(S.disabled=T)},i(R){$||(A(a.$$.fragment,R),A(D),$=!0)},o(R){L(a.$$.fragment,R),L(D),$=!1},d(R){R&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(h),k(m)),n[19](null),V(a,R),I&&I.d(R),N&&N.d(R),P&&P.d(R),F&&F.d(),M=!1,$e(O)}}}function RI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Bg(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qI(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Bg();return{c(){e=v("label"),t=W("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),de(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=Y(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&de(l,d[0]),d[0]&&!d[6]?c||(c=Bg(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function Ug(n){let e;return{c(){e=v("div"),e.innerHTML='
    Your collections configuration is already up-to-date!
    ',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wg(n){let e,t,i,s,l,o=n[9].length&&Yg(n),r=n[4].length&&Gg(n),a=n[8].length&&xg(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Yg(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Gg(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=xg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Yg(n){let e=[],t=new Map,i,s=pe(n[9]);const l=o=>o[32].id;for(let o=0;oo[35].old.id+o[35].new.id;for(let o=0;oo[32].id;for(let o=0;o',i=E(),s=v("div"),s.innerHTML=`Some of the imported collections share the same name and/or fields but are - imported with different IDs. You can replace them in the import if you want - to.`,l=E(),o=v("button"),o.innerHTML='Replace with original ids',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function i_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='Clear',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function jI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[RI,FI],m=[];function g(_,y){return _[5]?0:1}return f=g(n),c=m[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[15]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),m[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&le(o,_[15]);let S=f;f=g(_),f===S?m[f].p(_,y):(re(),L(m[S],1,1,()=>{m[S]=null}),ae(),c=m[f],c?c.p(_,y):(c=m[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),m[f].d()}}}function HI(n){let e,t,i,s,l,o;e=new Di({}),i=new Tn({props:{$$slots:{default:[jI]},$$scope:{ctx:n}}});let r={};return l=new NI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,s,u),H(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),V(e,a),V(i,a),n[27](null),V(l,a)}}}function VI(n,e,t){let i,s,l,o,r,a,u;Ge(n,Ft,U=>t(15,u=U)),un(Ft,u="Import collections",u);let f,c,d="",h=!1,m=[],g=[],_=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,g=await ce.collections.getFullList(200));for(let U of g)delete U.created,delete U.updated}catch(U){ce.error(U)}t(5,S=!1)}function T(){if(t(4,y=[]),!!i)for(let U of m){const oe=j.findByKey(g,"id",U.id);!(oe!=null&&oe.id)||!j.hasCollectionChanges(oe,U,_)||y.push({new:U,old:oe})}}function $(){t(1,m=[]);try{t(1,m=JSON.parse(d))}catch{}Array.isArray(m)?t(1,m=j.filterDuplicatesByKey(m)):t(1,m=[]);for(let U of m)delete U.created,delete U.updated,U.schema=j.filterDuplicatesByKey(U.schema)}function M(){var U,oe;for(let ee of m){const se=j.findByKey(g,"name",ee.name)||j.findByKey(g,"id",ee.id);if(!se)continue;const Ee=ee.id,qe=se.id;ee.id=qe;const Ve=Array.isArray(se.schema)?se.schema:[],We=Array.isArray(ee.schema)?ee.schema:[];for(const ke of We){const Me=j.findByKey(Ve,"name",ke.name);Me&&Me.id&&(ke.id=Me.id)}for(let ke of m)if(Array.isArray(ke.schema))for(let Me of ke.schema)(U=Me.options)!=null&&U.collectionId&&((oe=Me.options)==null?void 0:oe.collectionId)===Ee&&(Me.options.collectionId=qe)}t(0,d=JSON.stringify(m,null,4))}function O(U){t(12,h=!0);const oe=new FileReader;oe.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ee.target.result),await ln(),m.length||(Ci("Invalid collections configuration."),D())},oe.onerror=ee=>{console.warn(ee),Ci("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},oe.readAsText(U)}function D(){t(0,d=""),t(10,f.value="",f),on({})}function I(U){te[U?"unshift":"push"](()=>{f=U,t(10,f)})}const N=()=>{f.files.length&&O(f.files[0])},P=()=>{f.click()};function F(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const q=()=>M(),B=()=>D(),Z=()=>c==null?void 0:c.show(g,m,_);function X(U){te[U?"unshift":"push"](()=>{c=U,t(11,c)})}const J=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&$(),n.$$.dirty[0]&3&&t(6,i=!!d&&m.length&&m.length===m.filter(U=>!!U.id&&!!U.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(U=>i&&_&&!j.findByKey(m,"id",U.id))),n.$$.dirty[0]&70&&t(8,l=m.filter(U=>i&&!j.findByKey(g,"id",U.id))),n.$$.dirty[0]&10&&(typeof m<"u"||typeof _<"u")&&T(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!S&&i&&o),n.$$.dirty[0]&6&&t(13,a=m.filter(U=>{let oe=j.findByKey(g,"name",U.name)||j.findByKey(g,"id",U.id);if(!oe)return!1;if(oe.id!=U.id)return!0;const ee=Array.isArray(oe.schema)?oe.schema:[],se=Array.isArray(U.schema)?U.schema:[];for(const Ee of se){if(j.findByKey(ee,"id",Ee.id))continue;const Ve=j.findByKey(ee,"name",Ee.name);if(Ve&&Ee.id!=Ve.id)return!0}return!1}))},[d,m,g,_,y,S,i,o,l,s,f,c,h,a,r,u,M,O,D,I,N,P,F,R,q,B,Z,X,J]}class zI extends be{constructor(e){super(),_e(this,e,VI,HI,me,{},null,[-1,-1])}}function BI(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=W("Backup name"),s=E(),l=v("input"),r=E(),a=v("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),p(l,"placeholder","Leave empty to autogenerate"),p(l,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),de(l,n[2]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(l,"id",o),d&4&&l.value!==c[2]&&de(l,c[2])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function UI(n){let e,t,i,s,l,o,r;return s=new ge({props:{class:"form-field m-0",name:"name",$$slots:{default:[BI,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please note that during the backup other concurrent write requests may fail since the - database will be temporary "locked" (this usually happens only during the ZIP generation).

    If you are using S3 storage for the collections file upload, you'll have to backup them - separately since they are not locally stored and will not be included in the final backup!

    `,t=E(),i=v("form"),z(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),H(s,i,null),l=!0,o||(r=Y(i,"submit",Ze(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(t),k(i)),V(s),o=!1,r()}}}function WI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function YI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(s)),o=!1,r()}}}function KI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[YI],header:[WI],default:[UI]},$$scope:{ctx:n}};return e=new rn({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function JI(n,e,t){const i=pt(),s="backup_create_"+j.randomString(5);let l,o="",r=!1,a;function u(S){on({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await ce.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),zt("Successfully generated new backup.")}catch(S){S.isAbort||ce.error(S)}clearTimeout(a),t(3,r=!1)}}Cl(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const h=()=>r?(ko("A backup has already been started, please wait."),!1):!0,m=()=>(r&&ko("The backup was started but may take a while to complete. You can come back later.",4500),!0);function g(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Re.call(this,n,S)}function y(S){Re.call(this,n,S)}return[f,l,o,r,s,c,u,d,h,m,g,_,y]}class GI extends be{constructor(e){super(),_e(this,e,JI,KI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function ZI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[2]),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(l,"id",o),f&4&&l.value!==u[2]&&de(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function XI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_;return u=new js({props:{value:n[1]}}),h=new ge({props:{class:"form-field required m-0",name:"name",$$slots:{default:[ZI,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`

    Please proceed with caution. -
    - Backup restore is still experimental and currently works only on UNIX based systems.

    The restore operation will attempt to replace your existing pb_data with the one from - the backup and will restart the application process.

    Nothing will happen if the backup file is invalid or incompatible.

    `,t=E(),i=v("div"),s=W(`Type the backup name - `),l=v("div"),o=v("span"),r=W(n[1]),a=E(),z(u.$$.fragment),f=W(` - to confirm:`),c=E(),d=v("form"),z(h.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),H(u,l,null),b(i,f),w(y,c,S),w(y,d,S),H(h,d,null),m=!0,g||(_=Y(d,"submit",Ze(n[7])),g=!0)},p(y,S){(!m||S&2)&&le(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),h.$set(T)},i(y){m||(A(u.$$.fragment,y),A(h.$$.fragment,y),m=!0)},o(y){L(u.$$.fragment,y),L(h.$$.fragment,y),m=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),V(u),V(h),g=!1,_()}}}function QI(n){let e,t,i,s;return{c(){e=v("h4"),t=W("Restore "),i=v("strong"),s=W(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&le(s,l[1])},d(l){l&&k(e)}}}function xI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=W("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function eL(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[xI],header:[QI],default:[XI]},$$scope:{ctx:n}};return e=new rn({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function tL(n,e,t){let i;const s="backup_restore_"+j.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){on({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await ce.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),Ci(((S=C.response)==null?void 0:S.message)||C.message))}}}Cl(()=>{clearTimeout(u)});function h(){r=this.value,t(2,r)}const m=()=>!a;function g(S){te[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Re.call(this,n,S)}function y(S){Re.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,h,m,g,_,y]}class nL extends be{constructor(e){super(),_e(this,e,tL,eL,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function s_(n,e,t){const i=n.slice();return i[22]=e[t],i}function l_(n,e,t){const i=n.slice();return i[19]=e[t],i}function iL(n){let e=[],t=new Map,i,s,l=pe(n[3]);const o=a=>a[22].key;for(let a=0;aNo backups yet. ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function r_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d,h=j.formattedFileSize(e[22].size)+"",m,g,_,y,S,C,T,$,M,O,D,I,N,P,F,R,q,B,Z,X;function J(){return e[10](e[22])}function U(){return e[11](e[22])}function oe(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=W(r),f=E(),c=v("span"),d=W("("),m=W(h),g=W(")"),_=E(),y=v("div"),S=v("button"),C=v("i"),$=E(),M=v("button"),O=v("i"),I=E(),N=v("button"),P=v("i"),R=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(C,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=T=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),Q(S,"btn-loading",e[5][e[22].key]),p(O,"class","ri-restart-line"),p(M,"type","button"),p(M,"class","btn btn-sm btn-circle btn-hint btn-transparent"),M.disabled=D=e[6][e[22].key],p(M,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(N,"type","button"),p(N,"class","btn btn-sm btn-circle btn-hint btn-transparent"),N.disabled=F=e[6][e[22].key],p(N,"aria-label","Delete"),Q(N,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,se){w(ee,t,se),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,f),b(l,c),b(c,d),b(c,m),b(c,g),b(t,_),b(t,y),b(y,S),b(S,C),b(y,$),b(y,M),b(M,O),b(y,I),b(y,N),b(N,P),b(t,R),B=!0,Z||(X=[Ce(Be.call(null,S,"Download")),Y(S,"click",Ze(J)),Ce(Be.call(null,M,"Restore")),Y(M,"click",Ze(U)),Ce(Be.call(null,N,"Delete")),Y(N,"click",Ze(oe))],Z=!0)},p(ee,se){e=ee,(!B||se&8)&&r!==(r=e[22].key+"")&&le(a,r),(!B||se&8&&u!==(u=e[22].key))&&p(o,"title",u),(!B||se&8)&&h!==(h=j.formattedFileSize(e[22].size)+"")&&le(m,h),(!B||se&104&&T!==(T=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=T),(!B||se&40)&&Q(S,"btn-loading",e[5][e[22].key]),(!B||se&72&&D!==(D=e[6][e[22].key]))&&(M.disabled=D),(!B||se&72&&F!==(F=e[6][e[22].key]))&&(N.disabled=F),(!B||se&72)&&Q(N,"btn-loading",e[6][e[22].key])},i(ee){B||(ee&&xe(()=>{B&&(q||(q=He(t,lt,{duration:150},!0)),q.run(1))}),B=!0)},o(ee){ee&&(q||(q=He(t,lt,{duration:150},!1)),q.run(0)),B=!1},d(ee){ee&&k(t),ee&&q&&q.end(),Z=!1,$e(X)}}}function a_(n){let e;return{c(){e=v("div"),e.innerHTML=' ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function lL(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function oL(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&(k(e),k(t),k(i))}}}function rL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g;const _=[sL,iL],y=[];function S(D,I){return D[4]?0:1}i=S(n),s=y[i]=_[i](n);function C(D,I){return D[7]?oL:lL}let T=C(n),$=T(n),M={};f=new GI({props:M}),n[14](f),f.$on("submit",n[15]);let O={};return d=new nL({props:O}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),$.c(),u=E(),z(f.$$.fragment),c=E(),z(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(D,I){w(D,e,I),b(e,t),y[i].m(t,null),b(e,l),b(e,o),b(o,r),$.m(r,null),w(D,u,I),H(f,D,I),w(D,c,I),H(d,D,I),h=!0,m||(g=Y(r,"click",n[13]),m=!0)},p(D,[I]){let N=i;i=S(D),i===N?y[i].p(D,I):(re(),L(y[N],1,1,()=>{y[N]=null}),ae(),s=y[i],s?s.p(D,I):(s=y[i]=_[i](D),s.c()),A(s,1),s.m(t,null)),T!==(T=C(D))&&($.d(1),$=T(D),$&&($.c(),$.m(r,null))),(!h||I&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const P={};f.$set(P);const F={};d.$set(F)},i(D){h||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),h=!0)},o(D){L(s),L(f.$$.fragment,D),L(d.$$.fragment,D),h=!1},d(D){D&&(k(e),k(u),k(c)),y[i].d(),$.d(),n[14](null),V(f,D),n[16](null),V(d,D),m=!1,g()}}}function aL(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),m();async function f(){t(4,o=!0);try{t(3,l=await ce.backups.getFullList()),l.sort((M,O)=>M.modifiedO.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(ce.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const O=await ce.getAdminFileToken(),D=ce.backups.getDownloadUrl(O,M);j.download(D)}catch(O){O.isAbort||ce.error(O)}delete r[M],t(5,r)}}function d(M){_n(`Do you really want to delete ${M}?`,()=>h(M))}async function h(M){if(!a[M]){t(6,a[M]=!0,a);try{await ce.backups.delete(M),j.removeByKey(l,"name",M),f(),zt(`Successfully deleted ${M}.`)}catch(O){O.isAbort||ce.error(O)}delete a[M],t(6,a)}}async function m(){var M;try{const O=await ce.health.check({$autoCancel:!1}),D=u;t(7,u=((M=O==null?void 0:O.data)==null?void 0:M.canBackup)||!1),D!=u&&u&&f()}catch{}}Kt(()=>{let M=setInterval(()=>{m()},3e3);return()=>{clearInterval(M)}});const g=M=>c(M.key),_=M=>s.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function C(M){te[M?"unshift":"push"](()=>{i=M,t(1,i)})}const T=()=>{f()};function $(M){te[M?"unshift":"push"](()=>{s=M,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,g,_,y,S,C,T,$]}class uL extends be{constructor(e){super(),_e(this,e,aL,rL,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function fL(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("i"),s=E(),l=v("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),Q(e,"btn-loading",n[2]),Q(e,"btn-disabled",n[2]),p(l,"type","file"),p(l,"accept","application/zip"),p(l,"class","hidden")},m(a,u){w(a,e,u),b(e,t),w(a,s,u),w(a,l,u),n[5](l),o||(r=[Ce(Be.call(null,e,"Upload backup")),Y(e,"click",n[4]),Y(l,"change",n[3])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&Q(e,"btn-loading",a[2]),u&5&&Q(e,"btn-disabled",a[2])},i:x,o:x,d(a){a&&(k(e),k(s),k(l)),n[5](null),o=!1,$e(r)}}}const u_="upload_backup";function cL(n,e,t){const i=pt();let{class:s=""}=e,l,o=!1;async function r(f){var d,h,m,g,_;if(o||!((h=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&h.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await ce.backups.upload(c,{requestKey:u_}),t(2,o=!1),i("success"),zt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(_=(g=(m=y.response)==null?void 0:m.data)==null?void 0:g.file)!=null&&_.message?Ci(y.response.data.file.message):ce.error(y))}}Cl(()=>{ce.cancelRequest(u_)});const a=()=>l==null?void 0:l.click();function u(f){te[f?"unshift":"push"](()=>{l=f,t(1,l)})}return n.$$set=f=>{"class"in f&&t(0,s=f.class)},[s,l,o,r,a,u]}class dL extends be{constructor(e){super(),_e(this,e,cL,fL,me,{class:0})}}function pL(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hL(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function f_(n){var B,Z,X;let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O;t=new ge({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[mL,({uniqueId:J})=>({31:J}),({uniqueId:J})=>[0,J?1:0]]},$$scope:{ctx:n}}});let D=n[2]&&c_(n);function I(J){n[24](J)}function N(J){n[25](J)}function P(J){n[26](J)}let F={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(F.config=n[1].backups.s3),n[7]!==void 0&&(F.isTesting=n[7]),n[8]!==void 0&&(F.testError=n[8]),r=new K1({props:F}),te.push(()=>he(r,"config",I)),te.push(()=>he(r,"isTesting",N)),te.push(()=>he(r,"testError",P));let R=((X=(Z=n[1].backups)==null?void 0:Z.s3)==null?void 0:X.enabled)&&!n[9]&&!n[5]&&d_(n),q=n[9]&&p_(n);return{c(){e=v("form"),z(t.$$.fragment),i=E(),D&&D.c(),s=E(),l=v("div"),o=E(),z(r.$$.fragment),c=E(),d=v("div"),h=v("div"),m=E(),R&&R.c(),g=E(),q&&q.c(),_=E(),y=v("button"),S=v("span"),S.textContent="Save changes",p(l,"class","clearfix m-b-base"),p(h,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=C=!n[9]||n[5],Q(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(J,U){w(J,e,U),H(t,e,null),b(e,i),D&&D.m(e,null),b(e,s),b(e,l),b(e,o),H(r,e,null),b(e,c),b(e,d),b(d,h),b(d,m),R&&R.m(d,null),b(d,g),q&&q.m(d,null),b(d,_),b(d,y),b(y,S),$=!0,M||(O=[Y(y,"click",n[28]),Y(e,"submit",Ze(n[11]))],M=!0)},p(J,U){var se,Ee,qe;const oe={};U[0]&4|U[1]&3&&(oe.$$scope={dirty:U,ctx:J}),t.$set(oe),J[2]?D?(D.p(J,U),U[0]&4&&A(D,1)):(D=c_(J),D.c(),A(D,1),D.m(e,s)):D&&(re(),L(D,1,1,()=>{D=null}),ae());const ee={};U[0]&1&&(ee.originalConfig=(se=J[0].backups)==null?void 0:se.s3),!a&&U[0]&2&&(a=!0,ee.config=J[1].backups.s3,ve(()=>a=!1)),!u&&U[0]&128&&(u=!0,ee.isTesting=J[7],ve(()=>u=!1)),!f&&U[0]&256&&(f=!0,ee.testError=J[8],ve(()=>f=!1)),r.$set(ee),(qe=(Ee=J[1].backups)==null?void 0:Ee.s3)!=null&&qe.enabled&&!J[9]&&!J[5]?R?R.p(J,U):(R=d_(J),R.c(),R.m(d,g)):R&&(R.d(1),R=null),J[9]?q?q.p(J,U):(q=p_(J),q.c(),q.m(d,_)):q&&(q.d(1),q=null),(!$||U[0]&544&&C!==(C=!J[9]||J[5]))&&(y.disabled=C),(!$||U[0]&32)&&Q(y,"btn-loading",J[5])},i(J){$||(A(t.$$.fragment,J),A(D),A(r.$$.fragment,J),J&&xe(()=>{$&&(T||(T=He(e,lt,{duration:150},!0)),T.run(1))}),$=!0)},o(J){L(t.$$.fragment,J),L(D),L(r.$$.fragment,J),J&&(T||(T=He(e,lt,{duration:150},!1)),T.run(0)),$=!1},d(J){J&&k(e),V(t),D&&D.d(),V(r),R&&R.d(),q&&q.d(),J&&T&&T.end(),M=!1,$e(O)}}}function mL(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=W("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function c_(n){let e,t,i,s,l,o,r,a,u;return s=new ge({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[_L,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new ge({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[bL,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),b(e,t),b(t,i),H(s,i,null),b(t,l),b(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&2|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=He(e,lt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=He(e,lt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function gL(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("button"),e.innerHTML='Every day at 00:00h',t=E(),i=v("button"),i.innerHTML='Every sunday at 00:00h',s=E(),l=v("button"),l.innerHTML='Every Mon and Wed at 00:00h',o=E(),r=v("button"),r.innerHTML='Every first day of the month at 00:00h',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[Y(e,"click",n[19]),Y(i,"click",n[20]),Y(l,"click",n[21]),Y(r,"click",n[22])],a=!0)},p:x,d(f){f&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r)),a=!1,$e(u)}}}function _L(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O,D,I,N;return g=new Pn({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[gL]},$$scope:{ctx:n}}}),{c(){var P,F;e=v("label"),t=W("Cron expression"),s=E(),l=v("input"),a=E(),u=v("div"),f=v("button"),c=v("span"),c.textContent="Presets",d=E(),h=v("i"),m=E(),z(g.$$.fragment),_=E(),y=v("div"),S=v("p"),C=W(`Supports numeric list, steps, ranges or - `),T=v("span"),T.textContent="macros",$=W(`. - `),M=v("br"),O=W(` - The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((F=(P=n[0])==null?void 0:P.backups)!=null&&F.cron),p(c,"class","txt"),p(h,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(y,"class","help-block")},m(P,F){var R,q;w(P,e,F),b(e,t),w(P,s,F),w(P,l,F),de(l,n[1].backups.cron),w(P,a,F),w(P,u,F),b(u,f),b(f,c),b(f,d),b(f,h),b(f,m),H(g,f,null),w(P,_,F),w(P,y,F),b(y,S),b(S,C),b(S,T),b(S,$),b(S,M),b(S,O),D=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||l.focus(),I||(N=[Y(l,"input",n[18]),Ce(Be.call(null,T,`@yearly -@annually -@monthly -@weekly -@daily -@midnight -@hourly`))],I=!0)},p(P,F){var q,B;(!D||F[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!D||F[1]&1&&o!==(o=P[31]))&&p(l,"id",o),(!D||F[0]&1&&r!==(r=!((B=(q=P[0])==null?void 0:q.backups)!=null&&B.cron)))&&(l.autofocus=r),F[0]&2&&l.value!==P[1].backups.cron&&de(l,P[1].backups.cron);const R={};F[0]&2|F[1]&2&&(R.$$scope={dirty:F,ctx:P}),g.$set(R)},i(P){D||(A(g.$$.fragment,P),D=!0)},o(P){L(g.$$.fragment,P),D=!1},d(P){P&&(k(e),k(s),k(l),k(a),k(u),k(_),k(y)),V(g),I=!1,$e(N)}}}function bL(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=W("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),de(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&2&&yt(l.value)!==u[1].backups.cronMaxKeep&&de(l,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function d_(n){let e;function t(l,o){return l[7]?kL:l[8]?yL:vL}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){l&&k(e),s.d(l)}}}function vL(n){let e;return{c(){e=v("div"),e.innerHTML=' S3 connected successfully',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function yL(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=' Failed to establish S3 connection',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Ce(t=Be.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Et(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function kL(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function p_(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function wL(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S,C,T,$,M,O,D,I,N,P;h=new Jo({props:{class:"btn-sm",tooltip:"Refresh"}}),h.$on("refresh",n[13]),g=new dL({props:{class:"btn-sm"}}),g.$on("success",n[13]);let F={};y=new uL({props:F}),n[15](y);function R(X,J){return X[6]?hL:pL}let q=R(n),B=q(n),Z=n[6]&&!n[4]&&f_(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=W(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),z(h.$$.fragment),m=E(),z(g.$$.fragment),_=E(),z(y.$$.fragment),S=E(),C=v("hr"),T=E(),$=v("button"),M=v("span"),M.textContent="Backups options",O=E(),B.c(),D=E(),Z&&Z.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(M,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(X,J){w(X,e,J),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(X,r,J),w(X,a,J),b(a,u),b(u,f),b(f,c),b(f,d),H(h,f,null),b(f,m),H(g,f,null),b(u,_),H(y,u,null),b(u,S),b(u,C),b(u,T),b(u,$),b($,M),b($,O),B.m($,null),b(u,D),Z&&Z.m(u,null),I=!0,N||(P=[Y($,"click",n[16]),Y(u,"submit",Ze(n[11]))],N=!0)},p(X,J){(!I||J[0]&1024)&&le(o,X[10]);const U={};y.$set(U),q!==(q=R(X))&&(B.d(1),B=q(X),B&&(B.c(),B.m($,null))),(!I||J[0]&16)&&($.disabled=X[4]),(!I||J[0]&16)&&Q($,"btn-loading",X[4]),X[6]&&!X[4]?Z?(Z.p(X,J),J[0]&80&&A(Z,1)):(Z=f_(X),Z.c(),A(Z,1),Z.m(u,null)):Z&&(re(),L(Z,1,1,()=>{Z=null}),ae())},i(X){I||(A(h.$$.fragment,X),A(g.$$.fragment,X),A(y.$$.fragment,X),A(Z),I=!0)},o(X){L(h.$$.fragment,X),L(g.$$.fragment,X),L(y.$$.fragment,X),L(Z),I=!1},d(X){X&&(k(e),k(r),k(a)),V(h),V(g),n[15](null),V(y),B.d(),Z&&Z.d(),N=!1,$e(P)}}}function SL(n){let e,t,i,s;return e=new Di({}),i=new Tn({props:{$$slots:{default:[wL]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){H(e,l,o),w(l,t,o),H(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(e,l),V(i,l)}}}function TL(n,e,t){let i,s;Ge(n,Ft,J=>t(10,s=J)),un(Ft,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,h=!1,m=null;g();async function g(){t(4,a=!0);try{const J=await ce.settings.getAll()||{};y(J)}catch(J){ce.error(J)}t(4,a=!1)}async function _(){if(!(u||!i)){t(5,u=!0);try{const J=await ce.settings.update(j.filterRedactedProps(r));await C(),y(J),zt("Successfully saved application settings.")}catch(J){ce.error(J)}t(5,u=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function C(){return l==null?void 0:l.loadBackups()}function T(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const $=()=>t(6,d=!d);function M(){c=this.checked,t(2,c)}function O(){r.backups.cron=this.value,t(1,r),t(2,c)}const D=()=>{t(1,r.backups.cron="0 0 * * *",r)},I=()=>{t(1,r.backups.cron="0 0 * * 0",r)},N=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},P=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function F(){r.backups.cronMaxKeep=yt(this.value),t(1,r),t(2,c)}function R(J){n.$$.not_equal(r.backups.s3,J)&&(r.backups.s3=J,t(1,r),t(2,c))}function q(J){h=J,t(7,h)}function B(J){m=J,t(8,m)}const Z=()=>S(),X=()=>_();return n.$$.update=()=>{var J;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(J=r==null?void 0:r.backups)!=null&&J.cron&&(pi("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,l,a,u,d,h,m,i,s,_,S,C,f,T,$,M,O,D,I,N,P,F,R,q,B,Z,X]}class CL extends be{constructor(e){super(),_e(this,e,TL,SL,me,{},null,[-1,-1])}}const Wt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?us("/"):!0}],$L={"/login":jt({component:MA,conditions:Wt.concat([n=>!ce.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":jt({asyncComponent:()=>ft(()=>import("./PageAdminRequestPasswordReset-9bb5b8fc.js"),[],import.meta.url),conditions:Wt.concat([n=>!ce.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":jt({asyncComponent:()=>ft(()=>import("./PageAdminConfirmPasswordReset-8e3ad9f6.js"),[],import.meta.url),conditions:Wt.concat([n=>!ce.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":jt({component:GD,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":jt({component:sT,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":jt({component:RA,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":jt({component:kA,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":jt({component:T8,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":jt({component:W8,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":jt({component:aI,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":jt({component:_I,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":jt({component:SI,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":jt({component:zI,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":jt({component:CL,conditions:Wt.concat([n=>ce.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":jt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmPasswordReset-bfd8a556.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":jt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmPasswordReset-bfd8a556.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":jt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmVerification-44fc3c9e.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":jt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmVerification-44fc3c9e.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":jt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmEmailChange-9d9126f6.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":jt({asyncComponent:()=>ft(()=>import("./PageRecordConfirmEmailChange-9d9126f6.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect":jt({asyncComponent:()=>ft(()=>import("./PageOAuth2Redirect-42a9e5c9.js"),[],import.meta.url),conditions:Wt,userData:{showAppSidebar:!1}}),"*":jt({component:Ck,userData:{showAppSidebar:!1}})};function ML(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[o,r]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Ko}=i;return{delay:f,duration:Et(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,m)=>{const g=m*a,_=m*u,y=h+m*e.width/t.width,S=h+m*e.height/t.height;return`transform: ${l} translate(${g}px, ${_}px) scale(${y}, ${S});`}}}function h_(n,e,t){const i=n.slice();return i[2]=e[t],i}function OL(n){let e;return{c(){e=v("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function EL(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function DL(n){let e;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function AL(n){let e;return{c(){e=v("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function m_(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h,m=x,g,_,y;function S(M,O){return M[2].type==="info"?AL:M[2].type==="success"?DL:M[2].type==="warning"?EL:OL}let C=S(e),T=C(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=v("div"),i=v("div"),T.c(),s=E(),l=v("div"),r=W(o),a=E(),u=v("button"),u.innerHTML='',f=E(),p(i,"class","icon"),p(l,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),Q(t,"alert-info",e[2].type=="info"),Q(t,"alert-success",e[2].type=="success"),Q(t,"alert-danger",e[2].type=="error"),Q(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,O){w(M,t,O),b(t,i),T.m(i,null),b(t,s),b(t,l),b(l,r),b(t,a),b(t,u),b(t,f),g=!0,_||(y=Y(u,"click",Ze($)),_=!0)},p(M,O){e=M,C!==(C=S(e))&&(T.d(1),T=C(e),T&&(T.c(),T.m(i,null))),(!g||O&1)&&o!==(o=e[2].message+"")&&le(r,o),(!g||O&1)&&Q(t,"alert-info",e[2].type=="info"),(!g||O&1)&&Q(t,"alert-success",e[2].type=="success"),(!g||O&1)&&Q(t,"alert-danger",e[2].type=="error"),(!g||O&1)&&Q(t,"alert-warning",e[2].type=="warning")},r(){h=t.getBoundingClientRect()},f(){v0(t),m(),T_(t,h)},a(){m(),m=b0(t,h,ML,{duration:150})},i(M){g||(M&&xe(()=>{g&&(d&&d.end(1),c=M_(t,lt,{duration:150}),c.start())}),g=!0)},o(M){c&&c.invalidate(),M&&(d=ka(t,hl,{duration:150})),g=!1},d(M){M&&k(t),T.d(),M&&d&&d.end(),_=!1,y()}}}function IL(n){let e,t=[],i=new Map,s,l=pe(n[0]);const o=r=>r[2].message;for(let r=0;rt(0,i=l)),[i,l=>Lb(l)]}class PL extends be{constructor(e){super(),_e(this,e,LL,IL,me,{})}}function NL(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=v("h4"),i=W(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(l,o){w(l,e,o),b(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&le(i,t)},d(l){l&&k(e)}}}function FL(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="No",i=E(),s=v("button"),l=v("span"),l.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],Q(s,"btn-loading",n[2])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),e.focus(),o||(r=[Y(e,"click",n[4]),Y(s,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&Q(s,"btn-loading",a[2])},d(a){a&&(k(e),k(i),k(s)),o=!1,$e(r)}}}function RL(n){let e,t,i={class:"confirm-popup hide-content overlay-panel-sm",overlayClose:!n[2],escClose:!n[2],btnClose:!1,popup:!0,$$slots:{footer:[FL],header:[NL]},$$scope:{ctx:n}};return e=new rn({props:i}),n[6](e),e.$on("hide",n[7]),{c(){z(e.$$.fragment)},m(s,l){H(e,s,l),t=!0},p(s,[l]){const o={};l&4&&(o.overlayClose=!s[2]),l&4&&(o.escClose=!s[2]),l&271&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[6](null),V(e,s)}}}function qL(n,e,t){let i;Ge(n,lu,c=>t(1,i=c));let s,l=!1,o=!1;const r=()=>{t(3,o=!1),s==null||s.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),t(3,o=!0),s==null||s.hide()};function u(c){te[c?"unshift":"push"](()=>{s=c,t(0,s)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await ln(),t(3,o=!1),q1()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),s==null||s.show())},[s,i,l,o,r,a,u,f]}class jL extends be{constructor(e){super(),_e(this,e,qL,RL,me,{})}}function g_(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,g,_,y,S;return g=new Pn({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[HL]},$$scope:{ctx:n}}}),{c(){var C;e=v("aside"),t=v("a"),t.innerHTML='PocketBase logo',i=E(),s=v("nav"),l=v("a"),l.innerHTML='',o=E(),r=v("a"),r.innerHTML='',a=E(),u=v("a"),u.innerHTML='',f=E(),c=v("figure"),d=v("img"),m=E(),z(g.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(s,"class","main-menu"),fn(d.src,h="./images/avatars/avatar"+(((C=n[0])==null?void 0:C.avatar)||0)+".svg")||p(d,"src",h),p(d,"alt","Avatar"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(C,T){w(C,e,T),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(e,f),b(e,c),b(c,d),b(c,m),H(g,c,null),_=!0,y||(S=[Ce(dn.call(null,t)),Ce(dn.call(null,l)),Ce(zn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ce(Be.call(null,l,{text:"Collections",position:"right"})),Ce(dn.call(null,r)),Ce(zn.call(null,r,{path:"/logs/?.*",className:"current-route"})),Ce(Be.call(null,r,{text:"Logs",position:"right"})),Ce(dn.call(null,u)),Ce(zn.call(null,u,{path:"/settings/?.*",className:"current-route"})),Ce(Be.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p(C,T){var M;(!_||T&1&&!fn(d.src,h="./images/avatars/avatar"+(((M=C[0])==null?void 0:M.avatar)||0)+".svg"))&&p(d,"src",h);const $={};T&4096&&($.$$scope={dirty:T,ctx:C}),g.$set($)},i(C){_||(A(g.$$.fragment,C),_=!0)},o(C){L(g.$$.fragment,C),_=!1},d(C){C&&k(e),V(g),y=!1,$e(S)}}}function HL(n){let e,t,i,s,l,o,r;return{c(){e=v("a"),e.innerHTML=' Manage admins',t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=' Logout',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Ce(dn.call(null,e)),Y(l,"click",n[7])],o=!0)},p:x,d(a){a&&(k(e),k(t),k(i),k(s),k(l)),o=!1,$e(r)}}}function __(n){let e,t,i;return t=new uu({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),H(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),V(t)}}}function VL(n){var _;let e,t,i,s,l,o,r,a,u,f,c,d,h;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let m=((_=n[0])==null?void 0:_.id)&&n[1]&&g_(n);o=new L0({props:{routes:$L}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new PL({}),f=new jL({});let g=n[1]&&!n[2]&&__(n);return{c(){t=E(),i=v("div"),m&&m.c(),s=E(),l=v("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),c=E(),g&&g.c(),d=ye(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),m&&m.m(i,null),b(i,s),b(i,l),H(o,l,null),b(l,r),H(a,l,null),w(y,u,S),H(f,y,S),w(y,c,S),g&&g.m(y,S),w(y,d,S),h=!0},p(y,[S]){var C;(!h||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(C=y[0])!=null&&C.id&&y[1]?m?(m.p(y,S),S&3&&A(m,1)):(m=g_(y),m.c(),A(m,1),m.m(i,s)):m&&(re(),L(m,1,1,()=>{m=null}),ae()),y[1]&&!y[2]?g?(g.p(y,S),S&6&&A(g,1)):(g=__(y),g.c(),A(g,1),g.m(d.parentNode,d)):g&&(re(),L(g,1,1,()=>{g=null}),ae())},i(y){h||(A(m),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(g),h=!0)},o(y){L(m),L(o.$$.fragment,y),L(a.$$.fragment,y),L(f.$$.fragment,y),L(g),h=!1},d(y){y&&(k(t),k(i),k(u),k(c),k(d)),m&&m.d(),V(o),V(a),V(f,y),g&&g.d(y)}}}function zL(n,e,t){let i,s,l,o;Ge(n,Es,g=>t(10,i=g)),Ge(n,To,g=>t(3,s=g)),Ge(n,Na,g=>t(0,l=g)),Ge(n,Ft,g=>t(4,o=g));let r,a=!1,u=!1;function f(g){var _,y,S,C;((_=g==null?void 0:g.detail)==null?void 0:_.location)!==r&&(t(1,a=!!((S=(y=g==null?void 0:g.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(C=g==null?void 0:g.detail)==null?void 0:C.location,un(Ft,o="",o),on({}),q1())}function c(){us("/")}async function d(){var g,_;if(l!=null&&l.id)try{const y=await ce.settings.getAll({$cancelKey:"initialAppSettings"});un(To,s=((g=y==null?void 0:y.meta)==null?void 0:g.appName)||"",s),un(Es,i=!!((_=y==null?void 0:y.meta)!=null&&_.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function h(){ce.logout()}const m=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,h,m]}class BL extends be{constructor(e){super(),_e(this,e,zL,VL,me,{})}}new BL({target:document.getElementById("app")});export{$e as A,zt as B,j as C,us as D,ye as E,Nb as F,Vo as G,ao as H,Kt as I,Ge as J,Zn as K,pt as L,te as M,N1 as N,pe as O,gt as P,Ui as Q,qt as R,be as S,vt as T,zr as U,L as a,E as b,z as c,V as d,v as e,p as f,w as g,b as h,_e as i,Ce as j,re as k,dn as l,H as m,ae as n,k as o,ce as p,ge as q,Q as r,me as s,A as t,Y as u,Ze as v,W as w,le as x,x as y,de as z}; diff --git a/ui/dist/assets/index-aca38a7a.css b/ui/dist/assets/index-aca38a7a.css deleted file mode 100644 index 6328a615..00000000 --- a/ui/dist/assets/index-aca38a7a.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2");font-display:swap}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:400;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:600;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:normal;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff2) format("woff2")}@font-face{font-family:Source Sans Pro;font-style:italic;font-weight:700;src:local(""),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff2) format("woff2")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:400;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff2) format("woff2")}@font-face{font-family:JetBrains Mono;font-style:normal;font-weight:600;src:local(""),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff2) format("woff2")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #a0a6ac;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #e4e9ec;--baseAlt2Color: #d7dde4;--baseAlt3Color: #c6cdd7;--baseAlt4Color: #a5b0c0;--infoColor: #5499e8;--infoAltColor: #cee2f8;--successColor: #32ad84;--successAltColor: #c4eedc;--dangerColor: #e34562;--dangerAltColor: #f7cad2;--warningColor: #ff944d;--warningAltColor: #ffd4b8;--overlayColor: rgba(53, 71, 104, .28);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .06);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 22px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 230px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--entranceAnimationSpeed: .25s;--baseRadius: 4px;--lgRadius: 12px;--btnRadius: 4px;accent-color:var(--primaryColor)}html,body,div,span,applet,object,iframe,h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}i{font-family:remixicon!important;font-style:normal;font-weight:400;font-size:1.1238rem;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}i:before{vertical-align:top;margin-top:1px;display:inline-block}.ri-24-hours-fill:before{content:""}.ri-24-hours-line:before{content:""}.ri-4k-fill:before{content:""}.ri-4k-line:before{content:""}.ri-a-b:before{content:""}.ri-account-box-fill:before{content:""}.ri-account-box-line:before{content:""}.ri-account-circle-fill:before{content:""}.ri-account-circle-line:before{content:""}.ri-account-pin-box-fill:before{content:""}.ri-account-pin-box-line:before{content:""}.ri-account-pin-circle-fill:before{content:""}.ri-account-pin-circle-line:before{content:""}.ri-add-box-fill:before{content:""}.ri-add-box-line:before{content:""}.ri-add-circle-fill:before{content:""}.ri-add-circle-line:before{content:""}.ri-add-fill:before{content:""}.ri-add-line:before{content:""}.ri-admin-fill:before{content:""}.ri-admin-line:before{content:""}.ri-advertisement-fill:before{content:""}.ri-advertisement-line:before{content:""}.ri-airplay-fill:before{content:""}.ri-airplay-line:before{content:""}.ri-alarm-fill:before{content:""}.ri-alarm-line:before{content:""}.ri-alarm-warning-fill:before{content:""}.ri-alarm-warning-line:before{content:""}.ri-album-fill:before{content:""}.ri-album-line:before{content:""}.ri-alert-fill:before{content:""}.ri-alert-line:before{content:""}.ri-aliens-fill:before{content:""}.ri-aliens-line:before{content:""}.ri-align-bottom:before{content:""}.ri-align-center:before{content:""}.ri-align-justify:before{content:""}.ri-align-left:before{content:""}.ri-align-right:before{content:""}.ri-align-top:before{content:""}.ri-align-vertically:before{content:""}.ri-alipay-fill:before{content:""}.ri-alipay-line:before{content:""}.ri-amazon-fill:before{content:""}.ri-amazon-line:before{content:""}.ri-anchor-fill:before{content:""}.ri-anchor-line:before{content:""}.ri-ancient-gate-fill:before{content:""}.ri-ancient-gate-line:before{content:""}.ri-ancient-pavilion-fill:before{content:""}.ri-ancient-pavilion-line:before{content:""}.ri-android-fill:before{content:""}.ri-android-line:before{content:""}.ri-angularjs-fill:before{content:""}.ri-angularjs-line:before{content:""}.ri-anticlockwise-2-fill:before{content:""}.ri-anticlockwise-2-line:before{content:""}.ri-anticlockwise-fill:before{content:""}.ri-anticlockwise-line:before{content:""}.ri-app-store-fill:before{content:""}.ri-app-store-line:before{content:""}.ri-apple-fill:before{content:""}.ri-apple-line:before{content:""}.ri-apps-2-fill:before{content:""}.ri-apps-2-line:before{content:""}.ri-apps-fill:before{content:""}.ri-apps-line:before{content:""}.ri-archive-drawer-fill:before{content:""}.ri-archive-drawer-line:before{content:""}.ri-archive-fill:before{content:""}.ri-archive-line:before{content:""}.ri-arrow-down-circle-fill:before{content:""}.ri-arrow-down-circle-line:before{content:""}.ri-arrow-down-fill:before{content:""}.ri-arrow-down-line:before{content:""}.ri-arrow-down-s-fill:before{content:""}.ri-arrow-down-s-line:before{content:""}.ri-arrow-drop-down-fill:before{content:""}.ri-arrow-drop-down-line:before{content:""}.ri-arrow-drop-left-fill:before{content:""}.ri-arrow-drop-left-line:before{content:""}.ri-arrow-drop-right-fill:before{content:""}.ri-arrow-drop-right-line:before{content:""}.ri-arrow-drop-up-fill:before{content:""}.ri-arrow-drop-up-line:before{content:""}.ri-arrow-go-back-fill:before{content:""}.ri-arrow-go-back-line:before{content:""}.ri-arrow-go-forward-fill:before{content:""}.ri-arrow-go-forward-line:before{content:""}.ri-arrow-left-circle-fill:before{content:""}.ri-arrow-left-circle-line:before{content:""}.ri-arrow-left-down-fill:before{content:""}.ri-arrow-left-down-line:before{content:""}.ri-arrow-left-fill:before{content:""}.ri-arrow-left-line:before{content:""}.ri-arrow-left-right-fill:before{content:""}.ri-arrow-left-right-line:before{content:""}.ri-arrow-left-s-fill:before{content:""}.ri-arrow-left-s-line:before{content:""}.ri-arrow-left-up-fill:before{content:""}.ri-arrow-left-up-line:before{content:""}.ri-arrow-right-circle-fill:before{content:""}.ri-arrow-right-circle-line:before{content:""}.ri-arrow-right-down-fill:before{content:""}.ri-arrow-right-down-line:before{content:""}.ri-arrow-right-fill:before{content:""}.ri-arrow-right-line:before{content:""}.ri-arrow-right-s-fill:before{content:""}.ri-arrow-right-s-line:before{content:""}.ri-arrow-right-up-fill:before{content:""}.ri-arrow-right-up-line:before{content:""}.ri-arrow-up-circle-fill:before{content:""}.ri-arrow-up-circle-line:before{content:""}.ri-arrow-up-down-fill:before{content:""}.ri-arrow-up-down-line:before{content:""}.ri-arrow-up-fill:before{content:""}.ri-arrow-up-line:before{content:""}.ri-arrow-up-s-fill:before{content:""}.ri-arrow-up-s-line:before{content:""}.ri-artboard-2-fill:before{content:""}.ri-artboard-2-line:before{content:""}.ri-artboard-fill:before{content:""}.ri-artboard-line:before{content:""}.ri-article-fill:before{content:""}.ri-article-line:before{content:""}.ri-aspect-ratio-fill:before{content:""}.ri-aspect-ratio-line:before{content:""}.ri-asterisk:before{content:""}.ri-at-fill:before{content:""}.ri-at-line:before{content:""}.ri-attachment-2:before{content:""}.ri-attachment-fill:before{content:""}.ri-attachment-line:before{content:""}.ri-auction-fill:before{content:""}.ri-auction-line:before{content:""}.ri-award-fill:before{content:""}.ri-award-line:before{content:""}.ri-baidu-fill:before{content:""}.ri-baidu-line:before{content:""}.ri-ball-pen-fill:before{content:""}.ri-ball-pen-line:before{content:""}.ri-bank-card-2-fill:before{content:""}.ri-bank-card-2-line:before{content:""}.ri-bank-card-fill:before{content:""}.ri-bank-card-line:before{content:""}.ri-bank-fill:before{content:""}.ri-bank-line:before{content:""}.ri-bar-chart-2-fill:before{content:""}.ri-bar-chart-2-line:before{content:""}.ri-bar-chart-box-fill:before{content:""}.ri-bar-chart-box-line:before{content:""}.ri-bar-chart-fill:before{content:""}.ri-bar-chart-grouped-fill:before{content:""}.ri-bar-chart-grouped-line:before{content:""}.ri-bar-chart-horizontal-fill:before{content:""}.ri-bar-chart-horizontal-line:before{content:""}.ri-bar-chart-line:before{content:""}.ri-barcode-box-fill:before{content:""}.ri-barcode-box-line:before{content:""}.ri-barcode-fill:before{content:""}.ri-barcode-line:before{content:""}.ri-barricade-fill:before{content:""}.ri-barricade-line:before{content:""}.ri-base-station-fill:before{content:""}.ri-base-station-line:before{content:""}.ri-basketball-fill:before{content:""}.ri-basketball-line:before{content:""}.ri-battery-2-charge-fill:before{content:""}.ri-battery-2-charge-line:before{content:""}.ri-battery-2-fill:before{content:""}.ri-battery-2-line:before{content:""}.ri-battery-charge-fill:before{content:""}.ri-battery-charge-line:before{content:""}.ri-battery-fill:before{content:""}.ri-battery-line:before{content:""}.ri-battery-low-fill:before{content:""}.ri-battery-low-line:before{content:""}.ri-battery-saver-fill:before{content:""}.ri-battery-saver-line:before{content:""}.ri-battery-share-fill:before{content:""}.ri-battery-share-line:before{content:""}.ri-bear-smile-fill:before{content:""}.ri-bear-smile-line:before{content:""}.ri-behance-fill:before{content:""}.ri-behance-line:before{content:""}.ri-bell-fill:before{content:""}.ri-bell-line:before{content:""}.ri-bike-fill:before{content:""}.ri-bike-line:before{content:""}.ri-bilibili-fill:before{content:""}.ri-bilibili-line:before{content:""}.ri-bill-fill:before{content:""}.ri-bill-line:before{content:""}.ri-billiards-fill:before{content:""}.ri-billiards-line:before{content:""}.ri-bit-coin-fill:before{content:""}.ri-bit-coin-line:before{content:""}.ri-blaze-fill:before{content:""}.ri-blaze-line:before{content:""}.ri-bluetooth-connect-fill:before{content:""}.ri-bluetooth-connect-line:before{content:""}.ri-bluetooth-fill:before{content:""}.ri-bluetooth-line:before{content:""}.ri-blur-off-fill:before{content:""}.ri-blur-off-line:before{content:""}.ri-body-scan-fill:before{content:""}.ri-body-scan-line:before{content:""}.ri-bold:before{content:""}.ri-book-2-fill:before{content:""}.ri-book-2-line:before{content:""}.ri-book-3-fill:before{content:""}.ri-book-3-line:before{content:""}.ri-book-fill:before{content:""}.ri-book-line:before{content:""}.ri-book-mark-fill:before{content:""}.ri-book-mark-line:before{content:""}.ri-book-open-fill:before{content:""}.ri-book-open-line:before{content:""}.ri-book-read-fill:before{content:""}.ri-book-read-line:before{content:""}.ri-booklet-fill:before{content:""}.ri-booklet-line:before{content:""}.ri-bookmark-2-fill:before{content:""}.ri-bookmark-2-line:before{content:""}.ri-bookmark-3-fill:before{content:""}.ri-bookmark-3-line:before{content:""}.ri-bookmark-fill:before{content:""}.ri-bookmark-line:before{content:""}.ri-boxing-fill:before{content:""}.ri-boxing-line:before{content:""}.ri-braces-fill:before{content:""}.ri-braces-line:before{content:""}.ri-brackets-fill:before{content:""}.ri-brackets-line:before{content:""}.ri-briefcase-2-fill:before{content:""}.ri-briefcase-2-line:before{content:""}.ri-briefcase-3-fill:before{content:""}.ri-briefcase-3-line:before{content:""}.ri-briefcase-4-fill:before{content:""}.ri-briefcase-4-line:before{content:""}.ri-briefcase-5-fill:before{content:""}.ri-briefcase-5-line:before{content:""}.ri-briefcase-fill:before{content:""}.ri-briefcase-line:before{content:""}.ri-bring-forward:before{content:""}.ri-bring-to-front:before{content:""}.ri-broadcast-fill:before{content:""}.ri-broadcast-line:before{content:""}.ri-brush-2-fill:before{content:""}.ri-brush-2-line:before{content:""}.ri-brush-3-fill:before{content:""}.ri-brush-3-line:before{content:""}.ri-brush-4-fill:before{content:""}.ri-brush-4-line:before{content:""}.ri-brush-fill:before{content:""}.ri-brush-line:before{content:""}.ri-bubble-chart-fill:before{content:""}.ri-bubble-chart-line:before{content:""}.ri-bug-2-fill:before{content:""}.ri-bug-2-line:before{content:""}.ri-bug-fill:before{content:""}.ri-bug-line:before{content:""}.ri-building-2-fill:before{content:""}.ri-building-2-line:before{content:""}.ri-building-3-fill:before{content:""}.ri-building-3-line:before{content:""}.ri-building-4-fill:before{content:""}.ri-building-4-line:before{content:""}.ri-building-fill:before{content:""}.ri-building-line:before{content:""}.ri-bus-2-fill:before{content:""}.ri-bus-2-line:before{content:""}.ri-bus-fill:before{content:""}.ri-bus-line:before{content:""}.ri-bus-wifi-fill:before{content:""}.ri-bus-wifi-line:before{content:""}.ri-cactus-fill:before{content:""}.ri-cactus-line:before{content:""}.ri-cake-2-fill:before{content:""}.ri-cake-2-line:before{content:""}.ri-cake-3-fill:before{content:""}.ri-cake-3-line:before{content:""}.ri-cake-fill:before{content:""}.ri-cake-line:before{content:""}.ri-calculator-fill:before{content:""}.ri-calculator-line:before{content:""}.ri-calendar-2-fill:before{content:""}.ri-calendar-2-line:before{content:""}.ri-calendar-check-fill:before{content:""}.ri-calendar-check-line:before{content:""}.ri-calendar-event-fill:before{content:""}.ri-calendar-event-line:before{content:""}.ri-calendar-fill:before{content:""}.ri-calendar-line:before{content:""}.ri-calendar-todo-fill:before{content:""}.ri-calendar-todo-line:before{content:""}.ri-camera-2-fill:before{content:""}.ri-camera-2-line:before{content:""}.ri-camera-3-fill:before{content:""}.ri-camera-3-line:before{content:""}.ri-camera-fill:before{content:""}.ri-camera-lens-fill:before{content:""}.ri-camera-lens-line:before{content:""}.ri-camera-line:before{content:""}.ri-camera-off-fill:before{content:""}.ri-camera-off-line:before{content:""}.ri-camera-switch-fill:before{content:""}.ri-camera-switch-line:before{content:""}.ri-capsule-fill:before{content:""}.ri-capsule-line:before{content:""}.ri-car-fill:before{content:""}.ri-car-line:before{content:""}.ri-car-washing-fill:before{content:""}.ri-car-washing-line:before{content:""}.ri-caravan-fill:before{content:""}.ri-caravan-line:before{content:""}.ri-cast-fill:before{content:""}.ri-cast-line:before{content:""}.ri-cellphone-fill:before{content:""}.ri-cellphone-line:before{content:""}.ri-celsius-fill:before{content:""}.ri-celsius-line:before{content:""}.ri-centos-fill:before{content:""}.ri-centos-line:before{content:""}.ri-character-recognition-fill:before{content:""}.ri-character-recognition-line:before{content:""}.ri-charging-pile-2-fill:before{content:""}.ri-charging-pile-2-line:before{content:""}.ri-charging-pile-fill:before{content:""}.ri-charging-pile-line:before{content:""}.ri-chat-1-fill:before{content:""}.ri-chat-1-line:before{content:""}.ri-chat-2-fill:before{content:""}.ri-chat-2-line:before{content:""}.ri-chat-3-fill:before{content:""}.ri-chat-3-line:before{content:""}.ri-chat-4-fill:before{content:""}.ri-chat-4-line:before{content:""}.ri-chat-check-fill:before{content:""}.ri-chat-check-line:before{content:""}.ri-chat-delete-fill:before{content:""}.ri-chat-delete-line:before{content:""}.ri-chat-download-fill:before{content:""}.ri-chat-download-line:before{content:""}.ri-chat-follow-up-fill:before{content:""}.ri-chat-follow-up-line:before{content:""}.ri-chat-forward-fill:before{content:""}.ri-chat-forward-line:before{content:""}.ri-chat-heart-fill:before{content:""}.ri-chat-heart-line:before{content:""}.ri-chat-history-fill:before{content:""}.ri-chat-history-line:before{content:""}.ri-chat-new-fill:before{content:""}.ri-chat-new-line:before{content:""}.ri-chat-off-fill:before{content:""}.ri-chat-off-line:before{content:""}.ri-chat-poll-fill:before{content:""}.ri-chat-poll-line:before{content:""}.ri-chat-private-fill:before{content:""}.ri-chat-private-line:before{content:""}.ri-chat-quote-fill:before{content:""}.ri-chat-quote-line:before{content:""}.ri-chat-settings-fill:before{content:""}.ri-chat-settings-line:before{content:""}.ri-chat-smile-2-fill:before{content:""}.ri-chat-smile-2-line:before{content:""}.ri-chat-smile-3-fill:before{content:""}.ri-chat-smile-3-line:before{content:""}.ri-chat-smile-fill:before{content:""}.ri-chat-smile-line:before{content:""}.ri-chat-upload-fill:before{content:""}.ri-chat-upload-line:before{content:""}.ri-chat-voice-fill:before{content:""}.ri-chat-voice-line:before{content:""}.ri-check-double-fill:before{content:""}.ri-check-double-line:before{content:""}.ri-check-fill:before{content:""}.ri-check-line:before{content:""}.ri-checkbox-blank-circle-fill:before{content:""}.ri-checkbox-blank-circle-line:before{content:""}.ri-checkbox-blank-fill:before{content:""}.ri-checkbox-blank-line:before{content:""}.ri-checkbox-circle-fill:before{content:""}.ri-checkbox-circle-line:before{content:""}.ri-checkbox-fill:before{content:""}.ri-checkbox-indeterminate-fill:before{content:""}.ri-checkbox-indeterminate-line:before{content:""}.ri-checkbox-line:before{content:""}.ri-checkbox-multiple-blank-fill:before{content:""}.ri-checkbox-multiple-blank-line:before{content:""}.ri-checkbox-multiple-fill:before{content:""}.ri-checkbox-multiple-line:before{content:""}.ri-china-railway-fill:before{content:""}.ri-china-railway-line:before{content:""}.ri-chrome-fill:before{content:""}.ri-chrome-line:before{content:""}.ri-clapperboard-fill:before{content:""}.ri-clapperboard-line:before{content:""}.ri-clipboard-fill:before{content:""}.ri-clipboard-line:before{content:""}.ri-clockwise-2-fill:before{content:""}.ri-clockwise-2-line:before{content:""}.ri-clockwise-fill:before{content:""}.ri-clockwise-line:before{content:""}.ri-close-circle-fill:before{content:""}.ri-close-circle-line:before{content:""}.ri-close-fill:before{content:""}.ri-close-line:before{content:""}.ri-closed-captioning-fill:before{content:""}.ri-closed-captioning-line:before{content:""}.ri-cloud-fill:before{content:""}.ri-cloud-line:before{content:""}.ri-cloud-off-fill:before{content:""}.ri-cloud-off-line:before{content:""}.ri-cloud-windy-fill:before{content:""}.ri-cloud-windy-line:before{content:""}.ri-cloudy-2-fill:before{content:""}.ri-cloudy-2-line:before{content:""}.ri-cloudy-fill:before{content:""}.ri-cloudy-line:before{content:""}.ri-code-box-fill:before{content:""}.ri-code-box-line:before{content:""}.ri-code-fill:before{content:""}.ri-code-line:before{content:""}.ri-code-s-fill:before{content:""}.ri-code-s-line:before{content:""}.ri-code-s-slash-fill:before{content:""}.ri-code-s-slash-line:before{content:""}.ri-code-view:before{content:""}.ri-codepen-fill:before{content:""}.ri-codepen-line:before{content:""}.ri-coin-fill:before{content:""}.ri-coin-line:before{content:""}.ri-coins-fill:before{content:""}.ri-coins-line:before{content:""}.ri-collage-fill:before{content:""}.ri-collage-line:before{content:""}.ri-command-fill:before{content:""}.ri-command-line:before{content:""}.ri-community-fill:before{content:""}.ri-community-line:before{content:""}.ri-compass-2-fill:before{content:""}.ri-compass-2-line:before{content:""}.ri-compass-3-fill:before{content:""}.ri-compass-3-line:before{content:""}.ri-compass-4-fill:before{content:""}.ri-compass-4-line:before{content:""}.ri-compass-discover-fill:before{content:""}.ri-compass-discover-line:before{content:""}.ri-compass-fill:before{content:""}.ri-compass-line:before{content:""}.ri-compasses-2-fill:before{content:""}.ri-compasses-2-line:before{content:""}.ri-compasses-fill:before{content:""}.ri-compasses-line:before{content:""}.ri-computer-fill:before{content:""}.ri-computer-line:before{content:""}.ri-contacts-book-2-fill:before{content:""}.ri-contacts-book-2-line:before{content:""}.ri-contacts-book-fill:before{content:""}.ri-contacts-book-line:before{content:""}.ri-contacts-book-upload-fill:before{content:""}.ri-contacts-book-upload-line:before{content:""}.ri-contacts-fill:before{content:""}.ri-contacts-line:before{content:""}.ri-contrast-2-fill:before{content:""}.ri-contrast-2-line:before{content:""}.ri-contrast-drop-2-fill:before{content:""}.ri-contrast-drop-2-line:before{content:""}.ri-contrast-drop-fill:before{content:""}.ri-contrast-drop-line:before{content:""}.ri-contrast-fill:before{content:""}.ri-contrast-line:before{content:""}.ri-copper-coin-fill:before{content:""}.ri-copper-coin-line:before{content:""}.ri-copper-diamond-fill:before{content:""}.ri-copper-diamond-line:before{content:""}.ri-copyleft-fill:before{content:""}.ri-copyleft-line:before{content:""}.ri-copyright-fill:before{content:""}.ri-copyright-line:before{content:""}.ri-coreos-fill:before{content:""}.ri-coreos-line:before{content:""}.ri-coupon-2-fill:before{content:""}.ri-coupon-2-line:before{content:""}.ri-coupon-3-fill:before{content:""}.ri-coupon-3-line:before{content:""}.ri-coupon-4-fill:before{content:""}.ri-coupon-4-line:before{content:""}.ri-coupon-5-fill:before{content:""}.ri-coupon-5-line:before{content:""}.ri-coupon-fill:before{content:""}.ri-coupon-line:before{content:""}.ri-cpu-fill:before{content:""}.ri-cpu-line:before{content:""}.ri-creative-commons-by-fill:before{content:""}.ri-creative-commons-by-line:before{content:""}.ri-creative-commons-fill:before{content:""}.ri-creative-commons-line:before{content:""}.ri-creative-commons-nc-fill:before{content:""}.ri-creative-commons-nc-line:before{content:""}.ri-creative-commons-nd-fill:before{content:""}.ri-creative-commons-nd-line:before{content:""}.ri-creative-commons-sa-fill:before{content:""}.ri-creative-commons-sa-line:before{content:""}.ri-creative-commons-zero-fill:before{content:""}.ri-creative-commons-zero-line:before{content:""}.ri-criminal-fill:before{content:""}.ri-criminal-line:before{content:""}.ri-crop-2-fill:before{content:""}.ri-crop-2-line:before{content:""}.ri-crop-fill:before{content:""}.ri-crop-line:before{content:""}.ri-css3-fill:before{content:""}.ri-css3-line:before{content:""}.ri-cup-fill:before{content:""}.ri-cup-line:before{content:""}.ri-currency-fill:before{content:""}.ri-currency-line:before{content:""}.ri-cursor-fill:before{content:""}.ri-cursor-line:before{content:""}.ri-customer-service-2-fill:before{content:""}.ri-customer-service-2-line:before{content:""}.ri-customer-service-fill:before{content:""}.ri-customer-service-line:before{content:""}.ri-dashboard-2-fill:before{content:""}.ri-dashboard-2-line:before{content:""}.ri-dashboard-3-fill:before{content:""}.ri-dashboard-3-line:before{content:""}.ri-dashboard-fill:before{content:""}.ri-dashboard-line:before{content:""}.ri-database-2-fill:before{content:""}.ri-database-2-line:before{content:""}.ri-database-fill:before{content:""}.ri-database-line:before{content:""}.ri-delete-back-2-fill:before{content:""}.ri-delete-back-2-line:before{content:""}.ri-delete-back-fill:before{content:""}.ri-delete-back-line:before{content:""}.ri-delete-bin-2-fill:before{content:""}.ri-delete-bin-2-line:before{content:""}.ri-delete-bin-3-fill:before{content:""}.ri-delete-bin-3-line:before{content:""}.ri-delete-bin-4-fill:before{content:""}.ri-delete-bin-4-line:before{content:""}.ri-delete-bin-5-fill:before{content:""}.ri-delete-bin-5-line:before{content:""}.ri-delete-bin-6-fill:before{content:""}.ri-delete-bin-6-line:before{content:""}.ri-delete-bin-7-fill:before{content:""}.ri-delete-bin-7-line:before{content:""}.ri-delete-bin-fill:before{content:""}.ri-delete-bin-line:before{content:""}.ri-delete-column:before{content:""}.ri-delete-row:before{content:""}.ri-device-fill:before{content:""}.ri-device-line:before{content:""}.ri-device-recover-fill:before{content:""}.ri-device-recover-line:before{content:""}.ri-dingding-fill:before{content:""}.ri-dingding-line:before{content:""}.ri-direction-fill:before{content:""}.ri-direction-line:before{content:""}.ri-disc-fill:before{content:""}.ri-disc-line:before{content:""}.ri-discord-fill:before{content:""}.ri-discord-line:before{content:""}.ri-discuss-fill:before{content:""}.ri-discuss-line:before{content:""}.ri-dislike-fill:before{content:""}.ri-dislike-line:before{content:""}.ri-disqus-fill:before{content:""}.ri-disqus-line:before{content:""}.ri-divide-fill:before{content:""}.ri-divide-line:before{content:""}.ri-donut-chart-fill:before{content:""}.ri-donut-chart-line:before{content:""}.ri-door-closed-fill:before{content:""}.ri-door-closed-line:before{content:""}.ri-door-fill:before{content:""}.ri-door-line:before{content:""}.ri-door-lock-box-fill:before{content:""}.ri-door-lock-box-line:before{content:""}.ri-door-lock-fill:before{content:""}.ri-door-lock-line:before{content:""}.ri-door-open-fill:before{content:""}.ri-door-open-line:before{content:""}.ri-dossier-fill:before{content:""}.ri-dossier-line:before{content:""}.ri-douban-fill:before{content:""}.ri-douban-line:before{content:""}.ri-double-quotes-l:before{content:""}.ri-double-quotes-r:before{content:""}.ri-download-2-fill:before{content:""}.ri-download-2-line:before{content:""}.ri-download-cloud-2-fill:before{content:""}.ri-download-cloud-2-line:before{content:""}.ri-download-cloud-fill:before{content:""}.ri-download-cloud-line:before{content:""}.ri-download-fill:before{content:""}.ri-download-line:before{content:""}.ri-draft-fill:before{content:""}.ri-draft-line:before{content:""}.ri-drag-drop-fill:before{content:""}.ri-drag-drop-line:before{content:""}.ri-drag-move-2-fill:before{content:""}.ri-drag-move-2-line:before{content:""}.ri-drag-move-fill:before{content:""}.ri-drag-move-line:before{content:""}.ri-dribbble-fill:before{content:""}.ri-dribbble-line:before{content:""}.ri-drive-fill:before{content:""}.ri-drive-line:before{content:""}.ri-drizzle-fill:before{content:""}.ri-drizzle-line:before{content:""}.ri-drop-fill:before{content:""}.ri-drop-line:before{content:""}.ri-dropbox-fill:before{content:""}.ri-dropbox-line:before{content:""}.ri-dual-sim-1-fill:before{content:""}.ri-dual-sim-1-line:before{content:""}.ri-dual-sim-2-fill:before{content:""}.ri-dual-sim-2-line:before{content:""}.ri-dv-fill:before{content:""}.ri-dv-line:before{content:""}.ri-dvd-fill:before{content:""}.ri-dvd-line:before{content:""}.ri-e-bike-2-fill:before{content:""}.ri-e-bike-2-line:before{content:""}.ri-e-bike-fill:before{content:""}.ri-e-bike-line:before{content:""}.ri-earth-fill:before{content:""}.ri-earth-line:before{content:""}.ri-earthquake-fill:before{content:""}.ri-earthquake-line:before{content:""}.ri-edge-fill:before{content:""}.ri-edge-line:before{content:""}.ri-edit-2-fill:before{content:""}.ri-edit-2-line:before{content:""}.ri-edit-box-fill:before{content:""}.ri-edit-box-line:before{content:""}.ri-edit-circle-fill:before{content:""}.ri-edit-circle-line:before{content:""}.ri-edit-fill:before{content:""}.ri-edit-line:before{content:""}.ri-eject-fill:before{content:""}.ri-eject-line:before{content:""}.ri-emotion-2-fill:before{content:""}.ri-emotion-2-line:before{content:""}.ri-emotion-fill:before{content:""}.ri-emotion-happy-fill:before{content:""}.ri-emotion-happy-line:before{content:""}.ri-emotion-laugh-fill:before{content:""}.ri-emotion-laugh-line:before{content:""}.ri-emotion-line:before{content:""}.ri-emotion-normal-fill:before{content:""}.ri-emotion-normal-line:before{content:""}.ri-emotion-sad-fill:before{content:""}.ri-emotion-sad-line:before{content:""}.ri-emotion-unhappy-fill:before{content:""}.ri-emotion-unhappy-line:before{content:""}.ri-empathize-fill:before{content:""}.ri-empathize-line:before{content:""}.ri-emphasis-cn:before{content:""}.ri-emphasis:before{content:""}.ri-english-input:before{content:""}.ri-equalizer-fill:before{content:""}.ri-equalizer-line:before{content:""}.ri-eraser-fill:before{content:""}.ri-eraser-line:before{content:""}.ri-error-warning-fill:before{content:""}.ri-error-warning-line:before{content:""}.ri-evernote-fill:before{content:""}.ri-evernote-line:before{content:""}.ri-exchange-box-fill:before{content:""}.ri-exchange-box-line:before{content:""}.ri-exchange-cny-fill:before{content:""}.ri-exchange-cny-line:before{content:""}.ri-exchange-dollar-fill:before{content:""}.ri-exchange-dollar-line:before{content:""}.ri-exchange-fill:before{content:""}.ri-exchange-funds-fill:before{content:""}.ri-exchange-funds-line:before{content:""}.ri-exchange-line:before{content:""}.ri-external-link-fill:before{content:""}.ri-external-link-line:before{content:""}.ri-eye-2-fill:before{content:""}.ri-eye-2-line:before{content:""}.ri-eye-close-fill:before{content:""}.ri-eye-close-line:before{content:""}.ri-eye-fill:before{content:""}.ri-eye-line:before{content:""}.ri-eye-off-fill:before{content:""}.ri-eye-off-line:before{content:""}.ri-facebook-box-fill:before{content:""}.ri-facebook-box-line:before{content:""}.ri-facebook-circle-fill:before{content:""}.ri-facebook-circle-line:before{content:""}.ri-facebook-fill:before{content:""}.ri-facebook-line:before{content:""}.ri-fahrenheit-fill:before{content:""}.ri-fahrenheit-line:before{content:""}.ri-feedback-fill:before{content:""}.ri-feedback-line:before{content:""}.ri-file-2-fill:before{content:""}.ri-file-2-line:before{content:""}.ri-file-3-fill:before{content:""}.ri-file-3-line:before{content:""}.ri-file-4-fill:before{content:""}.ri-file-4-line:before{content:""}.ri-file-add-fill:before{content:""}.ri-file-add-line:before{content:""}.ri-file-chart-2-fill:before{content:""}.ri-file-chart-2-line:before{content:""}.ri-file-chart-fill:before{content:""}.ri-file-chart-line:before{content:""}.ri-file-cloud-fill:before{content:""}.ri-file-cloud-line:before{content:""}.ri-file-code-fill:before{content:""}.ri-file-code-line:before{content:""}.ri-file-copy-2-fill:before{content:""}.ri-file-copy-2-line:before{content:""}.ri-file-copy-fill:before{content:""}.ri-file-copy-line:before{content:""}.ri-file-damage-fill:before{content:""}.ri-file-damage-line:before{content:""}.ri-file-download-fill:before{content:""}.ri-file-download-line:before{content:""}.ri-file-edit-fill:before{content:""}.ri-file-edit-line:before{content:""}.ri-file-excel-2-fill:before{content:""}.ri-file-excel-2-line:before{content:""}.ri-file-excel-fill:before{content:""}.ri-file-excel-line:before{content:""}.ri-file-fill:before{content:""}.ri-file-forbid-fill:before{content:""}.ri-file-forbid-line:before{content:""}.ri-file-gif-fill:before{content:""}.ri-file-gif-line:before{content:""}.ri-file-history-fill:before{content:""}.ri-file-history-line:before{content:""}.ri-file-hwp-fill:before{content:""}.ri-file-hwp-line:before{content:""}.ri-file-info-fill:before{content:""}.ri-file-info-line:before{content:""}.ri-file-line:before{content:""}.ri-file-list-2-fill:before{content:""}.ri-file-list-2-line:before{content:""}.ri-file-list-3-fill:before{content:""}.ri-file-list-3-line:before{content:""}.ri-file-list-fill:before{content:""}.ri-file-list-line:before{content:""}.ri-file-lock-fill:before{content:""}.ri-file-lock-line:before{content:""}.ri-file-mark-fill:before{content:""}.ri-file-mark-line:before{content:""}.ri-file-music-fill:before{content:""}.ri-file-music-line:before{content:""}.ri-file-paper-2-fill:before{content:""}.ri-file-paper-2-line:before{content:""}.ri-file-paper-fill:before{content:""}.ri-file-paper-line:before{content:""}.ri-file-pdf-fill:before{content:""}.ri-file-pdf-line:before{content:""}.ri-file-ppt-2-fill:before{content:""}.ri-file-ppt-2-line:before{content:""}.ri-file-ppt-fill:before{content:""}.ri-file-ppt-line:before{content:""}.ri-file-reduce-fill:before{content:""}.ri-file-reduce-line:before{content:""}.ri-file-search-fill:before{content:""}.ri-file-search-line:before{content:""}.ri-file-settings-fill:before{content:""}.ri-file-settings-line:before{content:""}.ri-file-shield-2-fill:before{content:""}.ri-file-shield-2-line:before{content:""}.ri-file-shield-fill:before{content:""}.ri-file-shield-line:before{content:""}.ri-file-shred-fill:before{content:""}.ri-file-shred-line:before{content:""}.ri-file-text-fill:before{content:""}.ri-file-text-line:before{content:""}.ri-file-transfer-fill:before{content:""}.ri-file-transfer-line:before{content:""}.ri-file-unknow-fill:before{content:""}.ri-file-unknow-line:before{content:""}.ri-file-upload-fill:before{content:""}.ri-file-upload-line:before{content:""}.ri-file-user-fill:before{content:""}.ri-file-user-line:before{content:""}.ri-file-warning-fill:before{content:""}.ri-file-warning-line:before{content:""}.ri-file-word-2-fill:before{content:""}.ri-file-word-2-line:before{content:""}.ri-file-word-fill:before{content:""}.ri-file-word-line:before{content:""}.ri-file-zip-fill:before{content:""}.ri-file-zip-line:before{content:""}.ri-film-fill:before{content:""}.ri-film-line:before{content:""}.ri-filter-2-fill:before{content:""}.ri-filter-2-line:before{content:""}.ri-filter-3-fill:before{content:""}.ri-filter-3-line:before{content:""}.ri-filter-fill:before{content:""}.ri-filter-line:before{content:""}.ri-filter-off-fill:before{content:""}.ri-filter-off-line:before{content:""}.ri-find-replace-fill:before{content:""}.ri-find-replace-line:before{content:""}.ri-finder-fill:before{content:""}.ri-finder-line:before{content:""}.ri-fingerprint-2-fill:before{content:""}.ri-fingerprint-2-line:before{content:""}.ri-fingerprint-fill:before{content:""}.ri-fingerprint-line:before{content:""}.ri-fire-fill:before{content:""}.ri-fire-line:before{content:""}.ri-firefox-fill:before{content:""}.ri-firefox-line:before{content:""}.ri-first-aid-kit-fill:before{content:""}.ri-first-aid-kit-line:before{content:""}.ri-flag-2-fill:before{content:""}.ri-flag-2-line:before{content:""}.ri-flag-fill:before{content:""}.ri-flag-line:before{content:""}.ri-flashlight-fill:before{content:""}.ri-flashlight-line:before{content:""}.ri-flask-fill:before{content:""}.ri-flask-line:before{content:""}.ri-flight-land-fill:before{content:""}.ri-flight-land-line:before{content:""}.ri-flight-takeoff-fill:before{content:""}.ri-flight-takeoff-line:before{content:""}.ri-flood-fill:before{content:""}.ri-flood-line:before{content:""}.ri-flow-chart:before{content:""}.ri-flutter-fill:before{content:""}.ri-flutter-line:before{content:""}.ri-focus-2-fill:before{content:""}.ri-focus-2-line:before{content:""}.ri-focus-3-fill:before{content:""}.ri-focus-3-line:before{content:""}.ri-focus-fill:before{content:""}.ri-focus-line:before{content:""}.ri-foggy-fill:before{content:""}.ri-foggy-line:before{content:""}.ri-folder-2-fill:before{content:""}.ri-folder-2-line:before{content:""}.ri-folder-3-fill:before{content:""}.ri-folder-3-line:before{content:""}.ri-folder-4-fill:before{content:""}.ri-folder-4-line:before{content:""}.ri-folder-5-fill:before{content:""}.ri-folder-5-line:before{content:""}.ri-folder-add-fill:before{content:""}.ri-folder-add-line:before{content:""}.ri-folder-chart-2-fill:before{content:""}.ri-folder-chart-2-line:before{content:""}.ri-folder-chart-fill:before{content:""}.ri-folder-chart-line:before{content:""}.ri-folder-download-fill:before{content:""}.ri-folder-download-line:before{content:""}.ri-folder-fill:before{content:""}.ri-folder-forbid-fill:before{content:""}.ri-folder-forbid-line:before{content:""}.ri-folder-history-fill:before{content:""}.ri-folder-history-line:before{content:""}.ri-folder-info-fill:before{content:""}.ri-folder-info-line:before{content:""}.ri-folder-keyhole-fill:before{content:""}.ri-folder-keyhole-line:before{content:""}.ri-folder-line:before{content:""}.ri-folder-lock-fill:before{content:""}.ri-folder-lock-line:before{content:""}.ri-folder-music-fill:before{content:""}.ri-folder-music-line:before{content:""}.ri-folder-open-fill:before{content:""}.ri-folder-open-line:before{content:""}.ri-folder-received-fill:before{content:""}.ri-folder-received-line:before{content:""}.ri-folder-reduce-fill:before{content:""}.ri-folder-reduce-line:before{content:""}.ri-folder-settings-fill:before{content:""}.ri-folder-settings-line:before{content:""}.ri-folder-shared-fill:before{content:""}.ri-folder-shared-line:before{content:""}.ri-folder-shield-2-fill:before{content:""}.ri-folder-shield-2-line:before{content:""}.ri-folder-shield-fill:before{content:""}.ri-folder-shield-line:before{content:""}.ri-folder-transfer-fill:before{content:""}.ri-folder-transfer-line:before{content:""}.ri-folder-unknow-fill:before{content:""}.ri-folder-unknow-line:before{content:""}.ri-folder-upload-fill:before{content:""}.ri-folder-upload-line:before{content:""}.ri-folder-user-fill:before{content:""}.ri-folder-user-line:before{content:""}.ri-folder-warning-fill:before{content:""}.ri-folder-warning-line:before{content:""}.ri-folder-zip-fill:before{content:""}.ri-folder-zip-line:before{content:""}.ri-folders-fill:before{content:""}.ri-folders-line:before{content:""}.ri-font-color:before{content:""}.ri-font-size-2:before{content:""}.ri-font-size:before{content:""}.ri-football-fill:before{content:""}.ri-football-line:before{content:""}.ri-footprint-fill:before{content:""}.ri-footprint-line:before{content:""}.ri-forbid-2-fill:before{content:""}.ri-forbid-2-line:before{content:""}.ri-forbid-fill:before{content:""}.ri-forbid-line:before{content:""}.ri-format-clear:before{content:""}.ri-fridge-fill:before{content:""}.ri-fridge-line:before{content:""}.ri-fullscreen-exit-fill:before{content:""}.ri-fullscreen-exit-line:before{content:""}.ri-fullscreen-fill:before{content:""}.ri-fullscreen-line:before{content:""}.ri-function-fill:before{content:""}.ri-function-line:before{content:""}.ri-functions:before{content:""}.ri-funds-box-fill:before{content:""}.ri-funds-box-line:before{content:""}.ri-funds-fill:before{content:""}.ri-funds-line:before{content:""}.ri-gallery-fill:before{content:""}.ri-gallery-line:before{content:""}.ri-gallery-upload-fill:before{content:""}.ri-gallery-upload-line:before{content:""}.ri-game-fill:before{content:""}.ri-game-line:before{content:""}.ri-gamepad-fill:before{content:""}.ri-gamepad-line:before{content:""}.ri-gas-station-fill:before{content:""}.ri-gas-station-line:before{content:""}.ri-gatsby-fill:before{content:""}.ri-gatsby-line:before{content:""}.ri-genderless-fill:before{content:""}.ri-genderless-line:before{content:""}.ri-ghost-2-fill:before{content:""}.ri-ghost-2-line:before{content:""}.ri-ghost-fill:before{content:""}.ri-ghost-line:before{content:""}.ri-ghost-smile-fill:before{content:""}.ri-ghost-smile-line:before{content:""}.ri-gift-2-fill:before{content:""}.ri-gift-2-line:before{content:""}.ri-gift-fill:before{content:""}.ri-gift-line:before{content:""}.ri-git-branch-fill:before{content:""}.ri-git-branch-line:before{content:""}.ri-git-commit-fill:before{content:""}.ri-git-commit-line:before{content:""}.ri-git-merge-fill:before{content:""}.ri-git-merge-line:before{content:""}.ri-git-pull-request-fill:before{content:""}.ri-git-pull-request-line:before{content:""}.ri-git-repository-commits-fill:before{content:""}.ri-git-repository-commits-line:before{content:""}.ri-git-repository-fill:before{content:""}.ri-git-repository-line:before{content:""}.ri-git-repository-private-fill:before{content:""}.ri-git-repository-private-line:before{content:""}.ri-github-fill:before{content:""}.ri-github-line:before{content:""}.ri-gitlab-fill:before{content:""}.ri-gitlab-line:before{content:""}.ri-global-fill:before{content:""}.ri-global-line:before{content:""}.ri-globe-fill:before{content:""}.ri-globe-line:before{content:""}.ri-goblet-fill:before{content:""}.ri-goblet-line:before{content:""}.ri-google-fill:before{content:""}.ri-google-line:before{content:""}.ri-google-play-fill:before{content:""}.ri-google-play-line:before{content:""}.ri-government-fill:before{content:""}.ri-government-line:before{content:""}.ri-gps-fill:before{content:""}.ri-gps-line:before{content:""}.ri-gradienter-fill:before{content:""}.ri-gradienter-line:before{content:""}.ri-grid-fill:before{content:""}.ri-grid-line:before{content:""}.ri-group-2-fill:before{content:""}.ri-group-2-line:before{content:""}.ri-group-fill:before{content:""}.ri-group-line:before{content:""}.ri-guide-fill:before{content:""}.ri-guide-line:before{content:""}.ri-h-1:before{content:""}.ri-h-2:before{content:""}.ri-h-3:before{content:""}.ri-h-4:before{content:""}.ri-h-5:before{content:""}.ri-h-6:before{content:""}.ri-hail-fill:before{content:""}.ri-hail-line:before{content:""}.ri-hammer-fill:before{content:""}.ri-hammer-line:before{content:""}.ri-hand-coin-fill:before{content:""}.ri-hand-coin-line:before{content:""}.ri-hand-heart-fill:before{content:""}.ri-hand-heart-line:before{content:""}.ri-hand-sanitizer-fill:before{content:""}.ri-hand-sanitizer-line:before{content:""}.ri-handbag-fill:before{content:""}.ri-handbag-line:before{content:""}.ri-hard-drive-2-fill:before{content:""}.ri-hard-drive-2-line:before{content:""}.ri-hard-drive-fill:before{content:""}.ri-hard-drive-line:before{content:""}.ri-hashtag:before{content:""}.ri-haze-2-fill:before{content:""}.ri-haze-2-line:before{content:""}.ri-haze-fill:before{content:""}.ri-haze-line:before{content:""}.ri-hd-fill:before{content:""}.ri-hd-line:before{content:""}.ri-heading:before{content:""}.ri-headphone-fill:before{content:""}.ri-headphone-line:before{content:""}.ri-health-book-fill:before{content:""}.ri-health-book-line:before{content:""}.ri-heart-2-fill:before{content:""}.ri-heart-2-line:before{content:""}.ri-heart-3-fill:before{content:""}.ri-heart-3-line:before{content:""}.ri-heart-add-fill:before{content:""}.ri-heart-add-line:before{content:""}.ri-heart-fill:before{content:""}.ri-heart-line:before{content:""}.ri-heart-pulse-fill:before{content:""}.ri-heart-pulse-line:before{content:""}.ri-hearts-fill:before{content:""}.ri-hearts-line:before{content:""}.ri-heavy-showers-fill:before{content:""}.ri-heavy-showers-line:before{content:""}.ri-history-fill:before{content:""}.ri-history-line:before{content:""}.ri-home-2-fill:before{content:""}.ri-home-2-line:before{content:""}.ri-home-3-fill:before{content:""}.ri-home-3-line:before{content:""}.ri-home-4-fill:before{content:""}.ri-home-4-line:before{content:""}.ri-home-5-fill:before{content:""}.ri-home-5-line:before{content:""}.ri-home-6-fill:before{content:""}.ri-home-6-line:before{content:""}.ri-home-7-fill:before{content:""}.ri-home-7-line:before{content:""}.ri-home-8-fill:before{content:""}.ri-home-8-line:before{content:""}.ri-home-fill:before{content:""}.ri-home-gear-fill:before{content:""}.ri-home-gear-line:before{content:""}.ri-home-heart-fill:before{content:""}.ri-home-heart-line:before{content:""}.ri-home-line:before{content:""}.ri-home-smile-2-fill:before{content:""}.ri-home-smile-2-line:before{content:""}.ri-home-smile-fill:before{content:""}.ri-home-smile-line:before{content:""}.ri-home-wifi-fill:before{content:""}.ri-home-wifi-line:before{content:""}.ri-honor-of-kings-fill:before{content:""}.ri-honor-of-kings-line:before{content:""}.ri-honour-fill:before{content:""}.ri-honour-line:before{content:""}.ri-hospital-fill:before{content:""}.ri-hospital-line:before{content:""}.ri-hotel-bed-fill:before{content:""}.ri-hotel-bed-line:before{content:""}.ri-hotel-fill:before{content:""}.ri-hotel-line:before{content:""}.ri-hotspot-fill:before{content:""}.ri-hotspot-line:before{content:""}.ri-hq-fill:before{content:""}.ri-hq-line:before{content:""}.ri-html5-fill:before{content:""}.ri-html5-line:before{content:""}.ri-ie-fill:before{content:""}.ri-ie-line:before{content:""}.ri-image-2-fill:before{content:""}.ri-image-2-line:before{content:""}.ri-image-add-fill:before{content:""}.ri-image-add-line:before{content:""}.ri-image-edit-fill:before{content:""}.ri-image-edit-line:before{content:""}.ri-image-fill:before{content:""}.ri-image-line:before{content:""}.ri-inbox-archive-fill:before{content:""}.ri-inbox-archive-line:before{content:""}.ri-inbox-fill:before{content:""}.ri-inbox-line:before{content:""}.ri-inbox-unarchive-fill:before{content:""}.ri-inbox-unarchive-line:before{content:""}.ri-increase-decrease-fill:before{content:""}.ri-increase-decrease-line:before{content:""}.ri-indent-decrease:before{content:""}.ri-indent-increase:before{content:""}.ri-indeterminate-circle-fill:before{content:""}.ri-indeterminate-circle-line:before{content:""}.ri-information-fill:before{content:""}.ri-information-line:before{content:""}.ri-infrared-thermometer-fill:before{content:""}.ri-infrared-thermometer-line:before{content:""}.ri-ink-bottle-fill:before{content:""}.ri-ink-bottle-line:before{content:""}.ri-input-cursor-move:before{content:""}.ri-input-method-fill:before{content:""}.ri-input-method-line:before{content:""}.ri-insert-column-left:before{content:""}.ri-insert-column-right:before{content:""}.ri-insert-row-bottom:before{content:""}.ri-insert-row-top:before{content:""}.ri-instagram-fill:before{content:""}.ri-instagram-line:before{content:""}.ri-install-fill:before{content:""}.ri-install-line:before{content:""}.ri-invision-fill:before{content:""}.ri-invision-line:before{content:""}.ri-italic:before{content:""}.ri-kakao-talk-fill:before{content:""}.ri-kakao-talk-line:before{content:""}.ri-key-2-fill:before{content:""}.ri-key-2-line:before{content:""}.ri-key-fill:before{content:""}.ri-key-line:before{content:""}.ri-keyboard-box-fill:before{content:""}.ri-keyboard-box-line:before{content:""}.ri-keyboard-fill:before{content:""}.ri-keyboard-line:before{content:""}.ri-keynote-fill:before{content:""}.ri-keynote-line:before{content:""}.ri-knife-blood-fill:before{content:""}.ri-knife-blood-line:before{content:""}.ri-knife-fill:before{content:""}.ri-knife-line:before{content:""}.ri-landscape-fill:before{content:""}.ri-landscape-line:before{content:""}.ri-layout-2-fill:before{content:""}.ri-layout-2-line:before{content:""}.ri-layout-3-fill:before{content:""}.ri-layout-3-line:before{content:""}.ri-layout-4-fill:before{content:""}.ri-layout-4-line:before{content:""}.ri-layout-5-fill:before{content:""}.ri-layout-5-line:before{content:""}.ri-layout-6-fill:before{content:""}.ri-layout-6-line:before{content:""}.ri-layout-bottom-2-fill:before{content:""}.ri-layout-bottom-2-line:before{content:""}.ri-layout-bottom-fill:before{content:""}.ri-layout-bottom-line:before{content:""}.ri-layout-column-fill:before{content:""}.ri-layout-column-line:before{content:""}.ri-layout-fill:before{content:""}.ri-layout-grid-fill:before{content:""}.ri-layout-grid-line:before{content:""}.ri-layout-left-2-fill:before{content:""}.ri-layout-left-2-line:before{content:""}.ri-layout-left-fill:before{content:""}.ri-layout-left-line:before{content:""}.ri-layout-line:before{content:""}.ri-layout-masonry-fill:before{content:""}.ri-layout-masonry-line:before{content:""}.ri-layout-right-2-fill:before{content:""}.ri-layout-right-2-line:before{content:""}.ri-layout-right-fill:before{content:""}.ri-layout-right-line:before{content:""}.ri-layout-row-fill:before{content:""}.ri-layout-row-line:before{content:""}.ri-layout-top-2-fill:before{content:""}.ri-layout-top-2-line:before{content:""}.ri-layout-top-fill:before{content:""}.ri-layout-top-line:before{content:""}.ri-leaf-fill:before{content:""}.ri-leaf-line:before{content:""}.ri-lifebuoy-fill:before{content:""}.ri-lifebuoy-line:before{content:""}.ri-lightbulb-fill:before{content:""}.ri-lightbulb-flash-fill:before{content:""}.ri-lightbulb-flash-line:before{content:""}.ri-lightbulb-line:before{content:""}.ri-line-chart-fill:before{content:""}.ri-line-chart-line:before{content:""}.ri-line-fill:before{content:""}.ri-line-height:before{content:""}.ri-line-line:before{content:""}.ri-link-m:before{content:""}.ri-link-unlink-m:before{content:""}.ri-link-unlink:before{content:""}.ri-link:before{content:""}.ri-linkedin-box-fill:before{content:""}.ri-linkedin-box-line:before{content:""}.ri-linkedin-fill:before{content:""}.ri-linkedin-line:before{content:""}.ri-links-fill:before{content:""}.ri-links-line:before{content:""}.ri-list-check-2:before{content:""}.ri-list-check:before{content:""}.ri-list-ordered:before{content:""}.ri-list-settings-fill:before{content:""}.ri-list-settings-line:before{content:""}.ri-list-unordered:before{content:""}.ri-live-fill:before{content:""}.ri-live-line:before{content:""}.ri-loader-2-fill:before{content:""}.ri-loader-2-line:before{content:""}.ri-loader-3-fill:before{content:""}.ri-loader-3-line:before{content:""}.ri-loader-4-fill:before{content:""}.ri-loader-4-line:before{content:""}.ri-loader-5-fill:before{content:""}.ri-loader-5-line:before{content:""}.ri-loader-fill:before{content:""}.ri-loader-line:before{content:""}.ri-lock-2-fill:before{content:""}.ri-lock-2-line:before{content:""}.ri-lock-fill:before{content:""}.ri-lock-line:before{content:""}.ri-lock-password-fill:before{content:""}.ri-lock-password-line:before{content:""}.ri-lock-unlock-fill:before{content:""}.ri-lock-unlock-line:before{content:""}.ri-login-box-fill:before{content:""}.ri-login-box-line:before{content:""}.ri-login-circle-fill:before{content:""}.ri-login-circle-line:before{content:""}.ri-logout-box-fill:before{content:""}.ri-logout-box-line:before{content:""}.ri-logout-box-r-fill:before{content:""}.ri-logout-box-r-line:before{content:""}.ri-logout-circle-fill:before{content:""}.ri-logout-circle-line:before{content:""}.ri-logout-circle-r-fill:before{content:""}.ri-logout-circle-r-line:before{content:""}.ri-luggage-cart-fill:before{content:""}.ri-luggage-cart-line:before{content:""}.ri-luggage-deposit-fill:before{content:""}.ri-luggage-deposit-line:before{content:""}.ri-lungs-fill:before{content:""}.ri-lungs-line:before{content:""}.ri-mac-fill:before{content:""}.ri-mac-line:before{content:""}.ri-macbook-fill:before{content:""}.ri-macbook-line:before{content:""}.ri-magic-fill:before{content:""}.ri-magic-line:before{content:""}.ri-mail-add-fill:before{content:""}.ri-mail-add-line:before{content:""}.ri-mail-check-fill:before{content:""}.ri-mail-check-line:before{content:""}.ri-mail-close-fill:before{content:""}.ri-mail-close-line:before{content:""}.ri-mail-download-fill:before{content:""}.ri-mail-download-line:before{content:""}.ri-mail-fill:before{content:""}.ri-mail-forbid-fill:before{content:""}.ri-mail-forbid-line:before{content:""}.ri-mail-line:before{content:""}.ri-mail-lock-fill:before{content:""}.ri-mail-lock-line:before{content:""}.ri-mail-open-fill:before{content:""}.ri-mail-open-line:before{content:""}.ri-mail-send-fill:before{content:""}.ri-mail-send-line:before{content:""}.ri-mail-settings-fill:before{content:""}.ri-mail-settings-line:before{content:""}.ri-mail-star-fill:before{content:""}.ri-mail-star-line:before{content:""}.ri-mail-unread-fill:before{content:""}.ri-mail-unread-line:before{content:""}.ri-mail-volume-fill:before{content:""}.ri-mail-volume-line:before{content:""}.ri-map-2-fill:before{content:""}.ri-map-2-line:before{content:""}.ri-map-fill:before{content:""}.ri-map-line:before{content:""}.ri-map-pin-2-fill:before{content:""}.ri-map-pin-2-line:before{content:""}.ri-map-pin-3-fill:before{content:""}.ri-map-pin-3-line:before{content:""}.ri-map-pin-4-fill:before{content:""}.ri-map-pin-4-line:before{content:""}.ri-map-pin-5-fill:before{content:""}.ri-map-pin-5-line:before{content:""}.ri-map-pin-add-fill:before{content:""}.ri-map-pin-add-line:before{content:""}.ri-map-pin-fill:before{content:""}.ri-map-pin-line:before{content:""}.ri-map-pin-range-fill:before{content:""}.ri-map-pin-range-line:before{content:""}.ri-map-pin-time-fill:before{content:""}.ri-map-pin-time-line:before{content:""}.ri-map-pin-user-fill:before{content:""}.ri-map-pin-user-line:before{content:""}.ri-mark-pen-fill:before{content:""}.ri-mark-pen-line:before{content:""}.ri-markdown-fill:before{content:""}.ri-markdown-line:before{content:""}.ri-markup-fill:before{content:""}.ri-markup-line:before{content:""}.ri-mastercard-fill:before{content:""}.ri-mastercard-line:before{content:""}.ri-mastodon-fill:before{content:""}.ri-mastodon-line:before{content:""}.ri-medal-2-fill:before{content:""}.ri-medal-2-line:before{content:""}.ri-medal-fill:before{content:""}.ri-medal-line:before{content:""}.ri-medicine-bottle-fill:before{content:""}.ri-medicine-bottle-line:before{content:""}.ri-medium-fill:before{content:""}.ri-medium-line:before{content:""}.ri-men-fill:before{content:""}.ri-men-line:before{content:""}.ri-mental-health-fill:before{content:""}.ri-mental-health-line:before{content:""}.ri-menu-2-fill:before{content:""}.ri-menu-2-line:before{content:""}.ri-menu-3-fill:before{content:""}.ri-menu-3-line:before{content:""}.ri-menu-4-fill:before{content:""}.ri-menu-4-line:before{content:""}.ri-menu-5-fill:before{content:""}.ri-menu-5-line:before{content:""}.ri-menu-add-fill:before{content:""}.ri-menu-add-line:before{content:""}.ri-menu-fill:before{content:""}.ri-menu-fold-fill:before{content:""}.ri-menu-fold-line:before{content:""}.ri-menu-line:before{content:""}.ri-menu-unfold-fill:before{content:""}.ri-menu-unfold-line:before{content:""}.ri-merge-cells-horizontal:before{content:""}.ri-merge-cells-vertical:before{content:""}.ri-message-2-fill:before{content:""}.ri-message-2-line:before{content:""}.ri-message-3-fill:before{content:""}.ri-message-3-line:before{content:""}.ri-message-fill:before{content:""}.ri-message-line:before{content:""}.ri-messenger-fill:before{content:""}.ri-messenger-line:before{content:""}.ri-meteor-fill:before{content:""}.ri-meteor-line:before{content:""}.ri-mic-2-fill:before{content:""}.ri-mic-2-line:before{content:""}.ri-mic-fill:before{content:""}.ri-mic-line:before{content:""}.ri-mic-off-fill:before{content:""}.ri-mic-off-line:before{content:""}.ri-mickey-fill:before{content:""}.ri-mickey-line:before{content:""}.ri-microscope-fill:before{content:""}.ri-microscope-line:before{content:""}.ri-microsoft-fill:before{content:""}.ri-microsoft-line:before{content:""}.ri-mind-map:before{content:""}.ri-mini-program-fill:before{content:""}.ri-mini-program-line:before{content:""}.ri-mist-fill:before{content:""}.ri-mist-line:before{content:""}.ri-money-cny-box-fill:before{content:""}.ri-money-cny-box-line:before{content:""}.ri-money-cny-circle-fill:before{content:""}.ri-money-cny-circle-line:before{content:""}.ri-money-dollar-box-fill:before{content:""}.ri-money-dollar-box-line:before{content:""}.ri-money-dollar-circle-fill:before{content:""}.ri-money-dollar-circle-line:before{content:""}.ri-money-euro-box-fill:before{content:""}.ri-money-euro-box-line:before{content:""}.ri-money-euro-circle-fill:before{content:""}.ri-money-euro-circle-line:before{content:""}.ri-money-pound-box-fill:before{content:""}.ri-money-pound-box-line:before{content:""}.ri-money-pound-circle-fill:before{content:""}.ri-money-pound-circle-line:before{content:""}.ri-moon-clear-fill:before{content:""}.ri-moon-clear-line:before{content:""}.ri-moon-cloudy-fill:before{content:""}.ri-moon-cloudy-line:before{content:""}.ri-moon-fill:before{content:""}.ri-moon-foggy-fill:before{content:""}.ri-moon-foggy-line:before{content:""}.ri-moon-line:before{content:""}.ri-more-2-fill:before{content:""}.ri-more-2-line:before{content:""}.ri-more-fill:before{content:""}.ri-more-line:before{content:""}.ri-motorbike-fill:before{content:""}.ri-motorbike-line:before{content:""}.ri-mouse-fill:before{content:""}.ri-mouse-line:before{content:""}.ri-movie-2-fill:before{content:""}.ri-movie-2-line:before{content:""}.ri-movie-fill:before{content:""}.ri-movie-line:before{content:""}.ri-music-2-fill:before{content:""}.ri-music-2-line:before{content:""}.ri-music-fill:before{content:""}.ri-music-line:before{content:""}.ri-mv-fill:before{content:""}.ri-mv-line:before{content:""}.ri-navigation-fill:before{content:""}.ri-navigation-line:before{content:""}.ri-netease-cloud-music-fill:before{content:""}.ri-netease-cloud-music-line:before{content:""}.ri-netflix-fill:before{content:""}.ri-netflix-line:before{content:""}.ri-newspaper-fill:before{content:""}.ri-newspaper-line:before{content:""}.ri-node-tree:before{content:""}.ri-notification-2-fill:before{content:""}.ri-notification-2-line:before{content:""}.ri-notification-3-fill:before{content:""}.ri-notification-3-line:before{content:""}.ri-notification-4-fill:before{content:""}.ri-notification-4-line:before{content:""}.ri-notification-badge-fill:before{content:""}.ri-notification-badge-line:before{content:""}.ri-notification-fill:before{content:""}.ri-notification-line:before{content:""}.ri-notification-off-fill:before{content:""}.ri-notification-off-line:before{content:""}.ri-npmjs-fill:before{content:""}.ri-npmjs-line:before{content:""}.ri-number-0:before{content:""}.ri-number-1:before{content:""}.ri-number-2:before{content:""}.ri-number-3:before{content:""}.ri-number-4:before{content:""}.ri-number-5:before{content:""}.ri-number-6:before{content:""}.ri-number-7:before{content:""}.ri-number-8:before{content:""}.ri-number-9:before{content:""}.ri-numbers-fill:before{content:""}.ri-numbers-line:before{content:""}.ri-nurse-fill:before{content:""}.ri-nurse-line:before{content:""}.ri-oil-fill:before{content:""}.ri-oil-line:before{content:""}.ri-omega:before{content:""}.ri-open-arm-fill:before{content:""}.ri-open-arm-line:before{content:""}.ri-open-source-fill:before{content:""}.ri-open-source-line:before{content:""}.ri-opera-fill:before{content:""}.ri-opera-line:before{content:""}.ri-order-play-fill:before{content:""}.ri-order-play-line:before{content:""}.ri-organization-chart:before{content:""}.ri-outlet-2-fill:before{content:""}.ri-outlet-2-line:before{content:""}.ri-outlet-fill:before{content:""}.ri-outlet-line:before{content:""}.ri-page-separator:before{content:""}.ri-pages-fill:before{content:""}.ri-pages-line:before{content:""}.ri-paint-brush-fill:before{content:""}.ri-paint-brush-line:before{content:""}.ri-paint-fill:before{content:""}.ri-paint-line:before{content:""}.ri-palette-fill:before{content:""}.ri-palette-line:before{content:""}.ri-pantone-fill:before{content:""}.ri-pantone-line:before{content:""}.ri-paragraph:before{content:""}.ri-parent-fill:before{content:""}.ri-parent-line:before{content:""}.ri-parentheses-fill:before{content:""}.ri-parentheses-line:before{content:""}.ri-parking-box-fill:before{content:""}.ri-parking-box-line:before{content:""}.ri-parking-fill:before{content:""}.ri-parking-line:before{content:""}.ri-passport-fill:before{content:""}.ri-passport-line:before{content:""}.ri-patreon-fill:before{content:""}.ri-patreon-line:before{content:""}.ri-pause-circle-fill:before{content:""}.ri-pause-circle-line:before{content:""}.ri-pause-fill:before{content:""}.ri-pause-line:before{content:""}.ri-pause-mini-fill:before{content:""}.ri-pause-mini-line:before{content:""}.ri-paypal-fill:before{content:""}.ri-paypal-line:before{content:""}.ri-pen-nib-fill:before{content:""}.ri-pen-nib-line:before{content:""}.ri-pencil-fill:before{content:""}.ri-pencil-line:before{content:""}.ri-pencil-ruler-2-fill:before{content:""}.ri-pencil-ruler-2-line:before{content:""}.ri-pencil-ruler-fill:before{content:""}.ri-pencil-ruler-line:before{content:""}.ri-percent-fill:before{content:""}.ri-percent-line:before{content:""}.ri-phone-camera-fill:before{content:""}.ri-phone-camera-line:before{content:""}.ri-phone-fill:before{content:""}.ri-phone-find-fill:before{content:""}.ri-phone-find-line:before{content:""}.ri-phone-line:before{content:""}.ri-phone-lock-fill:before{content:""}.ri-phone-lock-line:before{content:""}.ri-picture-in-picture-2-fill:before{content:""}.ri-picture-in-picture-2-line:before{content:""}.ri-picture-in-picture-exit-fill:before{content:""}.ri-picture-in-picture-exit-line:before{content:""}.ri-picture-in-picture-fill:before{content:""}.ri-picture-in-picture-line:before{content:""}.ri-pie-chart-2-fill:before{content:""}.ri-pie-chart-2-line:before{content:""}.ri-pie-chart-box-fill:before{content:""}.ri-pie-chart-box-line:before{content:""}.ri-pie-chart-fill:before{content:""}.ri-pie-chart-line:before{content:""}.ri-pin-distance-fill:before{content:""}.ri-pin-distance-line:before{content:""}.ri-ping-pong-fill:before{content:""}.ri-ping-pong-line:before{content:""}.ri-pinterest-fill:before{content:""}.ri-pinterest-line:before{content:""}.ri-pinyin-input:before{content:""}.ri-pixelfed-fill:before{content:""}.ri-pixelfed-line:before{content:""}.ri-plane-fill:before{content:""}.ri-plane-line:before{content:""}.ri-plant-fill:before{content:""}.ri-plant-line:before{content:""}.ri-play-circle-fill:before{content:""}.ri-play-circle-line:before{content:""}.ri-play-fill:before{content:""}.ri-play-line:before{content:""}.ri-play-list-2-fill:before{content:""}.ri-play-list-2-line:before{content:""}.ri-play-list-add-fill:before{content:""}.ri-play-list-add-line:before{content:""}.ri-play-list-fill:before{content:""}.ri-play-list-line:before{content:""}.ri-play-mini-fill:before{content:""}.ri-play-mini-line:before{content:""}.ri-playstation-fill:before{content:""}.ri-playstation-line:before{content:""}.ri-plug-2-fill:before{content:""}.ri-plug-2-line:before{content:""}.ri-plug-fill:before{content:""}.ri-plug-line:before{content:""}.ri-polaroid-2-fill:before{content:""}.ri-polaroid-2-line:before{content:""}.ri-polaroid-fill:before{content:""}.ri-polaroid-line:before{content:""}.ri-police-car-fill:before{content:""}.ri-police-car-line:before{content:""}.ri-price-tag-2-fill:before{content:""}.ri-price-tag-2-line:before{content:""}.ri-price-tag-3-fill:before{content:""}.ri-price-tag-3-line:before{content:""}.ri-price-tag-fill:before{content:""}.ri-price-tag-line:before{content:""}.ri-printer-cloud-fill:before{content:""}.ri-printer-cloud-line:before{content:""}.ri-printer-fill:before{content:""}.ri-printer-line:before{content:""}.ri-product-hunt-fill:before{content:""}.ri-product-hunt-line:before{content:""}.ri-profile-fill:before{content:""}.ri-profile-line:before{content:""}.ri-projector-2-fill:before{content:""}.ri-projector-2-line:before{content:""}.ri-projector-fill:before{content:""}.ri-projector-line:before{content:""}.ri-psychotherapy-fill:before{content:""}.ri-psychotherapy-line:before{content:""}.ri-pulse-fill:before{content:""}.ri-pulse-line:before{content:""}.ri-pushpin-2-fill:before{content:""}.ri-pushpin-2-line:before{content:""}.ri-pushpin-fill:before{content:""}.ri-pushpin-line:before{content:""}.ri-qq-fill:before{content:""}.ri-qq-line:before{content:""}.ri-qr-code-fill:before{content:""}.ri-qr-code-line:before{content:""}.ri-qr-scan-2-fill:before{content:""}.ri-qr-scan-2-line:before{content:""}.ri-qr-scan-fill:before{content:""}.ri-qr-scan-line:before{content:""}.ri-question-answer-fill:before{content:""}.ri-question-answer-line:before{content:""}.ri-question-fill:before{content:""}.ri-question-line:before{content:""}.ri-question-mark:before{content:""}.ri-questionnaire-fill:before{content:""}.ri-questionnaire-line:before{content:""}.ri-quill-pen-fill:before{content:""}.ri-quill-pen-line:before{content:""}.ri-radar-fill:before{content:""}.ri-radar-line:before{content:""}.ri-radio-2-fill:before{content:""}.ri-radio-2-line:before{content:""}.ri-radio-button-fill:before{content:""}.ri-radio-button-line:before{content:""}.ri-radio-fill:before{content:""}.ri-radio-line:before{content:""}.ri-rainbow-fill:before{content:""}.ri-rainbow-line:before{content:""}.ri-rainy-fill:before{content:""}.ri-rainy-line:before{content:""}.ri-reactjs-fill:before{content:""}.ri-reactjs-line:before{content:""}.ri-record-circle-fill:before{content:""}.ri-record-circle-line:before{content:""}.ri-record-mail-fill:before{content:""}.ri-record-mail-line:before{content:""}.ri-recycle-fill:before{content:""}.ri-recycle-line:before{content:""}.ri-red-packet-fill:before{content:""}.ri-red-packet-line:before{content:""}.ri-reddit-fill:before{content:""}.ri-reddit-line:before{content:""}.ri-refresh-fill:before{content:""}.ri-refresh-line:before{content:""}.ri-refund-2-fill:before{content:""}.ri-refund-2-line:before{content:""}.ri-refund-fill:before{content:""}.ri-refund-line:before{content:""}.ri-registered-fill:before{content:""}.ri-registered-line:before{content:""}.ri-remixicon-fill:before{content:""}.ri-remixicon-line:before{content:""}.ri-remote-control-2-fill:before{content:""}.ri-remote-control-2-line:before{content:""}.ri-remote-control-fill:before{content:""}.ri-remote-control-line:before{content:""}.ri-repeat-2-fill:before{content:""}.ri-repeat-2-line:before{content:""}.ri-repeat-fill:before{content:""}.ri-repeat-line:before{content:""}.ri-repeat-one-fill:before{content:""}.ri-repeat-one-line:before{content:""}.ri-reply-all-fill:before{content:""}.ri-reply-all-line:before{content:""}.ri-reply-fill:before{content:""}.ri-reply-line:before{content:""}.ri-reserved-fill:before{content:""}.ri-reserved-line:before{content:""}.ri-rest-time-fill:before{content:""}.ri-rest-time-line:before{content:""}.ri-restart-fill:before{content:""}.ri-restart-line:before{content:""}.ri-restaurant-2-fill:before{content:""}.ri-restaurant-2-line:before{content:""}.ri-restaurant-fill:before{content:""}.ri-restaurant-line:before{content:""}.ri-rewind-fill:before{content:""}.ri-rewind-line:before{content:""}.ri-rewind-mini-fill:before{content:""}.ri-rewind-mini-line:before{content:""}.ri-rhythm-fill:before{content:""}.ri-rhythm-line:before{content:""}.ri-riding-fill:before{content:""}.ri-riding-line:before{content:""}.ri-road-map-fill:before{content:""}.ri-road-map-line:before{content:""}.ri-roadster-fill:before{content:""}.ri-roadster-line:before{content:""}.ri-robot-fill:before{content:""}.ri-robot-line:before{content:""}.ri-rocket-2-fill:before{content:""}.ri-rocket-2-line:before{content:""}.ri-rocket-fill:before{content:""}.ri-rocket-line:before{content:""}.ri-rotate-lock-fill:before{content:""}.ri-rotate-lock-line:before{content:""}.ri-rounded-corner:before{content:""}.ri-route-fill:before{content:""}.ri-route-line:before{content:""}.ri-router-fill:before{content:""}.ri-router-line:before{content:""}.ri-rss-fill:before{content:""}.ri-rss-line:before{content:""}.ri-ruler-2-fill:before{content:""}.ri-ruler-2-line:before{content:""}.ri-ruler-fill:before{content:""}.ri-ruler-line:before{content:""}.ri-run-fill:before{content:""}.ri-run-line:before{content:""}.ri-safari-fill:before{content:""}.ri-safari-line:before{content:""}.ri-safe-2-fill:before{content:""}.ri-safe-2-line:before{content:""}.ri-safe-fill:before{content:""}.ri-safe-line:before{content:""}.ri-sailboat-fill:before{content:""}.ri-sailboat-line:before{content:""}.ri-save-2-fill:before{content:""}.ri-save-2-line:before{content:""}.ri-save-3-fill:before{content:""}.ri-save-3-line:before{content:""}.ri-save-fill:before{content:""}.ri-save-line:before{content:""}.ri-scales-2-fill:before{content:""}.ri-scales-2-line:before{content:""}.ri-scales-3-fill:before{content:""}.ri-scales-3-line:before{content:""}.ri-scales-fill:before{content:""}.ri-scales-line:before{content:""}.ri-scan-2-fill:before{content:""}.ri-scan-2-line:before{content:""}.ri-scan-fill:before{content:""}.ri-scan-line:before{content:""}.ri-scissors-2-fill:before{content:""}.ri-scissors-2-line:before{content:""}.ri-scissors-cut-fill:before{content:""}.ri-scissors-cut-line:before{content:""}.ri-scissors-fill:before{content:""}.ri-scissors-line:before{content:""}.ri-screenshot-2-fill:before{content:""}.ri-screenshot-2-line:before{content:""}.ri-screenshot-fill:before{content:""}.ri-screenshot-line:before{content:""}.ri-sd-card-fill:before{content:""}.ri-sd-card-line:before{content:""}.ri-sd-card-mini-fill:before{content:""}.ri-sd-card-mini-line:before{content:""}.ri-search-2-fill:before{content:""}.ri-search-2-line:before{content:""}.ri-search-eye-fill:before{content:""}.ri-search-eye-line:before{content:""}.ri-search-fill:before{content:""}.ri-search-line:before{content:""}.ri-secure-payment-fill:before{content:""}.ri-secure-payment-line:before{content:""}.ri-seedling-fill:before{content:""}.ri-seedling-line:before{content:""}.ri-send-backward:before{content:""}.ri-send-plane-2-fill:before{content:""}.ri-send-plane-2-line:before{content:""}.ri-send-plane-fill:before{content:""}.ri-send-plane-line:before{content:""}.ri-send-to-back:before{content:""}.ri-sensor-fill:before{content:""}.ri-sensor-line:before{content:""}.ri-separator:before{content:""}.ri-server-fill:before{content:""}.ri-server-line:before{content:""}.ri-service-fill:before{content:""}.ri-service-line:before{content:""}.ri-settings-2-fill:before{content:""}.ri-settings-2-line:before{content:""}.ri-settings-3-fill:before{content:""}.ri-settings-3-line:before{content:""}.ri-settings-4-fill:before{content:""}.ri-settings-4-line:before{content:""}.ri-settings-5-fill:before{content:""}.ri-settings-5-line:before{content:""}.ri-settings-6-fill:before{content:""}.ri-settings-6-line:before{content:""}.ri-settings-fill:before{content:""}.ri-settings-line:before{content:""}.ri-shape-2-fill:before{content:""}.ri-shape-2-line:before{content:""}.ri-shape-fill:before{content:""}.ri-shape-line:before{content:""}.ri-share-box-fill:before{content:""}.ri-share-box-line:before{content:""}.ri-share-circle-fill:before{content:""}.ri-share-circle-line:before{content:""}.ri-share-fill:before{content:""}.ri-share-forward-2-fill:before{content:""}.ri-share-forward-2-line:before{content:""}.ri-share-forward-box-fill:before{content:""}.ri-share-forward-box-line:before{content:""}.ri-share-forward-fill:before{content:""}.ri-share-forward-line:before{content:""}.ri-share-line:before{content:""}.ri-shield-check-fill:before{content:""}.ri-shield-check-line:before{content:""}.ri-shield-cross-fill:before{content:""}.ri-shield-cross-line:before{content:""}.ri-shield-fill:before{content:""}.ri-shield-flash-fill:before{content:""}.ri-shield-flash-line:before{content:""}.ri-shield-keyhole-fill:before{content:""}.ri-shield-keyhole-line:before{content:""}.ri-shield-line:before{content:""}.ri-shield-star-fill:before{content:""}.ri-shield-star-line:before{content:""}.ri-shield-user-fill:before{content:""}.ri-shield-user-line:before{content:""}.ri-ship-2-fill:before{content:""}.ri-ship-2-line:before{content:""}.ri-ship-fill:before{content:""}.ri-ship-line:before{content:""}.ri-shirt-fill:before{content:""}.ri-shirt-line:before{content:""}.ri-shopping-bag-2-fill:before{content:""}.ri-shopping-bag-2-line:before{content:""}.ri-shopping-bag-3-fill:before{content:""}.ri-shopping-bag-3-line:before{content:""}.ri-shopping-bag-fill:before{content:""}.ri-shopping-bag-line:before{content:""}.ri-shopping-basket-2-fill:before{content:""}.ri-shopping-basket-2-line:before{content:""}.ri-shopping-basket-fill:before{content:""}.ri-shopping-basket-line:before{content:""}.ri-shopping-cart-2-fill:before{content:""}.ri-shopping-cart-2-line:before{content:""}.ri-shopping-cart-fill:before{content:""}.ri-shopping-cart-line:before{content:""}.ri-showers-fill:before{content:""}.ri-showers-line:before{content:""}.ri-shuffle-fill:before{content:""}.ri-shuffle-line:before{content:""}.ri-shut-down-fill:before{content:""}.ri-shut-down-line:before{content:""}.ri-side-bar-fill:before{content:""}.ri-side-bar-line:before{content:""}.ri-signal-tower-fill:before{content:""}.ri-signal-tower-line:before{content:""}.ri-signal-wifi-1-fill:before{content:""}.ri-signal-wifi-1-line:before{content:""}.ri-signal-wifi-2-fill:before{content:""}.ri-signal-wifi-2-line:before{content:""}.ri-signal-wifi-3-fill:before{content:""}.ri-signal-wifi-3-line:before{content:""}.ri-signal-wifi-error-fill:before{content:""}.ri-signal-wifi-error-line:before{content:""}.ri-signal-wifi-fill:before{content:""}.ri-signal-wifi-line:before{content:""}.ri-signal-wifi-off-fill:before{content:""}.ri-signal-wifi-off-line:before{content:""}.ri-sim-card-2-fill:before{content:""}.ri-sim-card-2-line:before{content:""}.ri-sim-card-fill:before{content:""}.ri-sim-card-line:before{content:""}.ri-single-quotes-l:before{content:""}.ri-single-quotes-r:before{content:""}.ri-sip-fill:before{content:""}.ri-sip-line:before{content:""}.ri-skip-back-fill:before{content:""}.ri-skip-back-line:before{content:""}.ri-skip-back-mini-fill:before{content:""}.ri-skip-back-mini-line:before{content:""}.ri-skip-forward-fill:before{content:""}.ri-skip-forward-line:before{content:""}.ri-skip-forward-mini-fill:before{content:""}.ri-skip-forward-mini-line:before{content:""}.ri-skull-2-fill:before{content:""}.ri-skull-2-line:before{content:""}.ri-skull-fill:before{content:""}.ri-skull-line:before{content:""}.ri-skype-fill:before{content:""}.ri-skype-line:before{content:""}.ri-slack-fill:before{content:""}.ri-slack-line:before{content:""}.ri-slice-fill:before{content:""}.ri-slice-line:before{content:""}.ri-slideshow-2-fill:before{content:""}.ri-slideshow-2-line:before{content:""}.ri-slideshow-3-fill:before{content:""}.ri-slideshow-3-line:before{content:""}.ri-slideshow-4-fill:before{content:""}.ri-slideshow-4-line:before{content:""}.ri-slideshow-fill:before{content:""}.ri-slideshow-line:before{content:""}.ri-smartphone-fill:before{content:""}.ri-smartphone-line:before{content:""}.ri-snapchat-fill:before{content:""}.ri-snapchat-line:before{content:""}.ri-snowy-fill:before{content:""}.ri-snowy-line:before{content:""}.ri-sort-asc:before{content:""}.ri-sort-desc:before{content:""}.ri-sound-module-fill:before{content:""}.ri-sound-module-line:before{content:""}.ri-soundcloud-fill:before{content:""}.ri-soundcloud-line:before{content:""}.ri-space-ship-fill:before{content:""}.ri-space-ship-line:before{content:""}.ri-space:before{content:""}.ri-spam-2-fill:before{content:""}.ri-spam-2-line:before{content:""}.ri-spam-3-fill:before{content:""}.ri-spam-3-line:before{content:""}.ri-spam-fill:before{content:""}.ri-spam-line:before{content:""}.ri-speaker-2-fill:before{content:""}.ri-speaker-2-line:before{content:""}.ri-speaker-3-fill:before{content:""}.ri-speaker-3-line:before{content:""}.ri-speaker-fill:before{content:""}.ri-speaker-line:before{content:""}.ri-spectrum-fill:before{content:""}.ri-spectrum-line:before{content:""}.ri-speed-fill:before{content:""}.ri-speed-line:before{content:""}.ri-speed-mini-fill:before{content:""}.ri-speed-mini-line:before{content:""}.ri-split-cells-horizontal:before{content:""}.ri-split-cells-vertical:before{content:""}.ri-spotify-fill:before{content:""}.ri-spotify-line:before{content:""}.ri-spy-fill:before{content:""}.ri-spy-line:before{content:""}.ri-stack-fill:before{content:""}.ri-stack-line:before{content:""}.ri-stack-overflow-fill:before{content:""}.ri-stack-overflow-line:before{content:""}.ri-stackshare-fill:before{content:""}.ri-stackshare-line:before{content:""}.ri-star-fill:before{content:""}.ri-star-half-fill:before{content:""}.ri-star-half-line:before{content:""}.ri-star-half-s-fill:before{content:""}.ri-star-half-s-line:before{content:""}.ri-star-line:before{content:""}.ri-star-s-fill:before{content:""}.ri-star-s-line:before{content:""}.ri-star-smile-fill:before{content:""}.ri-star-smile-line:before{content:""}.ri-steam-fill:before{content:""}.ri-steam-line:before{content:""}.ri-steering-2-fill:before{content:""}.ri-steering-2-line:before{content:""}.ri-steering-fill:before{content:""}.ri-steering-line:before{content:""}.ri-stethoscope-fill:before{content:""}.ri-stethoscope-line:before{content:""}.ri-sticky-note-2-fill:before{content:""}.ri-sticky-note-2-line:before{content:""}.ri-sticky-note-fill:before{content:""}.ri-sticky-note-line:before{content:""}.ri-stock-fill:before{content:""}.ri-stock-line:before{content:""}.ri-stop-circle-fill:before{content:""}.ri-stop-circle-line:before{content:""}.ri-stop-fill:before{content:""}.ri-stop-line:before{content:""}.ri-stop-mini-fill:before{content:""}.ri-stop-mini-line:before{content:""}.ri-store-2-fill:before{content:""}.ri-store-2-line:before{content:""}.ri-store-3-fill:before{content:""}.ri-store-3-line:before{content:""}.ri-store-fill:before{content:""}.ri-store-line:before{content:""}.ri-strikethrough-2:before{content:""}.ri-strikethrough:before{content:""}.ri-subscript-2:before{content:""}.ri-subscript:before{content:""}.ri-subtract-fill:before{content:""}.ri-subtract-line:before{content:""}.ri-subway-fill:before{content:""}.ri-subway-line:before{content:""}.ri-subway-wifi-fill:before{content:""}.ri-subway-wifi-line:before{content:""}.ri-suitcase-2-fill:before{content:""}.ri-suitcase-2-line:before{content:""}.ri-suitcase-3-fill:before{content:""}.ri-suitcase-3-line:before{content:""}.ri-suitcase-fill:before{content:""}.ri-suitcase-line:before{content:""}.ri-sun-cloudy-fill:before{content:""}.ri-sun-cloudy-line:before{content:""}.ri-sun-fill:before{content:""}.ri-sun-foggy-fill:before{content:""}.ri-sun-foggy-line:before{content:""}.ri-sun-line:before{content:""}.ri-superscript-2:before{content:""}.ri-superscript:before{content:""}.ri-surgical-mask-fill:before{content:""}.ri-surgical-mask-line:before{content:""}.ri-surround-sound-fill:before{content:""}.ri-surround-sound-line:before{content:""}.ri-survey-fill:before{content:""}.ri-survey-line:before{content:""}.ri-swap-box-fill:before{content:""}.ri-swap-box-line:before{content:""}.ri-swap-fill:before{content:""}.ri-swap-line:before{content:""}.ri-switch-fill:before{content:""}.ri-switch-line:before{content:""}.ri-sword-fill:before{content:""}.ri-sword-line:before{content:""}.ri-syringe-fill:before{content:""}.ri-syringe-line:before{content:""}.ri-t-box-fill:before{content:""}.ri-t-box-line:before{content:""}.ri-t-shirt-2-fill:before{content:""}.ri-t-shirt-2-line:before{content:""}.ri-t-shirt-air-fill:before{content:""}.ri-t-shirt-air-line:before{content:""}.ri-t-shirt-fill:before{content:""}.ri-t-shirt-line:before{content:""}.ri-table-2:before{content:""}.ri-table-alt-fill:before{content:""}.ri-table-alt-line:before{content:""}.ri-table-fill:before{content:""}.ri-table-line:before{content:""}.ri-tablet-fill:before{content:""}.ri-tablet-line:before{content:""}.ri-takeaway-fill:before{content:""}.ri-takeaway-line:before{content:""}.ri-taobao-fill:before{content:""}.ri-taobao-line:before{content:""}.ri-tape-fill:before{content:""}.ri-tape-line:before{content:""}.ri-task-fill:before{content:""}.ri-task-line:before{content:""}.ri-taxi-fill:before{content:""}.ri-taxi-line:before{content:""}.ri-taxi-wifi-fill:before{content:""}.ri-taxi-wifi-line:before{content:""}.ri-team-fill:before{content:""}.ri-team-line:before{content:""}.ri-telegram-fill:before{content:""}.ri-telegram-line:before{content:""}.ri-temp-cold-fill:before{content:""}.ri-temp-cold-line:before{content:""}.ri-temp-hot-fill:before{content:""}.ri-temp-hot-line:before{content:""}.ri-terminal-box-fill:before{content:""}.ri-terminal-box-line:before{content:""}.ri-terminal-fill:before{content:""}.ri-terminal-line:before{content:""}.ri-terminal-window-fill:before{content:""}.ri-terminal-window-line:before{content:""}.ri-test-tube-fill:before{content:""}.ri-test-tube-line:before{content:""}.ri-text-direction-l:before{content:""}.ri-text-direction-r:before{content:""}.ri-text-spacing:before{content:""}.ri-text-wrap:before{content:""}.ri-text:before{content:""}.ri-thermometer-fill:before{content:""}.ri-thermometer-line:before{content:""}.ri-thumb-down-fill:before{content:""}.ri-thumb-down-line:before{content:""}.ri-thumb-up-fill:before{content:""}.ri-thumb-up-line:before{content:""}.ri-thunderstorms-fill:before{content:""}.ri-thunderstorms-line:before{content:""}.ri-ticket-2-fill:before{content:""}.ri-ticket-2-line:before{content:""}.ri-ticket-fill:before{content:""}.ri-ticket-line:before{content:""}.ri-time-fill:before{content:""}.ri-time-line:before{content:""}.ri-timer-2-fill:before{content:""}.ri-timer-2-line:before{content:""}.ri-timer-fill:before{content:""}.ri-timer-flash-fill:before{content:""}.ri-timer-flash-line:before{content:""}.ri-timer-line:before{content:""}.ri-todo-fill:before{content:""}.ri-todo-line:before{content:""}.ri-toggle-fill:before{content:""}.ri-toggle-line:before{content:""}.ri-tools-fill:before{content:""}.ri-tools-line:before{content:""}.ri-tornado-fill:before{content:""}.ri-tornado-line:before{content:""}.ri-trademark-fill:before{content:""}.ri-trademark-line:before{content:""}.ri-traffic-light-fill:before{content:""}.ri-traffic-light-line:before{content:""}.ri-train-fill:before{content:""}.ri-train-line:before{content:""}.ri-train-wifi-fill:before{content:""}.ri-train-wifi-line:before{content:""}.ri-translate-2:before{content:""}.ri-translate:before{content:""}.ri-travesti-fill:before{content:""}.ri-travesti-line:before{content:""}.ri-treasure-map-fill:before{content:""}.ri-treasure-map-line:before{content:""}.ri-trello-fill:before{content:""}.ri-trello-line:before{content:""}.ri-trophy-fill:before{content:""}.ri-trophy-line:before{content:""}.ri-truck-fill:before{content:""}.ri-truck-line:before{content:""}.ri-tumblr-fill:before{content:""}.ri-tumblr-line:before{content:""}.ri-tv-2-fill:before{content:""}.ri-tv-2-line:before{content:""}.ri-tv-fill:before{content:""}.ri-tv-line:before{content:""}.ri-twitch-fill:before{content:""}.ri-twitch-line:before{content:""}.ri-twitter-fill:before{content:""}.ri-twitter-line:before{content:""}.ri-typhoon-fill:before{content:""}.ri-typhoon-line:before{content:""}.ri-u-disk-fill:before{content:""}.ri-u-disk-line:before{content:""}.ri-ubuntu-fill:before{content:""}.ri-ubuntu-line:before{content:""}.ri-umbrella-fill:before{content:""}.ri-umbrella-line:before{content:""}.ri-underline:before{content:""}.ri-uninstall-fill:before{content:""}.ri-uninstall-line:before{content:""}.ri-unsplash-fill:before{content:""}.ri-unsplash-line:before{content:""}.ri-upload-2-fill:before{content:""}.ri-upload-2-line:before{content:""}.ri-upload-cloud-2-fill:before{content:""}.ri-upload-cloud-2-line:before{content:""}.ri-upload-cloud-fill:before{content:""}.ri-upload-cloud-line:before{content:""}.ri-upload-fill:before{content:""}.ri-upload-line:before{content:""}.ri-usb-fill:before{content:""}.ri-usb-line:before{content:""}.ri-user-2-fill:before{content:""}.ri-user-2-line:before{content:""}.ri-user-3-fill:before{content:""}.ri-user-3-line:before{content:""}.ri-user-4-fill:before{content:""}.ri-user-4-line:before{content:""}.ri-user-5-fill:before{content:""}.ri-user-5-line:before{content:""}.ri-user-6-fill:before{content:""}.ri-user-6-line:before{content:""}.ri-user-add-fill:before{content:""}.ri-user-add-line:before{content:""}.ri-user-fill:before{content:""}.ri-user-follow-fill:before{content:""}.ri-user-follow-line:before{content:""}.ri-user-heart-fill:before{content:""}.ri-user-heart-line:before{content:""}.ri-user-line:before{content:""}.ri-user-location-fill:before{content:""}.ri-user-location-line:before{content:""}.ri-user-received-2-fill:before{content:""}.ri-user-received-2-line:before{content:""}.ri-user-received-fill:before{content:""}.ri-user-received-line:before{content:""}.ri-user-search-fill:before{content:""}.ri-user-search-line:before{content:""}.ri-user-settings-fill:before{content:""}.ri-user-settings-line:before{content:""}.ri-user-shared-2-fill:before{content:""}.ri-user-shared-2-line:before{content:""}.ri-user-shared-fill:before{content:""}.ri-user-shared-line:before{content:""}.ri-user-smile-fill:before{content:""}.ri-user-smile-line:before{content:""}.ri-user-star-fill:before{content:""}.ri-user-star-line:before{content:""}.ri-user-unfollow-fill:before{content:""}.ri-user-unfollow-line:before{content:""}.ri-user-voice-fill:before{content:""}.ri-user-voice-line:before{content:""}.ri-video-add-fill:before{content:""}.ri-video-add-line:before{content:""}.ri-video-chat-fill:before{content:""}.ri-video-chat-line:before{content:""}.ri-video-download-fill:before{content:""}.ri-video-download-line:before{content:""}.ri-video-fill:before{content:""}.ri-video-line:before{content:""}.ri-video-upload-fill:before{content:""}.ri-video-upload-line:before{content:""}.ri-vidicon-2-fill:before{content:""}.ri-vidicon-2-line:before{content:""}.ri-vidicon-fill:before{content:""}.ri-vidicon-line:before{content:""}.ri-vimeo-fill:before{content:""}.ri-vimeo-line:before{content:""}.ri-vip-crown-2-fill:before{content:""}.ri-vip-crown-2-line:before{content:""}.ri-vip-crown-fill:before{content:""}.ri-vip-crown-line:before{content:""}.ri-vip-diamond-fill:before{content:""}.ri-vip-diamond-line:before{content:""}.ri-vip-fill:before{content:""}.ri-vip-line:before{content:""}.ri-virus-fill:before{content:""}.ri-virus-line:before{content:""}.ri-visa-fill:before{content:""}.ri-visa-line:before{content:""}.ri-voice-recognition-fill:before{content:""}.ri-voice-recognition-line:before{content:""}.ri-voiceprint-fill:before{content:""}.ri-voiceprint-line:before{content:""}.ri-volume-down-fill:before{content:""}.ri-volume-down-line:before{content:""}.ri-volume-mute-fill:before{content:""}.ri-volume-mute-line:before{content:""}.ri-volume-off-vibrate-fill:before{content:""}.ri-volume-off-vibrate-line:before{content:""}.ri-volume-up-fill:before{content:""}.ri-volume-up-line:before{content:""}.ri-volume-vibrate-fill:before{content:""}.ri-volume-vibrate-line:before{content:""}.ri-vuejs-fill:before{content:""}.ri-vuejs-line:before{content:""}.ri-walk-fill:before{content:""}.ri-walk-line:before{content:""}.ri-wallet-2-fill:before{content:""}.ri-wallet-2-line:before{content:""}.ri-wallet-3-fill:before{content:""}.ri-wallet-3-line:before{content:""}.ri-wallet-fill:before{content:""}.ri-wallet-line:before{content:""}.ri-water-flash-fill:before{content:""}.ri-water-flash-line:before{content:""}.ri-webcam-fill:before{content:""}.ri-webcam-line:before{content:""}.ri-wechat-2-fill:before{content:""}.ri-wechat-2-line:before{content:""}.ri-wechat-fill:before{content:""}.ri-wechat-line:before{content:""}.ri-wechat-pay-fill:before{content:""}.ri-wechat-pay-line:before{content:""}.ri-weibo-fill:before{content:""}.ri-weibo-line:before{content:""}.ri-whatsapp-fill:before{content:""}.ri-whatsapp-line:before{content:""}.ri-wheelchair-fill:before{content:""}.ri-wheelchair-line:before{content:""}.ri-wifi-fill:before{content:""}.ri-wifi-line:before{content:""}.ri-wifi-off-fill:before{content:""}.ri-wifi-off-line:before{content:""}.ri-window-2-fill:before{content:""}.ri-window-2-line:before{content:""}.ri-window-fill:before{content:""}.ri-window-line:before{content:""}.ri-windows-fill:before{content:""}.ri-windows-line:before{content:""}.ri-windy-fill:before{content:""}.ri-windy-line:before{content:""}.ri-wireless-charging-fill:before{content:""}.ri-wireless-charging-line:before{content:""}.ri-women-fill:before{content:""}.ri-women-line:before{content:""}.ri-wubi-input:before{content:""}.ri-xbox-fill:before{content:""}.ri-xbox-line:before{content:""}.ri-xing-fill:before{content:""}.ri-xing-line:before{content:""}.ri-youtube-fill:before{content:""}.ri-youtube-line:before{content:""}.ri-zcool-fill:before{content:""}.ri-zcool-line:before{content:""}.ri-zhihu-fill:before{content:""}.ri-zhihu-line:before{content:""}.ri-zoom-in-fill:before{content:""}.ri-zoom-in-line:before{content:""}.ri-zoom-out-fill:before{content:""}.ri-zoom-out-line:before{content:""}.ri-zzz-fill:before{content:""}.ri-zzz-line:before{content:""}.ri-arrow-down-double-fill:before{content:""}.ri-arrow-down-double-line:before{content:""}.ri-arrow-left-double-fill:before{content:""}.ri-arrow-left-double-line:before{content:""}.ri-arrow-right-double-fill:before{content:""}.ri-arrow-right-double-line:before{content:""}.ri-arrow-turn-back-fill:before{content:""}.ri-arrow-turn-back-line:before{content:""}.ri-arrow-turn-forward-fill:before{content:""}.ri-arrow-turn-forward-line:before{content:""}.ri-arrow-up-double-fill:before{content:""}.ri-arrow-up-double-line:before{content:""}.ri-bard-fill:before{content:""}.ri-bard-line:before{content:""}.ri-bootstrap-fill:before{content:""}.ri-bootstrap-line:before{content:""}.ri-box-1-fill:before{content:""}.ri-box-1-line:before{content:""}.ri-box-2-fill:before{content:""}.ri-box-2-line:before{content:""}.ri-box-3-fill:before{content:""}.ri-box-3-line:before{content:""}.ri-brain-fill:before{content:""}.ri-brain-line:before{content:""}.ri-candle-fill:before{content:""}.ri-candle-line:before{content:""}.ri-cash-fill:before{content:""}.ri-cash-line:before{content:""}.ri-contract-left-fill:before{content:""}.ri-contract-left-line:before{content:""}.ri-contract-left-right-fill:before{content:""}.ri-contract-left-right-line:before{content:""}.ri-contract-right-fill:before{content:""}.ri-contract-right-line:before{content:""}.ri-contract-up-down-fill:before{content:""}.ri-contract-up-down-line:before{content:""}.ri-copilot-fill:before{content:""}.ri-copilot-line:before{content:""}.ri-corner-down-left-fill:before{content:""}.ri-corner-down-left-line:before{content:""}.ri-corner-down-right-fill:before{content:""}.ri-corner-down-right-line:before{content:""}.ri-corner-left-down-fill:before{content:""}.ri-corner-left-down-line:before{content:""}.ri-corner-left-up-fill:before{content:""}.ri-corner-left-up-line:before{content:""}.ri-corner-right-down-fill:before{content:""}.ri-corner-right-down-line:before{content:""}.ri-corner-right-up-fill:before{content:""}.ri-corner-right-up-line:before{content:""}.ri-corner-up-left-double-fill:before{content:""}.ri-corner-up-left-double-line:before{content:""}.ri-corner-up-left-fill:before{content:""}.ri-corner-up-left-line:before{content:""}.ri-corner-up-right-double-fill:before{content:""}.ri-corner-up-right-double-line:before{content:""}.ri-corner-up-right-fill:before{content:""}.ri-corner-up-right-line:before{content:""}.ri-cross-fill:before{content:""}.ri-cross-line:before{content:""}.ri-edge-new-fill:before{content:""}.ri-edge-new-line:before{content:""}.ri-equal-fill:before{content:""}.ri-equal-line:before{content:""}.ri-expand-left-fill:before{content:""}.ri-expand-left-line:before{content:""}.ri-expand-left-right-fill:before{content:""}.ri-expand-left-right-line:before{content:""}.ri-expand-right-fill:before{content:""}.ri-expand-right-line:before{content:""}.ri-expand-up-down-fill:before{content:""}.ri-expand-up-down-line:before{content:""}.ri-flickr-fill:before{content:""}.ri-flickr-line:before{content:""}.ri-forward-10-fill:before{content:""}.ri-forward-10-line:before{content:""}.ri-forward-15-fill:before{content:""}.ri-forward-15-line:before{content:""}.ri-forward-30-fill:before{content:""}.ri-forward-30-line:before{content:""}.ri-forward-5-fill:before{content:""}.ri-forward-5-line:before{content:""}.ri-graduation-cap-fill:before{content:""}.ri-graduation-cap-line:before{content:""}.ri-home-office-fill:before{content:""}.ri-home-office-line:before{content:""}.ri-hourglass-2-fill:before{content:""}.ri-hourglass-2-line:before{content:""}.ri-hourglass-fill:before{content:""}.ri-hourglass-line:before{content:""}.ri-javascript-fill:before{content:""}.ri-javascript-line:before{content:""}.ri-loop-left-fill:before{content:""}.ri-loop-left-line:before{content:""}.ri-loop-right-fill:before{content:""}.ri-loop-right-line:before{content:""}.ri-memories-fill:before{content:""}.ri-memories-line:before{content:""}.ri-meta-fill:before{content:""}.ri-meta-line:before{content:""}.ri-microsoft-loop-fill:before{content:""}.ri-microsoft-loop-line:before{content:""}.ri-nft-fill:before{content:""}.ri-nft-line:before{content:""}.ri-notion-fill:before{content:""}.ri-notion-line:before{content:""}.ri-openai-fill:before{content:""}.ri-openai-line:before{content:""}.ri-overline:before{content:""}.ri-p2p-fill:before{content:""}.ri-p2p-line:before{content:""}.ri-presentation-fill:before{content:""}.ri-presentation-line:before{content:""}.ri-replay-10-fill:before{content:""}.ri-replay-10-line:before{content:""}.ri-replay-15-fill:before{content:""}.ri-replay-15-line:before{content:""}.ri-replay-30-fill:before{content:""}.ri-replay-30-line:before{content:""}.ri-replay-5-fill:before{content:""}.ri-replay-5-line:before{content:""}.ri-school-fill:before{content:""}.ri-school-line:before{content:""}.ri-shining-2-fill:before{content:""}.ri-shining-2-line:before{content:""}.ri-shining-fill:before{content:""}.ri-shining-line:before{content:""}.ri-sketching:before{content:""}.ri-skip-down-fill:before{content:""}.ri-skip-down-line:before{content:""}.ri-skip-left-fill:before{content:""}.ri-skip-left-line:before{content:""}.ri-skip-right-fill:before{content:""}.ri-skip-right-line:before{content:""}.ri-skip-up-fill:before{content:""}.ri-skip-up-line:before{content:""}.ri-slow-down-fill:before{content:""}.ri-slow-down-line:before{content:""}.ri-sparkling-2-fill:before{content:""}.ri-sparkling-2-line:before{content:""}.ri-sparkling-fill:before{content:""}.ri-sparkling-line:before{content:""}.ri-speak-fill:before{content:""}.ri-speak-line:before{content:""}.ri-speed-up-fill:before{content:""}.ri-speed-up-line:before{content:""}.ri-tiktok-fill:before{content:""}.ri-tiktok-line:before{content:""}.ri-token-swap-fill:before{content:""}.ri-token-swap-line:before{content:""}.ri-unpin-fill:before{content:""}.ri-unpin-line:before{content:""}.ri-wechat-channels-fill:before{content:""}.ri-wechat-channels-line:before{content:""}.ri-wordpress-fill:before{content:""}.ri-wordpress-line:before{content:""}.ri-blender-fill:before{content:""}.ri-blender-line:before{content:""}.ri-emoji-sticker-fill:before{content:""}.ri-emoji-sticker-line:before{content:""}.ri-git-close-pull-request-fill:before{content:""}.ri-git-close-pull-request-line:before{content:""}.ri-instance-fill:before{content:""}.ri-instance-line:before{content:""}.ri-megaphone-fill:before{content:""}.ri-megaphone-line:before{content:""}.ri-pass-expired-fill:before{content:""}.ri-pass-expired-line:before{content:""}.ri-pass-pending-fill:before{content:""}.ri-pass-pending-line:before{content:""}.ri-pass-valid-fill:before{content:""}.ri-pass-valid-line:before{content:""}.ri-ai-generate:before{content:""}.ri-calendar-close-fill:before{content:""}.ri-calendar-close-line:before{content:""}.ri-draggable:before{content:""}.ri-font-family:before{content:""}.ri-font-mono:before{content:""}.ri-font-sans-serif:before{content:""}.ri-font-sans:before{content:""}.ri-hard-drive-3-fill:before{content:""}.ri-hard-drive-3-line:before{content:""}.ri-kick-fill:before{content:""}.ri-kick-line:before{content:""}.ri-list-check-3:before{content:""}.ri-list-indefinite:before{content:""}.ri-list-ordered-2:before{content:""}.ri-list-radio:before{content:""}.ri-openbase-fill:before{content:""}.ri-openbase-line:before{content:""}.ri-planet-fill:before{content:""}.ri-planet-line:before{content:""}.ri-prohibited-fill:before{content:""}.ri-prohibited-line:before{content:""}.ri-quote-text:before{content:""}.ri-seo-fill:before{content:""}.ri-seo-line:before{content:""}.ri-slash-commands:before{content:""}.ri-archive-2-fill:before{content:""}.ri-archive-2-line:before{content:""}.ri-inbox-2-fill:before{content:""}.ri-inbox-2-line:before{content:""}.ri-shake-hands-fill:before{content:""}.ri-shake-hands-line:before{content:""}.ri-supabase-fill:before{content:""}.ri-supabase-line:before{content:""}.ri-water-percent-fill:before{content:""}.ri-water-percent-line:before{content:""}.ri-yuque-fill:before{content:""}.ri-yuque-line:before{content:""}.ri-crosshair-2-fill:before{content:""}.ri-crosshair-2-line:before{content:""}.ri-crosshair-fill:before{content:""}.ri-crosshair-line:before{content:""}.ri-file-close-fill:before{content:""}.ri-file-close-line:before{content:""}.ri-infinity-fill:before{content:""}.ri-infinity-line:before{content:""}.ri-rfid-fill:before{content:""}.ri-rfid-line:before{content:""}.ri-slash-commands-2:before{content:""}.ri-user-forbid-fill:before{content:""}.ri-user-forbid-line:before{content:""}.ri-beer-fill:before{content:""}.ri-beer-line:before{content:""}.ri-circle-fill:before{content:""}.ri-circle-line:before{content:""}.ri-dropdown-list:before{content:""}.ri-file-image-fill:before{content:""}.ri-file-image-line:before{content:""}.ri-file-pdf-2-fill:before{content:""}.ri-file-pdf-2-line:before{content:""}.ri-file-video-fill:before{content:""}.ri-file-video-line:before{content:""}.ri-folder-image-fill:before{content:""}.ri-folder-image-line:before{content:""}.ri-folder-video-fill:before{content:""}.ri-folder-video-line:before{content:""}.ri-hexagon-fill:before{content:""}.ri-hexagon-line:before{content:""}.ri-menu-search-fill:before{content:""}.ri-menu-search-line:before{content:""}.ri-octagon-fill:before{content:""}.ri-octagon-line:before{content:""}.ri-pentagon-fill:before{content:""}.ri-pentagon-line:before{content:""}.ri-rectangle-fill:before{content:""}.ri-rectangle-line:before{content:""}.ri-robot-2-fill:before{content:""}.ri-robot-2-line:before{content:""}.ri-shapes-fill:before{content:""}.ri-shapes-line:before{content:""}.ri-square-fill:before{content:""}.ri-square-line:before{content:""}.ri-tent-fill:before{content:""}.ri-tent-line:before{content:""}.ri-threads-fill:before{content:""}.ri-threads-line:before{content:""}.ri-tree-fill:before{content:""}.ri-tree-line:before{content:""}.ri-triangle-fill:before{content:""}.ri-triangle-line:before{content:""}.ri-twitter-x-fill:before{content:""}.ri-twitter-x-line:before{content:""}.ri-verified-badge-fill:before{content:""}.ri-verified-badge-line:before{content:""}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes expand{0%{transform:rotateY(90deg)}to{opacity:1;transform:rotateY(0)}}@keyframes slideIn{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeIn{0%{opacity:0;visibility:hidden}to{opacity:1;visibility:visible}}@keyframes shine{to{background-position-x:-200%}}@keyframes loaderShow{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes entranceLeft{0%{opacity:0;transform:translate(-5px)}to{opacity:1;transform:translate(0)}}@keyframes entranceRight{0%{opacity:0;transform:translate(5px)}to{opacity:1;transform:translate(0)}}@keyframes entranceTop{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}@keyframes entranceBottom{0%{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@media screen and (min-width: 550px){::-webkit-scrollbar{width:8px;height:8px;border-radius:var(--baseRadius)}::-webkit-scrollbar-track{background:transparent;border-radius:var(--baseRadius)}::-webkit-scrollbar-thumb{background-color:var(--baseAlt2Color);border-radius:15px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-thumb:hover,::-webkit-scrollbar-thumb:active{background-color:var(--baseAlt3Color)}html{scrollbar-color:var(--baseAlt2Color) transparent;scrollbar-width:thin;scroll-behavior:smooth}html *{scrollbar-width:inherit}}:focus-visible{outline-color:var(--primaryColor);outline-style:solid}html,body{line-height:var(--baseLineHeight);font-family:var(--baseFontFamily);font-size:var(--baseFontSize);color:var(--txtPrimaryColor);background:var(--bodyColor)}#app{overflow:auto;display:block;width:100%;height:100vh}.schema-field,.flatpickr-inline-container,.accordion .accordion-content,.accordion,.tabs,.tabs-content,.select .txt-missing,.form-field .form-field-block,.list,.skeleton-loader,.clearfix,.content,.form-field .help-block,.overlay-panel .panel-content,.sub-panel,.panel,.block,.code-block,blockquote,p{display:block;width:100%}h1,h2,.breadcrumbs .breadcrumb-item,h3,h4,h5,h6{margin:0;font-weight:400}h1{font-size:22px;line-height:28px}h2,.breadcrumbs .breadcrumb-item{font-size:20px;line-height:26px}h3{font-size:19px;line-height:24px}h4{font-size:18px;line-height:24px}h5{font-size:17px;line-height:24px}h6{font-size:16px;line-height:22px}em{font-style:italic}ins{color:var(--txtPrimaryColor);background:var(--successAltColor);text-decoration:none}del{color:var(--txtPrimaryColor);background:var(--dangerAltColor);text-decoration:none}strong{font-weight:600}small{font-size:var(--smFontSize);line-height:var(--smLineHeight)}sub,sup{position:relative;font-size:.75em;line-height:1}sup{vertical-align:top}sub{vertical-align:bottom}p{margin:5px 0}blockquote{position:relative;padding-left:var(--smSpacing);font-style:italic;color:var(--txtHintColor)}blockquote:before{content:"";position:absolute;top:0;left:0;width:2px;height:100%;background:var(--baseColor)}code{display:inline-block;font-family:var(--monospaceFontFamily);font-style:normal;font-size:1em;line-height:1.379rem;padding:0 4px;white-space:nowrap;color:inherit;background:var(--baseAlt2Color);border-radius:var(--baseRadius)}.code-block{overflow:auto;padding:var(--xsSpacing);white-space:pre-wrap;background:var(--baseAlt1Color)}ol,ul{margin:10px 0;list-style:decimal;padding-left:var(--baseSpacing)}ol li,ul li{margin-top:5px;margin-bottom:5px}ul{list-style:disc}img{max-width:100%;vertical-align:top}hr{display:block;border:0;height:1px;width:100%;background:var(--baseAlt1Color);margin:var(--baseSpacing) 0}hr.dark{background:var(--baseAlt2Color)}a{color:inherit}a:hover{text-decoration:none}a i,a .txt{display:inline-block;vertical-align:top}.txt-mono{font-family:var(--monospaceFontFamily)}.txt-nowrap{white-space:nowrap}.txt-ellipsis{display:inline-block;vertical-align:top;flex-shrink:1;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.txt-base{font-size:var(--baseFontSize)!important}.txt-xs{font-size:var(--xsFontSize)!important;line-height:var(--smLineHeight)}.txt-sm{font-size:var(--smFontSize)!important;line-height:var(--smLineHeight)}.txt-lg{font-size:var(--lgFontSize)!important}.txt-xl{font-size:var(--xlFontSize)!important}.txt-bold{font-weight:600!important}.txt-strikethrough{text-decoration:line-through!important}.txt-break{white-space:pre-wrap!important}.txt-center{text-align:center!important}.txt-justify{text-align:justify!important}.txt-left{text-align:left!important}.txt-right{text-align:right!important}.txt-main{color:var(--txtPrimaryColor)!important}.txt-hint{color:var(--txtHintColor)!important}.txt-disabled{color:var(--txtDisabledColor)!important}.link-hint{-webkit-user-select:none;user-select:none;cursor:pointer;color:var(--txtHintColor)!important;text-decoration:none;transition:color var(--baseAnimationSpeed)}.link-hint:hover,.link-hint:focus-visible,.link-hint:active{color:var(--txtPrimaryColor)!important}.link-fade{opacity:1;-webkit-user-select:none;user-select:none;cursor:pointer;text-decoration:none;color:var(--txtPrimaryColor);transition:opacity var(--baseAnimationSpeed)}.link-fade:focus-visible,.link-fade:hover,.link-fade:active{opacity:.8}.txt-primary{color:var(--primaryColor)!important}.bg-primary{background:var(--primaryColor)!important}.link-primary{cursor:pointer;color:var(--primaryColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-primary:focus-visible,.link-primary:hover,.link-primary:active{opacity:.8}.txt-info{color:var(--infoColor)!important}.bg-info{background:var(--infoColor)!important}.link-info{cursor:pointer;color:var(--infoColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-info:focus-visible,.link-info:hover,.link-info:active{opacity:.8}.txt-info-alt{color:var(--infoAltColor)!important}.bg-info-alt{background:var(--infoAltColor)!important}.link-info-alt{cursor:pointer;color:var(--infoAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-info-alt:focus-visible,.link-info-alt:hover,.link-info-alt:active{opacity:.8}.txt-success{color:var(--successColor)!important}.bg-success{background:var(--successColor)!important}.link-success{cursor:pointer;color:var(--successColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-success:focus-visible,.link-success:hover,.link-success:active{opacity:.8}.txt-success-alt{color:var(--successAltColor)!important}.bg-success-alt{background:var(--successAltColor)!important}.link-success-alt{cursor:pointer;color:var(--successAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-success-alt:focus-visible,.link-success-alt:hover,.link-success-alt:active{opacity:.8}.txt-danger{color:var(--dangerColor)!important}.bg-danger{background:var(--dangerColor)!important}.link-danger{cursor:pointer;color:var(--dangerColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-danger:focus-visible,.link-danger:hover,.link-danger:active{opacity:.8}.txt-danger-alt{color:var(--dangerAltColor)!important}.bg-danger-alt{background:var(--dangerAltColor)!important}.link-danger-alt{cursor:pointer;color:var(--dangerAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-danger-alt:focus-visible,.link-danger-alt:hover,.link-danger-alt:active{opacity:.8}.txt-warning{color:var(--warningColor)!important}.bg-warning{background:var(--warningColor)!important}.link-warning{cursor:pointer;color:var(--warningColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-warning:focus-visible,.link-warning:hover,.link-warning:active{opacity:.8}.txt-warning-alt{color:var(--warningAltColor)!important}.bg-warning-alt{background:var(--warningAltColor)!important}.link-warning-alt{cursor:pointer;color:var(--warningAltColor)!important;text-decoration:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed)}.link-warning-alt:focus-visible,.link-warning-alt:hover,.link-warning-alt:active{opacity:.8}.fade{opacity:.6}a.fade,.btn.fade,[tabindex].fade,[class*=link-].fade,.handle.fade{transition:all var(--baseAnimationSpeed)}a.fade:hover,.btn.fade:hover,[tabindex].fade:hover,[class*=link-].fade:hover,.handle.fade:hover{opacity:1}.noborder{border:0px!important}.hidden{display:none!important}.hidden-empty:empty{display:none!important}.scrollbar-gutter-stable{scrollbar-gutter:stable}.no-pointer-events{pointer-events:none}.content,.form-field .help-block,.overlay-panel .panel-content,.sub-panel,.panel{min-width:0}.content>:first-child,.form-field .help-block>:first-child,.overlay-panel .panel-content>:first-child,.sub-panel>:first-child,.panel>:first-child{margin-top:0}.content>:last-child,.form-field .help-block>:last-child,.overlay-panel .panel-content>:last-child,.sub-panel>:last-child,.panel>:last-child{margin-bottom:0}.panel{background:var(--baseColor);border-radius:var(--lgRadius);padding:calc(var(--baseSpacing) - 5px) var(--baseSpacing);box-shadow:0 2px 5px 0 var(--shadowColor)}.sub-panel{background:var(--baseColor);border-radius:var(--baseRadius);padding:calc(var(--smSpacing) - 5px) var(--smSpacing);border:1px solid var(--baseAlt1Color)}.shadowize{box-shadow:0 2px 5px 0 var(--shadowColor)}.clearfix{clear:both}.clearfix:after{content:"";display:table;clear:both}.flex{position:relative;display:flex;align-items:center;width:100%;min-width:0;gap:var(--smSpacing)}.flex-fill{flex:1 1 auto!important}.flex-wrap{flex-wrap:wrap!important}.flex-nowrap{flex-wrap:nowrap!important}.inline-flex{position:relative;display:inline-flex;vertical-align:top;align-items:center;flex-wrap:wrap;min-width:0;gap:10px}.flex-order-0{order:0}.flex-order-1{order:1}.flex-order-2{order:2}.flex-order-3{order:3}.flex-order-4{order:4}.flex-order-5{order:5}.flex-order-6{order:6}.flex-order-7{order:7}.flex-order-8{order:8}.flex-order-9{order:9}.flex-order-10{order:10}.flex-gap-base{gap:var(--baseSpacing)!important}.flex-gap-xs{gap:var(--xsSpacing)!important}.flex-gap-sm{gap:var(--smSpacing)!important}.flex-gap-lg{gap:var(--lgSpacing)!important}.flex-gap-xl{gap:var(--xlSpacing)!important}.flex-gap-0{gap:0px!important}.flex-gap-5{gap:5px!important}.flex-gap-10{gap:10px!important}.flex-gap-15{gap:15px!important}.flex-gap-20{gap:20px!important}.flex-gap-25{gap:25px!important}.flex-gap-30{gap:30px!important}.flex-gap-35{gap:35px!important}.flex-gap-40{gap:40px!important}.flex-gap-45{gap:45px!important}.flex-gap-50{gap:50px!important}.flex-gap-55{gap:55px!important}.flex-gap-60{gap:60px!important}.m-base{margin:var(--baseSpacing)!important}.p-base{padding:var(--baseSpacing)!important}.m-xs{margin:var(--xsSpacing)!important}.p-xs{padding:var(--xsSpacing)!important}.m-sm{margin:var(--smSpacing)!important}.p-sm{padding:var(--smSpacing)!important}.m-lg{margin:var(--lgSpacing)!important}.p-lg{padding:var(--lgSpacing)!important}.m-xl{margin:var(--xlSpacing)!important}.p-xl{padding:var(--xlSpacing)!important}.m-t-auto{margin-top:auto!important}.p-t-auto{padding-top:auto!important}.m-t-base{margin-top:var(--baseSpacing)!important}.p-t-base{padding-top:var(--baseSpacing)!important}.m-t-xs{margin-top:var(--xsSpacing)!important}.p-t-xs{padding-top:var(--xsSpacing)!important}.m-t-sm{margin-top:var(--smSpacing)!important}.p-t-sm{padding-top:var(--smSpacing)!important}.m-t-lg{margin-top:var(--lgSpacing)!important}.p-t-lg{padding-top:var(--lgSpacing)!important}.m-t-xl{margin-top:var(--xlSpacing)!important}.p-t-xl{padding-top:var(--xlSpacing)!important}.m-r-auto{margin-right:auto!important}.p-r-auto{padding-right:auto!important}.m-r-base{margin-right:var(--baseSpacing)!important}.p-r-base{padding-right:var(--baseSpacing)!important}.m-r-xs{margin-right:var(--xsSpacing)!important}.p-r-xs{padding-right:var(--xsSpacing)!important}.m-r-sm{margin-right:var(--smSpacing)!important}.p-r-sm{padding-right:var(--smSpacing)!important}.m-r-lg{margin-right:var(--lgSpacing)!important}.p-r-lg{padding-right:var(--lgSpacing)!important}.m-r-xl{margin-right:var(--xlSpacing)!important}.p-r-xl{padding-right:var(--xlSpacing)!important}.m-b-auto{margin-bottom:auto!important}.p-b-auto{padding-bottom:auto!important}.m-b-base{margin-bottom:var(--baseSpacing)!important}.p-b-base{padding-bottom:var(--baseSpacing)!important}.m-b-xs{margin-bottom:var(--xsSpacing)!important}.p-b-xs{padding-bottom:var(--xsSpacing)!important}.m-b-sm{margin-bottom:var(--smSpacing)!important}.p-b-sm{padding-bottom:var(--smSpacing)!important}.m-b-lg{margin-bottom:var(--lgSpacing)!important}.p-b-lg{padding-bottom:var(--lgSpacing)!important}.m-b-xl{margin-bottom:var(--xlSpacing)!important}.p-b-xl{padding-bottom:var(--xlSpacing)!important}.m-l-auto{margin-left:auto!important}.p-l-auto{padding-left:auto!important}.m-l-base{margin-left:var(--baseSpacing)!important}.p-l-base{padding-left:var(--baseSpacing)!important}.m-l-xs{margin-left:var(--xsSpacing)!important}.p-l-xs{padding-left:var(--xsSpacing)!important}.m-l-sm{margin-left:var(--smSpacing)!important}.p-l-sm{padding-left:var(--smSpacing)!important}.m-l-lg{margin-left:var(--lgSpacing)!important}.p-l-lg{padding-left:var(--lgSpacing)!important}.m-l-xl{margin-left:var(--xlSpacing)!important}.p-l-xl{padding-left:var(--xlSpacing)!important}.m-0{margin:0!important}.p-0{padding:0!important}.m-t-0{margin-top:0!important}.p-t-0{padding-top:0!important}.m-r-0{margin-right:0!important}.p-r-0{padding-right:0!important}.m-b-0{margin-bottom:0!important}.p-b-0{padding-bottom:0!important}.m-l-0{margin-left:0!important}.p-l-0{padding-left:0!important}.m-5{margin:5px!important}.p-5{padding:5px!important}.m-t-5{margin-top:5px!important}.p-t-5{padding-top:5px!important}.m-r-5{margin-right:5px!important}.p-r-5{padding-right:5px!important}.m-b-5{margin-bottom:5px!important}.p-b-5{padding-bottom:5px!important}.m-l-5{margin-left:5px!important}.p-l-5{padding-left:5px!important}.m-10{margin:10px!important}.p-10{padding:10px!important}.m-t-10{margin-top:10px!important}.p-t-10{padding-top:10px!important}.m-r-10{margin-right:10px!important}.p-r-10{padding-right:10px!important}.m-b-10{margin-bottom:10px!important}.p-b-10{padding-bottom:10px!important}.m-l-10{margin-left:10px!important}.p-l-10{padding-left:10px!important}.m-15{margin:15px!important}.p-15{padding:15px!important}.m-t-15{margin-top:15px!important}.p-t-15{padding-top:15px!important}.m-r-15{margin-right:15px!important}.p-r-15{padding-right:15px!important}.m-b-15{margin-bottom:15px!important}.p-b-15{padding-bottom:15px!important}.m-l-15{margin-left:15px!important}.p-l-15{padding-left:15px!important}.m-20{margin:20px!important}.p-20{padding:20px!important}.m-t-20{margin-top:20px!important}.p-t-20{padding-top:20px!important}.m-r-20{margin-right:20px!important}.p-r-20{padding-right:20px!important}.m-b-20{margin-bottom:20px!important}.p-b-20{padding-bottom:20px!important}.m-l-20{margin-left:20px!important}.p-l-20{padding-left:20px!important}.m-25{margin:25px!important}.p-25{padding:25px!important}.m-t-25{margin-top:25px!important}.p-t-25{padding-top:25px!important}.m-r-25{margin-right:25px!important}.p-r-25{padding-right:25px!important}.m-b-25{margin-bottom:25px!important}.p-b-25{padding-bottom:25px!important}.m-l-25{margin-left:25px!important}.p-l-25{padding-left:25px!important}.m-30{margin:30px!important}.p-30{padding:30px!important}.m-t-30{margin-top:30px!important}.p-t-30{padding-top:30px!important}.m-r-30{margin-right:30px!important}.p-r-30{padding-right:30px!important}.m-b-30{margin-bottom:30px!important}.p-b-30{padding-bottom:30px!important}.m-l-30{margin-left:30px!important}.p-l-30{padding-left:30px!important}.m-35{margin:35px!important}.p-35{padding:35px!important}.m-t-35{margin-top:35px!important}.p-t-35{padding-top:35px!important}.m-r-35{margin-right:35px!important}.p-r-35{padding-right:35px!important}.m-b-35{margin-bottom:35px!important}.p-b-35{padding-bottom:35px!important}.m-l-35{margin-left:35px!important}.p-l-35{padding-left:35px!important}.m-40{margin:40px!important}.p-40{padding:40px!important}.m-t-40{margin-top:40px!important}.p-t-40{padding-top:40px!important}.m-r-40{margin-right:40px!important}.p-r-40{padding-right:40px!important}.m-b-40{margin-bottom:40px!important}.p-b-40{padding-bottom:40px!important}.m-l-40{margin-left:40px!important}.p-l-40{padding-left:40px!important}.m-45{margin:45px!important}.p-45{padding:45px!important}.m-t-45{margin-top:45px!important}.p-t-45{padding-top:45px!important}.m-r-45{margin-right:45px!important}.p-r-45{padding-right:45px!important}.m-b-45{margin-bottom:45px!important}.p-b-45{padding-bottom:45px!important}.m-l-45{margin-left:45px!important}.p-l-45{padding-left:45px!important}.m-50{margin:50px!important}.p-50{padding:50px!important}.m-t-50{margin-top:50px!important}.p-t-50{padding-top:50px!important}.m-r-50{margin-right:50px!important}.p-r-50{padding-right:50px!important}.m-b-50{margin-bottom:50px!important}.p-b-50{padding-bottom:50px!important}.m-l-50{margin-left:50px!important}.p-l-50{padding-left:50px!important}.m-55{margin:55px!important}.p-55{padding:55px!important}.m-t-55{margin-top:55px!important}.p-t-55{padding-top:55px!important}.m-r-55{margin-right:55px!important}.p-r-55{padding-right:55px!important}.m-b-55{margin-bottom:55px!important}.p-b-55{padding-bottom:55px!important}.m-l-55{margin-left:55px!important}.p-l-55{padding-left:55px!important}.m-60{margin:60px!important}.p-60{padding:60px!important}.m-t-60{margin-top:60px!important}.p-t-60{padding-top:60px!important}.m-r-60{margin-right:60px!important}.p-r-60{padding-right:60px!important}.m-b-60{margin-bottom:60px!important}.p-b-60{padding-bottom:60px!important}.m-l-60{margin-left:60px!important}.p-l-60{padding-left:60px!important}.no-min-width{min-width:0!important}.wrapper{position:relative;width:var(--wrapperWidth);margin:0 auto;max-width:100%}.wrapper.wrapper-sm{width:var(--smWrapperWidth)}.wrapper.wrapper-lg{width:var(--lgWrapperWidth)}.label{--labelVPadding: 3px;--labelHPadding: 9px;display:inline-flex;align-items:center;justify-content:center;vertical-align:top;gap:5px;padding:var(--labelVPadding) var(--labelHPadding);min-height:24px;max-width:100%;text-align:center;line-height:var(--smLineHeight);font-size:var(--smFontSize);background:var(--baseAlt2Color);color:var(--txtPrimaryColor);white-space:nowrap;border-radius:30px}.label .btn:last-child{margin-right:calc(-.5 * var(--labelHPadding))}.label .btn:first-child{margin-left:calc(-.5 * var(--labelHPadding))}.label.label-sm{--labelHPadding: 5px;font-size:var(--xsFontSize);min-height:18px;line-height:1}.label.label-primary{color:var(--baseColor);background:var(--primaryColor)}.label.label-info{background:var(--infoAltColor)}.label.label-success{background:var(--successAltColor)}.label.label-danger{background:var(--dangerAltColor)}.label.label-warning{background:var(--warningAltColor)}.thumb{--thumbSize: 40px;display:inline-flex;vertical-align:top;position:relative;flex-shrink:0;align-items:center;justify-content:center;line-height:1;width:var(--thumbSize);height:var(--thumbSize);aspect-ratio:1;background:var(--baseAlt2Color);border-radius:var(--baseRadius);color:var(--txtPrimaryColor);outline-offset:-2px;outline:2px solid transparent;box-shadow:0 2px 5px 0 var(--shadowColor)}.thumb i{font-size:inherit}.thumb img{width:100%;height:100%;border-radius:inherit;overflow:hidden}.thumb.thumb-xs{--thumbSize: 24px;font-size:.85rem}.thumb.thumb-sm{--thumbSize: 32px;font-size:.92rem}.thumb.thumb-lg{--thumbSize: 60px;font-size:1.3rem}.thumb.thumb-xl{--thumbSize: 80px;font-size:1.5rem}.thumb.thumb-circle{border-radius:50%}.thumb.thumb-primary{outline-color:var(--primaryColor)}.thumb.thumb-info{outline-color:var(--infoColor)}.thumb.thumb-info-alt{outline-color:var(--infoAltColor)}.thumb.thumb-success{outline-color:var(--successColor)}.thumb.thumb-success-alt{outline-color:var(--successAltColor)}.thumb.thumb-danger{outline-color:var(--dangerColor)}.thumb.thumb-danger-alt{outline-color:var(--dangerAltColor)}.thumb.thumb-warning{outline-color:var(--warningColor)}.thumb.thumb-warning-alt{outline-color:var(--warningAltColor)}.handle.thumb:not(.thumb-active),a.thumb:not(.thumb-active){cursor:pointer;transition:opacity var(--baseAnimationSpeed),outline-color var(--baseAnimationSpeed),transform var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.handle.thumb:not(.thumb-active):hover,.handle.thumb:not(.thumb-active):focus-visible,.handle.thumb:not(.thumb-active):active,a.thumb:not(.thumb-active):hover,a.thumb:not(.thumb-active):focus-visible,a.thumb:not(.thumb-active):active{opacity:.8;box-shadow:0 2px 5px 0 var(--shadowColor),0 2px 4px 1px var(--shadowColor)}.handle.thumb:not(.thumb-active):active,a.thumb:not(.thumb-active):active{transition-duration:var(--activeAnimationSpeed);transform:scale(.97)}.section-title{display:flex;align-items:center;width:100%;column-gap:10px;row-gap:5px;margin:0 0 var(--xsSpacing);font-weight:600;font-size:var(--baseFontSize);line-height:var(--smLineHeight);color:var(--txtHintColor)}.logo{position:relative;vertical-align:top;display:inline-flex;align-items:center;gap:10px;font-size:23px;text-decoration:none;color:inherit;-webkit-user-select:none;user-select:none}.logo strong{font-weight:700}.logo .version{position:absolute;right:0;top:-5px;line-height:1;font-size:10px;font-weight:400;padding:2px 4px;border-radius:var(--baseRadius);background:var(--dangerAltColor);color:var(--txtPrimaryColor)}.logo.logo-sm{font-size:20px}.drag-handle{position:relative;display:inline-flex;align-items:center;justify-content:center;text-align:center;flex-shrink:0;color:var(--txtDisabledColor);-webkit-user-select:none;user-select:none;cursor:pointer;transition:color var(--baseAnimationSpeed),transform var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed),visibility var(--baseAnimationSpeed)}.drag-handle:before{content:"";line-height:1;font-family:var(--iconFontFamily);padding-right:5px;text-shadow:5px 0px currentColor}.drag-handle:hover,.drag-handle:focus-visible{color:var(--txtHintColor)}.drag-handle:active{transition-duration:var(--activeAnimationSpeed);color:var(--txtPrimaryColor)}.loader{--loaderSize: 32px;position:relative;display:inline-flex;vertical-align:top;flex-direction:column;align-items:center;justify-content:center;row-gap:10px;margin:0;color:var(--txtDisabledColor);text-align:center;font-weight:400}.loader:before{content:"";display:inline-block;vertical-align:top;clear:both;width:var(--loaderSize);height:var(--loaderSize);line-height:var(--loaderSize);font-size:var(--loaderSize);font-weight:400;font-family:var(--iconFontFamily);color:inherit;text-align:center;animation:loaderShow var(--activeAnimationSpeed),rotate .9s var(--baseAnimationSpeed) infinite linear}.loader.loader-primary{color:var(--primaryColor)}.loader.loader-info{color:var(--infoColor)}.loader.loader-info-alt{color:var(--infoAltColor)}.loader.loader-success{color:var(--successColor)}.loader.loader-success-alt{color:var(--successAltColor)}.loader.loader-danger{color:var(--dangerColor)}.loader.loader-danger-alt{color:var(--dangerAltColor)}.loader.loader-warning{color:var(--warningColor)}.loader.loader-warning-alt{color:var(--warningAltColor)}.loader.loader-xs{--loaderSize: 18px}.loader.loader-sm{--loaderSize: 24px}.loader.loader-lg{--loaderSize: 42px}.skeleton-loader{position:relative;height:12px;margin:5px 0;border-radius:var(--baseRadius);background:var(--baseAlt1Color);animation:fadeIn .4s}.skeleton-loader:before{content:"";width:100%;height:100%;display:block;border-radius:inherit;background:linear-gradient(90deg,var(--baseAlt1Color) 8%,var(--bodyColor) 18%,var(--baseAlt1Color) 33%);background-size:200% 100%;animation:shine 1s linear infinite}.placeholder-section{display:flex;width:100%;align-items:center;justify-content:center;text-align:center;flex-direction:column;gap:var(--smSpacing);color:var(--txtHintColor)}.placeholder-section .icon{font-size:50px;height:50px;line-height:1;opacity:.3}.placeholder-section .icon i{font-size:inherit;vertical-align:top}.list{position:relative;overflow:auto;overflow:overlay;border:1px solid var(--baseAlt2Color);border-radius:var(--baseRadius)}.list .list-item{word-break:break-word;position:relative;display:flex;align-items:center;width:100%;gap:var(--xsSpacing);outline:0;padding:10px var(--xsSpacing);min-height:50px;border-top:1px solid var(--baseAlt2Color);transition:background var(--baseAnimationSpeed)}.list .list-item:first-child{border-top:0}.list .list-item:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.list .list-item .content,.list .list-item .form-field .help-block,.form-field .list .list-item .help-block,.list .list-item .overlay-panel .panel-content,.overlay-panel .list .list-item .panel-content,.list .list-item .panel,.list .list-item .sub-panel{display:flex;align-items:center;gap:5px;min-width:0;max-width:100%;-webkit-user-select:text;user-select:text}.list .list-item .actions{gap:10px;flex-shrink:0;display:inline-flex;align-items:center;margin:-1px -5px -1px 0}.list .list-item .actions.nonintrusive{opacity:0;transform:translate(5px);transition:transform var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed),visibility var(--baseAnimationSpeed)}.list .list-item:hover,.list .list-item:focus-visible,.list .list-item:focus-within,.list .list-item:active{background:var(--bodyColor)}.list .list-item:hover .actions.nonintrusive,.list .list-item:focus-visible .actions.nonintrusive,.list .list-item:focus-within .actions.nonintrusive,.list .list-item:active .actions.nonintrusive{opacity:1;transform:translate(0)}.list .list-item.selected{background:var(--bodyColor)}.list .list-item.handle:not(.disabled){cursor:pointer;-webkit-user-select:none;user-select:none}.list .list-item.handle:not(.disabled):hover,.list .list-item.handle:not(.disabled):focus-visible{background:var(--baseAlt1Color)}.list .list-item.handle:not(.disabled):active{background:var(--baseAlt2Color)}.list .list-item.disabled:not(.selected){cursor:default;opacity:.6}.list .list-item-placeholder{color:var(--txtHintColor)}.list .list-item-btn{padding:5px;min-height:auto}.list .list-item-placeholder:hover,.list .list-item-placeholder:focus-visible,.list .list-item-placeholder:focus-within,.list .list-item-placeholder:active,.list .list-item-btn:hover,.list .list-item-btn:focus-visible,.list .list-item-btn:focus-within,.list .list-item-btn:active{background:none}.list.list-compact .list-item{gap:10px;min-height:40px}.entrance-top{animation:entranceTop var(--entranceAnimationSpeed)}.entrance-bottom{animation:entranceBottom var(--entranceAnimationSpeed)}.entrance-left{animation:entranceLeft var(--entranceAnimationSpeed)}.entrance-right{animation:entranceRight var(--entranceAnimationSpeed)}.entrance-fade{animation:fadeIn var(--entranceAnimationSpeed)}.provider-logo{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;border-radius:var(--baseRadius);background:var(--bodyColor);padding:0;gap:0}.provider-logo img{max-width:20px;max-height:20px;height:auto;flex-shrink:0}.provider-card{display:flex;align-items:center;width:100%;height:100%;gap:10px;padding:10px;border-radius:var(--baseRadius);border:1px solid var(--baseAlt1Color)}.sidebar-menu{--sidebarListItemMargin: 10px;z-index:0;display:flex;flex-direction:column;width:200px;flex-shrink:0;flex-grow:0;overflow-x:hidden;overflow-y:auto;background:var(--baseColor);padding:calc(var(--baseSpacing) - 5px) 0 var(--smSpacing)}.sidebar-menu>*{padding:0 var(--smSpacing)}.sidebar-menu .sidebar-content{overflow-x:hidden;overflow-y:auto;overflow-y:overlay}.sidebar-menu .sidebar-content>:first-child{margin-top:0}.sidebar-menu .sidebar-content>:last-child{margin-bottom:0}.sidebar-menu .sidebar-footer{margin-top:var(--smSpacing)}.sidebar-menu .search{display:flex;align-items:center;width:auto;column-gap:5px;margin:0 0 var(--xsSpacing);color:var(--txtHintColor);opacity:.7;transition:opacity var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.sidebar-menu .search input{border:0;background:var(--baseColor);transition:box-shadow var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.sidebar-menu .search .btn-clear{margin-right:-8px}.sidebar-menu .search:hover,.sidebar-menu .search:focus-within,.sidebar-menu .search.active{opacity:1;color:var(--txtPrimaryColor)}.sidebar-menu .search:hover input,.sidebar-menu .search:focus-within input,.sidebar-menu .search.active input{background:var(--baseAlt2Color)}.sidebar-menu .sidebar-title{display:flex;align-items:center;gap:5px;width:100%;margin:var(--baseSpacing) 0 var(--xsSpacing);font-weight:600;font-size:1rem;line-height:var(--smLineHeight);color:var(--txtHintColor)}.sidebar-menu .sidebar-title .label{font-weight:400}.sidebar-menu .sidebar-list-item{cursor:pointer;outline:0;text-decoration:none;position:relative;display:flex;width:100%;align-items:center;column-gap:10px;margin:var(--sidebarListItemMargin) 0;padding:3px 10px;font-size:var(--xlFontSize);min-height:var(--btnHeight);min-width:0;color:var(--txtHintColor);border-radius:var(--baseRadius);-webkit-user-select:none;user-select:none;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.sidebar-menu .sidebar-list-item i{font-size:18px}.sidebar-menu .sidebar-list-item .txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-menu .sidebar-list-item:focus-visible,.sidebar-menu .sidebar-list-item:hover,.sidebar-menu .sidebar-list-item:active,.sidebar-menu .sidebar-list-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.sidebar-menu .sidebar-list-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.sidebar-menu .sidebar-content-compact .sidebar-list-item{--sidebarListItemMargin: 5px}@media screen and (max-height: 600px){.sidebar-menu{--sidebarListItemMargin: 5px}}@media screen and (max-width: 1100px){.sidebar-menu{min-width:190px}.sidebar-menu>*{padding-left:10px;padding-right:10px}}.grid{--gridGap: var(--baseSpacing);position:relative;display:flex;flex-grow:1;flex-wrap:wrap;row-gap:var(--gridGap);margin:0 calc(-.5 * var(--gridGap))}.grid.grid-center{align-items:center}.grid.grid-sm{--gridGap: var(--smSpacing)}.grid .form-field{margin-bottom:0}.grid>*{margin:0 calc(.5 * var(--gridGap))}.col-xxl-1,.col-xxl-2,.col-xxl-3,.col-xxl-4,.col-xxl-5,.col-xxl-6,.col-xxl-7,.col-xxl-8,.col-xxl-9,.col-xxl-10,.col-xxl-11,.col-xxl-12,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12{position:relative;width:100%;min-height:1px}.col-auto{flex:0 0 auto;width:auto}.col-12{width:calc(100% - var(--gridGap))}.col-11{width:calc(91.6666666667% - var(--gridGap))}.col-10{width:calc(83.3333333333% - var(--gridGap))}.col-9{width:calc(75% - var(--gridGap))}.col-8{width:calc(66.6666666667% - var(--gridGap))}.col-7{width:calc(58.3333333333% - var(--gridGap))}.col-6{width:calc(50% - var(--gridGap))}.col-5{width:calc(41.6666666667% - var(--gridGap))}.col-4{width:calc(33.3333333333% - var(--gridGap))}.col-3{width:calc(25% - var(--gridGap))}.col-2{width:calc(16.6666666667% - var(--gridGap))}.col-1{width:calc(8.3333333333% - var(--gridGap))}@media (min-width: 576px){.col-sm-auto{flex:0 0 auto;width:auto}.col-sm-12{width:calc(100% - var(--gridGap))}.col-sm-11{width:calc(91.6666666667% - var(--gridGap))}.col-sm-10{width:calc(83.3333333333% - var(--gridGap))}.col-sm-9{width:calc(75% - var(--gridGap))}.col-sm-8{width:calc(66.6666666667% - var(--gridGap))}.col-sm-7{width:calc(58.3333333333% - var(--gridGap))}.col-sm-6{width:calc(50% - var(--gridGap))}.col-sm-5{width:calc(41.6666666667% - var(--gridGap))}.col-sm-4{width:calc(33.3333333333% - var(--gridGap))}.col-sm-3{width:calc(25% - var(--gridGap))}.col-sm-2{width:calc(16.6666666667% - var(--gridGap))}.col-sm-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 768px){.col-md-auto{flex:0 0 auto;width:auto}.col-md-12{width:calc(100% - var(--gridGap))}.col-md-11{width:calc(91.6666666667% - var(--gridGap))}.col-md-10{width:calc(83.3333333333% - var(--gridGap))}.col-md-9{width:calc(75% - var(--gridGap))}.col-md-8{width:calc(66.6666666667% - var(--gridGap))}.col-md-7{width:calc(58.3333333333% - var(--gridGap))}.col-md-6{width:calc(50% - var(--gridGap))}.col-md-5{width:calc(41.6666666667% - var(--gridGap))}.col-md-4{width:calc(33.3333333333% - var(--gridGap))}.col-md-3{width:calc(25% - var(--gridGap))}.col-md-2{width:calc(16.6666666667% - var(--gridGap))}.col-md-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 992px){.col-lg-auto{flex:0 0 auto;width:auto}.col-lg-12{width:calc(100% - var(--gridGap))}.col-lg-11{width:calc(91.6666666667% - var(--gridGap))}.col-lg-10{width:calc(83.3333333333% - var(--gridGap))}.col-lg-9{width:calc(75% - var(--gridGap))}.col-lg-8{width:calc(66.6666666667% - var(--gridGap))}.col-lg-7{width:calc(58.3333333333% - var(--gridGap))}.col-lg-6{width:calc(50% - var(--gridGap))}.col-lg-5{width:calc(41.6666666667% - var(--gridGap))}.col-lg-4{width:calc(33.3333333333% - var(--gridGap))}.col-lg-3{width:calc(25% - var(--gridGap))}.col-lg-2{width:calc(16.6666666667% - var(--gridGap))}.col-lg-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 1200px){.col-xl-auto{flex:0 0 auto;width:auto}.col-xl-12{width:calc(100% - var(--gridGap))}.col-xl-11{width:calc(91.6666666667% - var(--gridGap))}.col-xl-10{width:calc(83.3333333333% - var(--gridGap))}.col-xl-9{width:calc(75% - var(--gridGap))}.col-xl-8{width:calc(66.6666666667% - var(--gridGap))}.col-xl-7{width:calc(58.3333333333% - var(--gridGap))}.col-xl-6{width:calc(50% - var(--gridGap))}.col-xl-5{width:calc(41.6666666667% - var(--gridGap))}.col-xl-4{width:calc(33.3333333333% - var(--gridGap))}.col-xl-3{width:calc(25% - var(--gridGap))}.col-xl-2{width:calc(16.6666666667% - var(--gridGap))}.col-xl-1{width:calc(8.3333333333% - var(--gridGap))}}@media (min-width: 1400px){.col-xxl-auto{flex:0 0 auto;width:auto}.col-xxl-12{width:calc(100% - var(--gridGap))}.col-xxl-11{width:calc(91.6666666667% - var(--gridGap))}.col-xxl-10{width:calc(83.3333333333% - var(--gridGap))}.col-xxl-9{width:calc(75% - var(--gridGap))}.col-xxl-8{width:calc(66.6666666667% - var(--gridGap))}.col-xxl-7{width:calc(58.3333333333% - var(--gridGap))}.col-xxl-6{width:calc(50% - var(--gridGap))}.col-xxl-5{width:calc(41.6666666667% - var(--gridGap))}.col-xxl-4{width:calc(33.3333333333% - var(--gridGap))}.col-xxl-3{width:calc(25% - var(--gridGap))}.col-xxl-2{width:calc(16.6666666667% - var(--gridGap))}.col-xxl-1{width:calc(8.3333333333% - var(--gridGap))}}.app-tooltip{position:fixed;z-index:999999;top:0;left:0;display:inline-block;vertical-align:top;max-width:275px;padding:3px 5px;color:#fff;text-align:center;font-family:var(--baseFontFamily);font-size:var(--smFontSize);line-height:var(--smLineHeight);border-radius:var(--baseRadius);background:var(--tooltipColor);pointer-events:none;-webkit-user-select:none;user-select:none;transition:opacity var(--baseAnimationSpeed),visibility var(--baseAnimationSpeed),transform var(--baseAnimationSpeed);transform:translateY(1px);backface-visibility:hidden;white-space:pre-line;word-break:break-word;opacity:0;visibility:hidden}.app-tooltip.code{font-family:monospace;white-space:pre-wrap;text-align:left;min-width:150px;max-width:340px}.app-tooltip.active{transform:scale(1);opacity:1;visibility:visible}.dropdown{position:absolute;z-index:99;right:0;left:auto;top:100%;cursor:default;display:inline-block;vertical-align:top;padding:5px;margin:5px 0 0;width:auto;min-width:140px;max-width:450px;max-height:330px;overflow-x:hidden;overflow-y:auto;background:var(--baseColor);border-radius:var(--baseRadius);border:1px solid var(--baseAlt2Color);box-shadow:0 2px 5px 0 var(--shadowColor)}.dropdown hr{margin:5px 0}.dropdown .dropdown-item{border:0;background:none;position:relative;outline:0;display:flex;align-items:center;column-gap:8px;width:100%;height:auto;min-height:0;text-align:left;padding:8px 10px;margin:0 0 5px;cursor:pointer;color:var(--txtPrimaryColor);font-weight:400;font-size:var(--baseFontSize);font-family:var(--baseFontFamily);line-height:var(--baseLineHeight);border-radius:var(--baseRadius);text-decoration:none;word-break:break-word;-webkit-user-select:none;user-select:none;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.dropdown .dropdown-item:last-child{margin-bottom:0}.dropdown .dropdown-item.selected{background:var(--baseAlt2Color)}.dropdown .dropdown-item:focus-visible,.dropdown .dropdown-item:hover{background:var(--baseAlt1Color)}.dropdown .dropdown-item:active{transition-duration:var(--activeAnimationSpeed);background:var(--baseAlt2Color)}.dropdown .dropdown-item.disabled{color:var(--txtDisabledColor);background:none;pointer-events:none}.dropdown .dropdown-item.separator{cursor:default;background:none;text-transform:uppercase;padding-top:0;padding-bottom:0;margin-top:15px;color:var(--txtDisabledColor);font-weight:600;font-size:var(--smFontSize)}.dropdown.dropdown-upside{top:auto;bottom:100%;margin:0 0 5px}.dropdown.dropdown-left{right:auto;left:0}.dropdown.dropdown-center{right:auto;left:50%;transform:translate(-50%)}.dropdown.dropdown-sm{margin-top:5px;min-width:100px}.dropdown.dropdown-sm .dropdown-item{column-gap:7px;font-size:var(--smFontSize);margin:0 0 2px;padding:5px 7px}.dropdown.dropdown-sm .dropdown-item:last-child{margin-bottom:0}.dropdown.dropdown-sm.dropdown-upside{margin-top:0;margin-bottom:5px}.dropdown.dropdown-block{width:100%;min-width:130px;max-width:100%}.dropdown.dropdown-nowrap{white-space:nowrap}.overlay-panel{position:relative;z-index:1;display:flex;flex-direction:column;align-self:flex-end;margin-left:auto;background:var(--baseColor);height:100%;width:580px;max-width:100%;word-wrap:break-word;box-shadow:0 2px 5px 0 var(--shadowColor)}.overlay-panel .overlay-panel-section{position:relative;width:100%;margin:0;padding:var(--baseSpacing);transition:box-shadow var(--baseAnimationSpeed)}.overlay-panel .overlay-panel-section:empty{display:none}.overlay-panel .overlay-panel-section:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.overlay-panel .overlay-panel-section:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.overlay-panel .overlay-panel-section .btn{flex-grow:0}.overlay-panel img{max-width:100%}.overlay-panel .panel-header{position:relative;z-index:2;display:flex;flex-wrap:wrap;align-items:center;column-gap:10px;row-gap:var(--baseSpacing);padding:calc(var(--baseSpacing) - 7px) var(--baseSpacing)}.overlay-panel .panel-header>*{margin-top:0;margin-bottom:0}.overlay-panel .panel-header .btn-back{margin-left:-10px}.overlay-panel .panel-header .overlay-close{z-index:3;outline:0;position:absolute;right:100%;top:20px;margin:0;display:inline-flex;align-items:center;justify-content:center;width:35px;height:35px;cursor:pointer;text-align:center;font-size:1.6rem;line-height:1;border-radius:50% 0 0 50%;color:#fff;background:var(--primaryColor);opacity:.5;transition:opacity var(--baseAnimationSpeed);-webkit-user-select:none;user-select:none}.overlay-panel .panel-header .overlay-close i{font-size:inherit}.overlay-panel .panel-header .overlay-close:hover,.overlay-panel .panel-header .overlay-close:focus-visible,.overlay-panel .panel-header .overlay-close:active{opacity:.7}.overlay-panel .panel-header .overlay-close:active{transition-duration:var(--activeAnimationSpeed);opacity:1}.overlay-panel .panel-header .btn-close{margin-right:-10px}.overlay-panel .panel-header .tabs-header{margin-bottom:-24px}.overlay-panel .panel-content{z-index:auto;flex-grow:1;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;scroll-behavior:smooth}.tox-fullscreen .overlay-panel .panel-content{z-index:9}.overlay-panel .panel-header~.panel-content{padding-top:5px}.overlay-panel .panel-footer{z-index:2;column-gap:var(--smSpacing);display:flex;align-items:center;justify-content:flex-end;border-top:1px solid var(--baseAlt2Color);padding:calc(var(--baseSpacing) - 7px) var(--baseSpacing)}.overlay-panel.scrollable .panel-header{box-shadow:0 4px 5px #0000000d}.overlay-panel.scrollable .panel-footer{box-shadow:0 -4px 5px #0000000d}.overlay-panel.scrollable.scroll-top-reached .panel-header,.overlay-panel.scrollable.scroll-bottom-reached .panel-footer{box-shadow:none}.overlay-panel.overlay-panel-xl{width:850px}.overlay-panel.overlay-panel-lg{width:700px}.overlay-panel.overlay-panel-sm{width:460px}.overlay-panel.popup{height:auto;max-height:100%;align-self:center;border-radius:var(--baseRadius);margin:0 auto}.overlay-panel.popup .panel-footer{background:var(--bodyColor)}.overlay-panel.hide-content .panel-content{display:none}.overlay-panel.colored-header .panel-header{background:var(--bodyColor);border-bottom:1px solid var(--baseAlt1Color)}.overlay-panel.colored-header .panel-header .tabs-header{border-bottom:0}.overlay-panel.colored-header .panel-header .tabs-header .tab-item{border:1px solid transparent;border-bottom:0}.overlay-panel.colored-header .panel-header .tabs-header .tab-item:hover,.overlay-panel.colored-header .panel-header .tabs-header .tab-item:focus-visible{background:var(--baseAlt1Color)}.overlay-panel.colored-header .panel-header .tabs-header .tab-item:after{content:none;display:none}.overlay-panel.colored-header .panel-header .tabs-header .tab-item.active{background:var(--baseColor);border-color:var(--baseAlt1Color)}.overlay-panel.colored-header .panel-header~.panel-content{padding-top:calc(var(--baseSpacing) - 5px)}.overlay-panel.compact-header .panel-header{row-gap:var(--smSpacing)}.overlay-panel.full-width-popup{width:100%}.overlay-panel.preview .panel-header{position:absolute;z-index:99;box-shadow:none}.overlay-panel.preview .panel-header .overlay-close{left:100%;right:auto;border-radius:0 50% 50% 0}.overlay-panel.preview .panel-header .overlay-close i{margin-right:5px}.overlay-panel.preview .panel-header,.overlay-panel.preview .panel-footer{padding:10px 15px}.overlay-panel.preview .panel-content{padding:0;text-align:center;display:flex;align-items:center;justify-content:center}.overlay-panel.preview img{max-width:100%;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.overlay-panel.preview object{position:absolute;z-index:1;left:0;top:0;width:100%;height:100%}.overlay-panel.preview.preview-image{width:auto;min-width:320px;min-height:300px;max-width:75%;max-height:90%}.overlay-panel.preview.preview-document,.overlay-panel.preview.preview-video{width:75%;height:90%}.overlay-panel.preview.preview-audio{min-width:320px;min-height:300px;max-width:90%;max-height:90%}@media (max-width: 900px){.overlay-panel .overlay-panel-section{padding:var(--smSpacing)}}.overlay-panel-container{display:flex;position:fixed;z-index:1000;flex-direction:row;align-items:center;top:0;left:0;width:100%;height:100%;overflow:hidden;margin:0;padding:0;outline:0}.overlay-panel-container .overlay{position:absolute;z-index:0;left:0;top:0;width:100%;height:100%;-webkit-user-select:none;user-select:none;background:var(--overlayColor)}.overlay-panel-container.padded{padding:10px}.overlay-panel-wrapper{position:relative;z-index:1000;outline:0}.alert{position:relative;display:flex;column-gap:15px;align-items:center;width:100%;min-height:50px;max-width:100%;word-break:break-word;margin:0 0 var(--baseSpacing);border-radius:var(--baseRadius);padding:12px 15px;background:var(--baseAlt1Color);color:var(--txtAltColor)}.alert .content,.alert .form-field .help-block,.form-field .alert .help-block,.alert .panel,.alert .sub-panel,.alert .overlay-panel .panel-content,.overlay-panel .alert .panel-content{flex-grow:1}.alert .icon,.alert .close{display:inline-flex;align-items:center;justify-content:center;flex-grow:0;flex-shrink:0;text-align:center}.alert .icon{align-self:stretch;font-size:1.2em;padding-right:15px;font-weight:400;border-right:1px solid rgba(0,0,0,.05);color:var(--txtHintColor)}.alert .close{display:inline-flex;margin-right:-5px;width:28px;height:28px;outline:0;cursor:pointer;text-align:center;font-size:var(--smFontSize);line-height:28px;border-radius:28px;text-decoration:none;color:inherit;opacity:.5;transition:opacity var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.alert .close:hover,.alert .close:focus{opacity:1;background:rgba(255,255,255,.2)}.alert .close:active{opacity:1;background:rgba(255,255,255,.3);transition-duration:var(--activeAnimationSpeed)}.alert code,.alert hr{background:rgba(0,0,0,.1)}.alert.alert-info{background:var(--infoAltColor)}.alert.alert-info .icon{color:var(--infoColor)}.alert.alert-warning{background:var(--warningAltColor)}.alert.alert-warning .icon{color:var(--warningColor)}.alert.alert-success{background:var(--successAltColor)}.alert.alert-success .icon{color:var(--successColor)}.alert.alert-danger{background:var(--dangerAltColor)}.alert.alert-danger .icon{color:var(--dangerColor)}.toasts-wrapper{position:fixed;z-index:999999;bottom:0;left:0;right:0;padding:0 var(--smSpacing);width:auto;display:block;text-align:center;pointer-events:none}.toasts-wrapper .alert{text-align:left;pointer-events:auto;width:var(--smWrapperWidth);margin:var(--baseSpacing) auto;box-shadow:0 2px 5px 0 var(--shadowColor)}@media screen and (min-width: 980px){body:not(.overlay-active):has(.app-sidebar) .toasts-wrapper{left:var(--appSidebarWidth)}body:not(.overlay-active):has(.page-sidebar) .toasts-wrapper{left:calc(var(--appSidebarWidth) + var(--pageSidebarWidth))}}button{outline:0;border:0;background:none;padding:0;text-align:left;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit}.btn{position:relative;z-index:1;display:inline-flex;vertical-align:top;align-items:center;justify-content:center;outline:0;border:0;margin:0;flex-shrink:0;cursor:pointer;padding:5px 20px;column-gap:7px;-webkit-user-select:none;user-select:none;min-width:var(--btnHeight);min-height:var(--btnHeight);text-align:center;text-decoration:none;line-height:1;font-weight:600;color:#fff;font-size:var(--baseFontSize);font-family:var(--baseFontFamily);border-radius:var(--btnRadius);background:none;transition:color var(--baseAnimationSpeed)}.btn i{font-size:1.1428em;vertical-align:middle;display:inline-block}.btn .dropdown{-webkit-user-select:text;user-select:text}.btn:before{content:"";border-radius:inherit;position:absolute;left:0;top:0;z-index:-1;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none;backface-visibility:hidden;background:var(--primaryColor);transition:filter var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed),transform var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.btn:hover:before,.btn:focus-visible:before{opacity:.9}.btn.active,.btn:active{z-index:999}.btn.active:before,.btn:active:before{opacity:.8;transition-duration:var(--activeAnimationSpeed)}.btn.btn-info:before{background:var(--infoColor)}.btn.btn-info:hover:before,.btn.btn-info:focus-visible:before{opacity:.8}.btn.btn-info:active:before{opacity:.7}.btn.btn-success:before{background:var(--successColor)}.btn.btn-success:hover:before,.btn.btn-success:focus-visible:before{opacity:.8}.btn.btn-success:active:before{opacity:.7}.btn.btn-danger:before{background:var(--dangerColor)}.btn.btn-danger:hover:before,.btn.btn-danger:focus-visible:before{opacity:.8}.btn.btn-danger:active:before{opacity:.7}.btn.btn-warning:before{background:var(--warningColor)}.btn.btn-warning:hover:before,.btn.btn-warning:focus-visible:before{opacity:.8}.btn.btn-warning:active:before{opacity:.7}.btn.btn-hint:before{background:var(--baseAlt4Color)}.btn.btn-hint:hover:before,.btn.btn-hint:focus-visible:before{opacity:.8}.btn.btn-hint:active:before{opacity:.7}.btn.btn-outline{border:2px solid currentColor;background:#fff}.btn.btn-secondary,.btn.btn-transparent,.btn.btn-outline{box-shadow:none;color:var(--txtPrimaryColor)}.btn.btn-secondary:before,.btn.btn-transparent:before,.btn.btn-outline:before{opacity:0}.btn.btn-secondary:focus-visible:before,.btn.btn-secondary:hover:before,.btn.btn-transparent:focus-visible:before,.btn.btn-transparent:hover:before,.btn.btn-outline:focus-visible:before,.btn.btn-outline:hover:before{opacity:.3}.btn.btn-secondary.active:before,.btn.btn-secondary:active:before,.btn.btn-transparent.active:before,.btn.btn-transparent:active:before,.btn.btn-outline.active:before,.btn.btn-outline:active:before{opacity:.45}.btn.btn-secondary:before,.btn.btn-transparent:before,.btn.btn-outline:before{background:var(--baseAlt3Color)}.btn.btn-secondary.btn-info,.btn.btn-transparent.btn-info,.btn.btn-outline.btn-info{color:var(--infoColor)}.btn.btn-secondary.btn-info:before,.btn.btn-transparent.btn-info:before,.btn.btn-outline.btn-info:before{opacity:0}.btn.btn-secondary.btn-info:focus-visible:before,.btn.btn-secondary.btn-info:hover:before,.btn.btn-transparent.btn-info:focus-visible:before,.btn.btn-transparent.btn-info:hover:before,.btn.btn-outline.btn-info:focus-visible:before,.btn.btn-outline.btn-info:hover:before{opacity:.15}.btn.btn-secondary.btn-info.active:before,.btn.btn-secondary.btn-info:active:before,.btn.btn-transparent.btn-info.active:before,.btn.btn-transparent.btn-info:active:before,.btn.btn-outline.btn-info.active:before,.btn.btn-outline.btn-info:active:before{opacity:.25}.btn.btn-secondary.btn-info:before,.btn.btn-transparent.btn-info:before,.btn.btn-outline.btn-info:before{background:var(--infoColor)}.btn.btn-secondary.btn-success,.btn.btn-transparent.btn-success,.btn.btn-outline.btn-success{color:var(--successColor)}.btn.btn-secondary.btn-success:before,.btn.btn-transparent.btn-success:before,.btn.btn-outline.btn-success:before{opacity:0}.btn.btn-secondary.btn-success:focus-visible:before,.btn.btn-secondary.btn-success:hover:before,.btn.btn-transparent.btn-success:focus-visible:before,.btn.btn-transparent.btn-success:hover:before,.btn.btn-outline.btn-success:focus-visible:before,.btn.btn-outline.btn-success:hover:before{opacity:.15}.btn.btn-secondary.btn-success.active:before,.btn.btn-secondary.btn-success:active:before,.btn.btn-transparent.btn-success.active:before,.btn.btn-transparent.btn-success:active:before,.btn.btn-outline.btn-success.active:before,.btn.btn-outline.btn-success:active:before{opacity:.25}.btn.btn-secondary.btn-success:before,.btn.btn-transparent.btn-success:before,.btn.btn-outline.btn-success:before{background:var(--successColor)}.btn.btn-secondary.btn-danger,.btn.btn-transparent.btn-danger,.btn.btn-outline.btn-danger{color:var(--dangerColor)}.btn.btn-secondary.btn-danger:before,.btn.btn-transparent.btn-danger:before,.btn.btn-outline.btn-danger:before{opacity:0}.btn.btn-secondary.btn-danger:focus-visible:before,.btn.btn-secondary.btn-danger:hover:before,.btn.btn-transparent.btn-danger:focus-visible:before,.btn.btn-transparent.btn-danger:hover:before,.btn.btn-outline.btn-danger:focus-visible:before,.btn.btn-outline.btn-danger:hover:before{opacity:.15}.btn.btn-secondary.btn-danger.active:before,.btn.btn-secondary.btn-danger:active:before,.btn.btn-transparent.btn-danger.active:before,.btn.btn-transparent.btn-danger:active:before,.btn.btn-outline.btn-danger.active:before,.btn.btn-outline.btn-danger:active:before{opacity:.25}.btn.btn-secondary.btn-danger:before,.btn.btn-transparent.btn-danger:before,.btn.btn-outline.btn-danger:before{background:var(--dangerColor)}.btn.btn-secondary.btn-warning,.btn.btn-transparent.btn-warning,.btn.btn-outline.btn-warning{color:var(--warningColor)}.btn.btn-secondary.btn-warning:before,.btn.btn-transparent.btn-warning:before,.btn.btn-outline.btn-warning:before{opacity:0}.btn.btn-secondary.btn-warning:focus-visible:before,.btn.btn-secondary.btn-warning:hover:before,.btn.btn-transparent.btn-warning:focus-visible:before,.btn.btn-transparent.btn-warning:hover:before,.btn.btn-outline.btn-warning:focus-visible:before,.btn.btn-outline.btn-warning:hover:before{opacity:.15}.btn.btn-secondary.btn-warning.active:before,.btn.btn-secondary.btn-warning:active:before,.btn.btn-transparent.btn-warning.active:before,.btn.btn-transparent.btn-warning:active:before,.btn.btn-outline.btn-warning.active:before,.btn.btn-outline.btn-warning:active:before{opacity:.25}.btn.btn-secondary.btn-warning:before,.btn.btn-transparent.btn-warning:before,.btn.btn-outline.btn-warning:before{background:var(--warningColor)}.btn.btn-secondary.btn-hint,.btn.btn-transparent.btn-hint,.btn.btn-outline.btn-hint{color:var(--baseAlt4Color)}.btn.btn-secondary.btn-hint:before,.btn.btn-transparent.btn-hint:before,.btn.btn-outline.btn-hint:before{opacity:0}.btn.btn-secondary.btn-hint:focus-visible:before,.btn.btn-secondary.btn-hint:hover:before,.btn.btn-transparent.btn-hint:focus-visible:before,.btn.btn-transparent.btn-hint:hover:before,.btn.btn-outline.btn-hint:focus-visible:before,.btn.btn-outline.btn-hint:hover:before{opacity:.15}.btn.btn-secondary.btn-hint.active:before,.btn.btn-secondary.btn-hint:active:before,.btn.btn-transparent.btn-hint.active:before,.btn.btn-transparent.btn-hint:active:before,.btn.btn-outline.btn-hint.active:before,.btn.btn-outline.btn-hint:active:before{opacity:.25}.btn.btn-secondary.btn-hint:before,.btn.btn-transparent.btn-hint:before,.btn.btn-outline.btn-hint:before{background:var(--baseAlt4Color)}.btn.btn-secondary.btn-hint,.btn.btn-transparent.btn-hint,.btn.btn-outline.btn-hint{color:var(--txtHintColor)}.btn.btn-secondary.btn-hint:focus-visible,.btn.btn-secondary.btn-hint:hover,.btn.btn-secondary.btn-hint:active,.btn.btn-secondary.btn-hint.active,.btn.btn-transparent.btn-hint:focus-visible,.btn.btn-transparent.btn-hint:hover,.btn.btn-transparent.btn-hint:active,.btn.btn-transparent.btn-hint.active,.btn.btn-outline.btn-hint:focus-visible,.btn.btn-outline.btn-hint:hover,.btn.btn-outline.btn-hint:active,.btn.btn-outline.btn-hint.active{color:var(--txtPrimaryColor)}.btn.btn-secondary:before{opacity:.35}.btn.btn-secondary:focus-visible:before,.btn.btn-secondary:hover:before{opacity:.5}.btn.btn-secondary.active:before,.btn.btn-secondary:active:before{opacity:.7}.btn.btn-secondary.btn-info:before{opacity:.15}.btn.btn-secondary.btn-info:focus-visible:before,.btn.btn-secondary.btn-info:hover:before{opacity:.25}.btn.btn-secondary.btn-info.active:before,.btn.btn-secondary.btn-info:active:before{opacity:.3}.btn.btn-secondary.btn-success:before{opacity:.15}.btn.btn-secondary.btn-success:focus-visible:before,.btn.btn-secondary.btn-success:hover:before{opacity:.25}.btn.btn-secondary.btn-success.active:before,.btn.btn-secondary.btn-success:active:before{opacity:.3}.btn.btn-secondary.btn-danger:before{opacity:.15}.btn.btn-secondary.btn-danger:focus-visible:before,.btn.btn-secondary.btn-danger:hover:before{opacity:.25}.btn.btn-secondary.btn-danger.active:before,.btn.btn-secondary.btn-danger:active:before{opacity:.3}.btn.btn-secondary.btn-warning:before{opacity:.15}.btn.btn-secondary.btn-warning:focus-visible:before,.btn.btn-secondary.btn-warning:hover:before{opacity:.25}.btn.btn-secondary.btn-warning.active:before,.btn.btn-secondary.btn-warning:active:before{opacity:.3}.btn.btn-secondary.btn-hint:before{opacity:.15}.btn.btn-secondary.btn-hint:focus-visible:before,.btn.btn-secondary.btn-hint:hover:before{opacity:.25}.btn.btn-secondary.btn-hint.active:before,.btn.btn-secondary.btn-hint:active:before{opacity:.3}.btn.btn-disabled,.btn[disabled]{box-shadow:none;cursor:default;background:var(--baseAlt1Color);color:var(--txtDisabledColor)!important}.btn.btn-disabled:before,.btn[disabled]:before{display:none}.btn.btn-disabled.btn-transparent,.btn[disabled].btn-transparent{background:none}.btn.btn-disabled.btn-outline,.btn[disabled].btn-outline{border-color:var(--baseAlt2Color)}.btn.txt-left{text-align:left;justify-content:flex-start}.btn.txt-right{text-align:right;justify-content:flex-end}.btn.btn-expanded{min-width:150px}.btn.btn-expanded-sm{min-width:90px}.btn.btn-expanded-lg{min-width:170px}.btn.btn-lg{column-gap:10px;font-size:var(--lgFontSize);min-height:var(--lgBtnHeight);min-width:var(--lgBtnHeight);padding-left:30px;padding-right:30px}.btn.btn-lg i{font-size:1.2666em}.btn.btn-lg.btn-expanded{min-width:240px}.btn.btn-lg.btn-expanded-sm{min-width:160px}.btn.btn-lg.btn-expanded-lg{min-width:300px}.btn.btn-sm,.btn.btn-xs{column-gap:5px;font-size:var(--smFontSize);min-height:var(--smBtnHeight);min-width:var(--smBtnHeight);padding-left:12px;padding-right:12px}.btn.btn-sm i,.btn.btn-xs i{font-size:1rem}.btn.btn-sm.btn-expanded,.btn.btn-xs.btn-expanded{min-width:100px}.btn.btn-sm.btn-expanded-sm,.btn.btn-xs.btn-expanded-sm{min-width:80px}.btn.btn-sm.btn-expanded-lg,.btn.btn-xs.btn-expanded-lg{min-width:130px}.btn.btn-xs{padding-left:7px;padding-right:7px;min-width:var(--xsBtnHeight);min-height:var(--xsBtnHeight)}.btn.btn-block{display:flex;width:100%}.btn.btn-pill{border-radius:30px}.btn.btn-circle{border-radius:50%;padding:0;gap:0}.btn.btn-circle i{font-size:1.2857rem;text-align:center;width:19px;height:19px;line-height:19px}.btn.btn-circle i:before{margin:0;display:block}.btn.btn-circle.btn-sm i{font-size:1.1rem}.btn.btn-circle.btn-xs i{font-size:1.05rem}.btn.btn-loading{--loaderSize: 24px;cursor:default;pointer-events:none}.btn.btn-loading:after{content:"";position:absolute;display:inline-block;vertical-align:top;left:50%;top:50%;width:var(--loaderSize);height:var(--loaderSize);line-height:var(--loaderSize);font-size:var(--loaderSize);color:inherit;text-align:center;font-weight:400;margin-left:calc(var(--loaderSize) * -.5);margin-top:calc(var(--loaderSize) * -.5);font-family:var(--iconFontFamily);animation:loaderShow var(--baseAnimationSpeed),rotate .9s var(--baseAnimationSpeed) infinite linear}.btn.btn-loading>*{opacity:0;transform:scale(.9)}.btn.btn-loading.btn-sm,.btn.btn-loading.btn-xs{--loaderSize: 20px}.btn.btn-loading.btn-lg{--loaderSize: 28px}.btn.btn-prev i,.btn.btn-next i{transition:transform var(--baseAnimationSpeed)}.btn.btn-prev:hover i,.btn.btn-prev:focus-within i,.btn.btn-next:hover i,.btn.btn-next:focus-within i{transform:translate(3px)}.btn.btn-prev:hover i,.btn.btn-prev:focus-within i{transform:translate(-3px)}.btn.btn-horizontal-sticky{position:sticky;left:var(--xsSpacing);right:var(--xsSpacing)}.btns-group{display:inline-flex;align-items:center;gap:var(--xsSpacing)}.btns-group.no-gap{gap:0}.btns-group.no-gap>*{border-radius:0;min-width:0;box-shadow:-1px 0 #ffffff1a}.btns-group.no-gap>*:first-child{border-top-left-radius:var(--btnRadius);border-bottom-left-radius:var(--btnRadius);box-shadow:none}.btns-group.no-gap>*:last-child{border-top-right-radius:var(--btnRadius);border-bottom-right-radius:var(--btnRadius)}.tinymce-wrapper,.code-editor,.select .selected-container,input,select,textarea{display:block;width:100%;outline:0;border:0;margin:0;background:none;padding:5px 10px;line-height:20px;min-width:0;min-height:var(--inputHeight);background:var(--baseAlt1Color);color:var(--txtPrimaryColor);font-size:var(--baseFontSize);font-family:var(--baseFontFamily);font-weight:400;border-radius:var(--baseRadius);overflow:auto;overflow:overlay}.tinymce-wrapper::placeholder,.code-editor::placeholder,.select .selected-container::placeholder,input::placeholder,select::placeholder,textarea::placeholder{color:var(--txtDisabledColor)}@media screen and (min-width: 550px){.tinymce-wrapper:focus,.code-editor:focus,.select .selected-container:focus,input:focus,select:focus,textarea:focus,.tinymce-wrapper:focus-within,.code-editor:focus-within,.select .selected-container:focus-within,input:focus-within,select:focus-within,textarea:focus-within{scrollbar-color:var(--baseAlt3Color) transparent;scrollbar-width:thin;scroll-behavior:smooth}.tinymce-wrapper:focus::-webkit-scrollbar,.code-editor:focus::-webkit-scrollbar,.select .selected-container:focus::-webkit-scrollbar,input:focus::-webkit-scrollbar,select:focus::-webkit-scrollbar,textarea:focus::-webkit-scrollbar,.tinymce-wrapper:focus-within::-webkit-scrollbar,.code-editor:focus-within::-webkit-scrollbar,.select .selected-container:focus-within::-webkit-scrollbar,input:focus-within::-webkit-scrollbar,select:focus-within::-webkit-scrollbar,textarea:focus-within::-webkit-scrollbar{width:8px;height:8px;border-radius:var(--baseRadius)}.tinymce-wrapper:focus::-webkit-scrollbar-track,.code-editor:focus::-webkit-scrollbar-track,.select .selected-container:focus::-webkit-scrollbar-track,input:focus::-webkit-scrollbar-track,select:focus::-webkit-scrollbar-track,textarea:focus::-webkit-scrollbar-track,.tinymce-wrapper:focus-within::-webkit-scrollbar-track,.code-editor:focus-within::-webkit-scrollbar-track,.select .selected-container:focus-within::-webkit-scrollbar-track,input:focus-within::-webkit-scrollbar-track,select:focus-within::-webkit-scrollbar-track,textarea:focus-within::-webkit-scrollbar-track{background:transparent;border-radius:var(--baseRadius)}.tinymce-wrapper:focus::-webkit-scrollbar-thumb,.code-editor:focus::-webkit-scrollbar-thumb,.select .selected-container:focus::-webkit-scrollbar-thumb,input:focus::-webkit-scrollbar-thumb,select:focus::-webkit-scrollbar-thumb,textarea:focus::-webkit-scrollbar-thumb,.tinymce-wrapper:focus-within::-webkit-scrollbar-thumb,.code-editor:focus-within::-webkit-scrollbar-thumb,.select .selected-container:focus-within::-webkit-scrollbar-thumb,input:focus-within::-webkit-scrollbar-thumb,select:focus-within::-webkit-scrollbar-thumb,textarea:focus-within::-webkit-scrollbar-thumb{background-color:var(--baseAlt3Color);border-radius:15px;border:2px solid transparent;background-clip:padding-box}.tinymce-wrapper:focus::-webkit-scrollbar-thumb:hover,.code-editor:focus::-webkit-scrollbar-thumb:hover,.select .selected-container:focus::-webkit-scrollbar-thumb:hover,input:focus::-webkit-scrollbar-thumb:hover,select:focus::-webkit-scrollbar-thumb:hover,textarea:focus::-webkit-scrollbar-thumb:hover,.tinymce-wrapper:focus::-webkit-scrollbar-thumb:active,.code-editor:focus::-webkit-scrollbar-thumb:active,.select .selected-container:focus::-webkit-scrollbar-thumb:active,input:focus::-webkit-scrollbar-thumb:active,select:focus::-webkit-scrollbar-thumb:active,textarea:focus::-webkit-scrollbar-thumb:active,.tinymce-wrapper:focus-within::-webkit-scrollbar-thumb:hover,.code-editor:focus-within::-webkit-scrollbar-thumb:hover,.select .selected-container:focus-within::-webkit-scrollbar-thumb:hover,input:focus-within::-webkit-scrollbar-thumb:hover,select:focus-within::-webkit-scrollbar-thumb:hover,textarea:focus-within::-webkit-scrollbar-thumb:hover,.tinymce-wrapper:focus-within::-webkit-scrollbar-thumb:active,.code-editor:focus-within::-webkit-scrollbar-thumb:active,.select .selected-container:focus-within::-webkit-scrollbar-thumb:active,input:focus-within::-webkit-scrollbar-thumb:active,select:focus-within::-webkit-scrollbar-thumb:active,textarea:focus-within::-webkit-scrollbar-thumb:active{background-color:var(--baseAlt4Color)}}[readonly].tinymce-wrapper,[readonly].code-editor,.select [readonly].selected-container,input[readonly],select[readonly],textarea[readonly],.readonly.tinymce-wrapper,.readonly.code-editor,.select .readonly.selected-container,input.readonly,select.readonly,textarea.readonly{cursor:default;color:var(--txtHintColor)}[disabled].tinymce-wrapper,[disabled].code-editor,.select [disabled].selected-container,input[disabled],select[disabled],textarea[disabled],.disabled.tinymce-wrapper,.disabled.code-editor,.select .disabled.selected-container,input.disabled,select.disabled,textarea.disabled{cursor:default;color:var(--txtDisabledColor)}.txt-mono.tinymce-wrapper,.txt-mono.code-editor,.select .txt-mono.selected-container,input.txt-mono,select.txt-mono,textarea.txt-mono{line-height:var(--smLineHeight)}.code.tinymce-wrapper,.code.code-editor,.select .code.selected-container,input.code,select.code,textarea.code{font-size:15px;line-height:1.379rem;font-family:var(--monospaceFontFamily)}input{height:var(--inputHeight)}input:-webkit-autofill{-webkit-text-fill-color:var(--txtPrimaryColor);-webkit-box-shadow:inset 0 0 0 50px var(--baseAlt1Color)}.form-field:focus-within input:-webkit-autofill,input:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 50px var(--baseAlt2Color)}input[type=file]{padding:9px}input[type=checkbox],input[type=radio]{width:auto;height:auto;display:inline}input[type=number]{-moz-appearance:textfield;-webkit-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}textarea{min-height:80px;resize:vertical}select{padding-left:8px}.form-field{--hPadding: 15px;position:relative;display:block;width:100%;margin-bottom:var(--baseSpacing)}.form-field .tinymce-wrapper,.form-field .code-editor,.form-field .select .selected-container,.select .form-field .selected-container,.form-field input,.form-field select,.form-field textarea{z-index:0;padding-left:var(--hPadding);padding-right:var(--hPadding)}.form-field select{padding-left:8px}.form-field label{display:flex;width:100%;column-gap:5px;align-items:center;-webkit-user-select:none;user-select:none;font-weight:600;font-size:var(--smFontSize);letter-spacing:.1px;color:var(--txtHintColor);line-height:1;padding-top:12px;padding-bottom:3px;padding-left:var(--hPadding);padding-right:var(--hPadding);border:0;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.form-field label~.tinymce-wrapper,.form-field label~.code-editor,.form-field .select label~.selected-container,.select .form-field label~.selected-container,.form-field label~input,.form-field label~select,.form-field label~textarea{border-top:0;padding-top:2px;padding-bottom:8px;border-top-left-radius:0;border-top-right-radius:0}.form-field label i{font-size:.96rem;margin-bottom:-1px}.form-field label i:before{margin:0}.form-field .tinymce-wrapper,.form-field .code-editor,.form-field .select .selected-container,.select .form-field .selected-container,.form-field input,.form-field select,.form-field textarea,.form-field label{background:var(--baseAlt1Color);transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.form-field:focus-within .tinymce-wrapper,.form-field:focus-within .code-editor,.form-field:focus-within .select .selected-container,.select .form-field:focus-within .selected-container,.form-field:focus-within input,.form-field:focus-within select,.form-field:focus-within textarea,.form-field:focus-within label{background:var(--baseAlt2Color)}.form-field:focus-within label{color:var(--txtPrimaryColor)}.form-field .form-field-addon{position:absolute;display:inline-flex;align-items:center;z-index:1;top:0;right:var(--hPadding);min-height:var(--inputHeight);color:var(--txtHintColor)}.form-field .form-field-addon .btn{margin-right:-5px}.form-field .form-field-addon:not(.prefix)~.tinymce-wrapper,.form-field .form-field-addon:not(.prefix)~.code-editor,.form-field .select .form-field-addon:not(.prefix)~.selected-container,.select .form-field .form-field-addon:not(.prefix)~.selected-container,.form-field .form-field-addon:not(.prefix)~input,.form-field .form-field-addon:not(.prefix)~select,.form-field .form-field-addon:not(.prefix)~textarea{padding-right:45px}.form-field .form-field-addon.prefix{right:auto;left:var(--hPadding)}.form-field .form-field-addon.prefix~.tinymce-wrapper,.form-field .form-field-addon.prefix~.code-editor,.form-field .select .form-field-addon.prefix~.selected-container,.select .form-field .form-field-addon.prefix~.selected-container,.form-field .form-field-addon.prefix~input,.form-field .form-field-addon.prefix~select,.form-field .form-field-addon.prefix~textarea{padding-left:45px}.form-field label~.form-field-addon{min-height:calc(26px + var(--inputHeight))}.form-field .help-block{position:relative;margin-top:8px;font-size:var(--smFontSize);line-height:var(--smLineHeight);color:var(--txtHintColor);word-break:break-word}.form-field .help-block pre{white-space:pre-wrap}.form-field .help-block-error{color:var(--dangerColor)}.form-field.error>label,.form-field.invalid>label{color:var(--dangerColor)}.form-field.invalid label,.form-field.invalid .tinymce-wrapper,.form-field.invalid .code-editor,.form-field.invalid .select .selected-container,.select .form-field.invalid .selected-container,.form-field.invalid input,.form-field.invalid select,.form-field.invalid textarea{background:var(--dangerAltColor)}.form-field.required:not(.form-field-toggle)>label:after{content:"*";color:var(--dangerColor);margin-top:-2px;margin-left:-2px}.form-field.readonly label,.form-field.readonly .tinymce-wrapper,.form-field.readonly .code-editor,.form-field.readonly .select .selected-container,.select .form-field.readonly .selected-container,.form-field.readonly input,.form-field.readonly select,.form-field.readonly textarea,.form-field.disabled label,.form-field.disabled .tinymce-wrapper,.form-field.disabled .code-editor,.form-field.disabled .select .selected-container,.select .form-field.disabled .selected-container,.form-field.disabled input,.form-field.disabled select,.form-field.disabled textarea{background:var(--baseAlt1Color)}.form-field.readonly>label,.form-field.disabled>label{color:var(--txtHintColor)}.form-field.readonly.required>label:after,.form-field.disabled.required>label:after{opacity:.5}.form-field.disabled label,.form-field.disabled .tinymce-wrapper,.form-field.disabled .code-editor,.form-field.disabled .select .selected-container,.select .form-field.disabled .selected-container,.form-field.disabled input,.form-field.disabled select,.form-field.disabled textarea{box-shadow:inset 0 0 0 var(--btnHeight) #ffffff73}.form-field.disabled>label{color:var(--txtDisabledColor)}.form-field input[type=radio],.form-field input[type=checkbox]{position:absolute;z-index:-1;left:0;width:0;height:0;min-height:0;min-width:0;border:0;background:none;-webkit-user-select:none;user-select:none;pointer-events:none;box-shadow:none;opacity:0}.form-field input[type=radio]~label,.form-field input[type=checkbox]~label{border:0;margin:0;outline:0;background:none;display:inline-flex;vertical-align:top;align-items:center;width:auto;column-gap:5px;-webkit-user-select:none;user-select:none;padding:0 0 0 27px;line-height:20px;min-height:20px;font-weight:400;font-size:var(--baseFontSize);text-transform:none;color:var(--txtPrimaryColor)}.form-field input[type=radio]~label:before,.form-field input[type=checkbox]~label:before{content:"";display:inline-block;vertical-align:top;position:absolute;z-index:0;left:0;top:0;width:20px;height:20px;line-height:16px;font-family:var(--iconFontFamily);font-size:1.2rem;text-align:center;color:var(--baseColor);cursor:pointer;background:var(--baseColor);border-radius:var(--baseRadius);border:2px solid var(--baseAlt3Color);transition:transform var(--baseAnimationSpeed),border-color var(--baseAnimationSpeed),color var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.form-field input[type=radio]~label:active:before,.form-field input[type=checkbox]~label:active:before{transform:scale(.9)}.form-field input[type=radio]:focus~label:before,.form-field input[type=radio]~label:hover:before,.form-field input[type=checkbox]:focus~label:before,.form-field input[type=checkbox]~label:hover:before{border-color:var(--baseAlt4Color)}.form-field input[type=radio]:checked~label:before,.form-field input[type=checkbox]:checked~label:before{content:"";box-shadow:none;mix-blend-mode:unset;background:var(--successColor);border-color:var(--successColor)}.form-field input[type=radio]:disabled~label,.form-field input[type=checkbox]:disabled~label{pointer-events:none;cursor:not-allowed;color:var(--txtDisabledColor)}.form-field input[type=radio]:disabled~label:before,.form-field input[type=checkbox]:disabled~label:before{opacity:.5}.form-field input[type=radio]~label:before{border-radius:50%;font-size:1rem}.form-field .form-field-block{position:relative;margin:0 0 var(--xsSpacing)}.form-field .form-field-block:last-child{margin-bottom:0}.form-field.form-field-toggle input[type=radio]~label,.form-field.form-field-toggle input[type=checkbox]~label{position:relative}.form-field.form-field-toggle input[type=radio]~label:before,.form-field.form-field-toggle input[type=checkbox]~label:before{content:"";border:0;box-shadow:none;background:var(--baseAlt3Color);transition:background var(--activeAnimationSpeed)}.form-field.form-field-toggle input[type=radio]~label:after,.form-field.form-field-toggle input[type=checkbox]~label:after{content:"";position:absolute;z-index:1;cursor:pointer;background:var(--baseColor);transition:left var(--activeAnimationSpeed),transform var(--activeAnimationSpeed),background var(--activeAnimationSpeed);box-shadow:0 2px 5px 0 var(--shadowColor)}.form-field.form-field-toggle input[type=radio]~label:active:before,.form-field.form-field-toggle input[type=checkbox]~label:active:before{transform:none}.form-field.form-field-toggle input[type=radio]~label:active:after,.form-field.form-field-toggle input[type=checkbox]~label:active:after{transform:scale(.9)}.form-field.form-field-toggle input[type=radio]:focus-visible~label:before,.form-field.form-field-toggle input[type=checkbox]:focus-visible~label:before{box-shadow:0 0 0 2px var(--baseAlt2Color)}.form-field.form-field-toggle input[type=radio]~label:hover:before,.form-field.form-field-toggle input[type=checkbox]~label:hover:before{background:var(--baseAlt4Color)}.form-field.form-field-toggle input[type=radio]:checked~label:before,.form-field.form-field-toggle input[type=checkbox]:checked~label:before{background:var(--successColor)}.form-field.form-field-toggle input[type=radio]:checked~label:after,.form-field.form-field-toggle input[type=checkbox]:checked~label:after{background:var(--baseColor)}.form-field.form-field-toggle input[type=radio]~label,.form-field.form-field-toggle input[type=checkbox]~label{min-height:24px;padding-left:47px}.form-field.form-field-toggle input[type=radio]~label:empty,.form-field.form-field-toggle input[type=checkbox]~label:empty{padding-left:40px}.form-field.form-field-toggle input[type=radio]~label:before,.form-field.form-field-toggle input[type=checkbox]~label:before{width:40px;height:24px;border-radius:24px}.form-field.form-field-toggle input[type=radio]~label:after,.form-field.form-field-toggle input[type=checkbox]~label:after{top:4px;left:4px;width:16px;height:16px;border-radius:16px}.form-field.form-field-toggle input[type=radio]:checked~label:after,.form-field.form-field-toggle input[type=checkbox]:checked~label:after{left:20px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label{min-height:20px;padding-left:39px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label:empty,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label:empty{padding-left:32px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label:before,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label:before{width:32px;height:20px;border-radius:20px}.form-field.form-field-toggle.form-field-sm input[type=radio]~label:after,.form-field.form-field-toggle.form-field-sm input[type=checkbox]~label:after{top:4px;left:4px;width:12px;height:12px;border-radius:12px}.form-field.form-field-toggle.form-field-sm input[type=radio]:checked~label:after,.form-field.form-field-toggle.form-field-sm input[type=checkbox]:checked~label:after{left:16px}.form-field-group{display:flex;width:100%;align-items:center}.form-field-group>.form-field{flex-grow:1;border-left:1px solid var(--baseAlt2Color)}.form-field-group>.form-field:first-child{border-left:0}.form-field-group>.form-field:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.form-field-group>.form-field:not(:first-child)>label{border-top-left-radius:0}.form-field-group>.form-field:not(:first-child)>.tinymce-wrapper,.form-field-group>.form-field:not(:first-child)>.code-editor,.select .form-field-group>.form-field:not(:first-child)>.selected-container,.form-field-group>.form-field:not(:first-child)>input,.form-field-group>.form-field:not(:first-child)>select,.form-field-group>.form-field:not(:first-child)>textarea,.form-field-group>.form-field:not(:first-child)>.select .selected-container{border-bottom-left-radius:0}.form-field-group>.form-field:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.form-field-group>.form-field:not(:last-child)>label{border-top-right-radius:0}.form-field-group>.form-field:not(:last-child)>.tinymce-wrapper,.form-field-group>.form-field:not(:last-child)>.code-editor,.select .form-field-group>.form-field:not(:last-child)>.selected-container,.form-field-group>.form-field:not(:last-child)>input,.form-field-group>.form-field:not(:last-child)>select,.form-field-group>.form-field:not(:last-child)>textarea,.form-field-group>.form-field:not(:last-child)>.select .selected-container{border-bottom-right-radius:0}.form-field-group .form-field.col-12{width:100%}.form-field-group .form-field.col-11{width:91.6666666667%}.form-field-group .form-field.col-10{width:83.3333333333%}.form-field-group .form-field.col-9{width:75%}.form-field-group .form-field.col-8{width:66.6666666667%}.form-field-group .form-field.col-7{width:58.3333333333%}.form-field-group .form-field.col-6{width:50%}.form-field-group .form-field.col-5{width:41.6666666667%}.form-field-group .form-field.col-4{width:33.3333333333%}.form-field-group .form-field.col-3{width:25%}.form-field-group .form-field.col-2{width:16.6666666667%}.form-field-group .form-field.col-1{width:8.3333333333%}.select{position:relative;display:block;outline:0}.select .option{-webkit-user-select:none;user-select:none;column-gap:5px}.select .option .icon{min-width:20px;text-align:center;line-height:inherit}.select .option .icon i{vertical-align:middle;line-height:inherit}.select .txt-placeholder{color:var(--txtHintColor)}label~.select .selected-container{border-top:0}.select .selected-container{position:relative;display:flex;flex-wrap:wrap;width:100%;align-items:center;padding-top:0;padding-bottom:0;padding-right:35px!important;-webkit-user-select:none;user-select:none}.select .selected-container:after{content:"";position:absolute;right:5px;top:50%;width:20px;height:20px;line-height:20px;text-align:center;margin-top:-10px;display:inline-block;vertical-align:top;font-size:1rem;font-family:var(--iconFontFamily);align-self:flex-end;color:var(--txtHintColor);transition:color var(--baseAnimationSpeed),transform var(--baseAnimationSpeed)}.select .selected-container:active,.select .selected-container.active{border-bottom-left-radius:0;border-bottom-right-radius:0}.select .selected-container:active:after,.select .selected-container.active:after{color:var(--txtPrimaryColor);transform:rotate(180deg)}.select .selected-container .option{display:flex;width:100%;align-items:center;max-width:100%;-webkit-user-select:text;user-select:text}.select .selected-container .clear{margin-left:auto;cursor:pointer;color:var(--txtHintColor);transition:color var(--baseAnimationSpeed)}.select .selected-container .clear i{display:inline-block;vertical-align:middle;line-height:1}.select .selected-container .clear:hover{color:var(--txtPrimaryColor)}.select.multiple .selected-container{display:flex;align-items:center;padding-left:2px;row-gap:3px;column-gap:4px}.select.multiple .selected-container .txt-placeholder{margin-left:5px}.select.multiple .selected-container .option{display:inline-flex;width:auto;padding:3px 5px;line-height:1;border-radius:var(--baseRadius);background:var(--baseColor)}.select:not(.multiple) .selected-container .label{margin-left:-2px}.select:not(.multiple) .selected-container .option .txt{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:100%;line-height:normal}.select:not(.disabled) .selected-container:hover{cursor:pointer}.select.readonly,.select.disabled{color:var(--txtHintColor);pointer-events:none}.select.readonly .txt-placeholder,.select.disabled .txt-placeholder,.select.readonly .selected-container,.select.disabled .selected-container{color:inherit}.select.readonly .selected-container .link-hint,.select.disabled .selected-container .link-hint{pointer-events:auto}.select.readonly .selected-container *:not(.link-hint),.select.disabled .selected-container *:not(.link-hint){color:inherit!important}.select.readonly .selected-container:after,.select.readonly .selected-container .clear,.select.disabled .selected-container:after,.select.disabled .selected-container .clear{display:none}.select.readonly .selected-container:hover,.select.disabled .selected-container:hover{cursor:inherit}.select.disabled{color:var(--txtDisabledColor)}.select .txt-missing{color:var(--txtHintColor);padding:5px 12px;margin:0}.select .options-dropdown{max-height:none;border:0;overflow:auto;border-top-left-radius:0;border-top-right-radius:0;margin-top:-2px;box-shadow:0 2px 5px 0 var(--shadowColor),inset 0 0 0 2px var(--baseAlt2Color)}.select .options-dropdown .input-group:focus-within{box-shadow:none}.select .options-dropdown .form-field.options-search{margin:0 0 5px;padding:0 0 2px;color:var(--txtHintColor);border-bottom:1px solid var(--baseAlt2Color)}.select .options-dropdown .form-field.options-search .input-group{border-radius:0;padding:0 0 0 10px;margin:0;background:none;column-gap:0;border:0}.select .options-dropdown .form-field.options-search input{border:0;padding-left:9px;padding-right:9px;background:none}.select .options-dropdown .options-list{overflow:auto;max-height:240px;width:auto;margin-left:0;margin-right:-5px;padding-right:5px}.select .options-list:not(:empty)~[slot=afterOptions]:not(:empty){margin:5px -5px -5px}.select .options-list:not(:empty)~[slot=afterOptions]:not(:empty) .btn-block{border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius)}label~.select .selected-container{padding-bottom:4px;border-top-left-radius:0;border-top-right-radius:0}label~.select.multiple .selected-container{padding-top:3px;padding-bottom:3px;padding-left:10px}.select.block-options.multiple .selected-container .option{width:100%;box-shadow:0 2px 5px 0 var(--shadowColor)}.select.upside .selected-container.active{border-radius:0 0 var(--baseRadius) var(--baseRadius)}.select.upside .options-dropdown{border-radius:var(--baseRadius) var(--baseRadius) 0 0;margin:0}.field-type-select .options-dropdown{padding:2px 1px 1px 2px}.field-type-select .options-dropdown .form-field.options-search{margin:0}.field-type-select .options-dropdown .options-list{max-height:490px;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;padding:0}.field-type-select .options-dropdown .dropdown-item{width:50%;margin:0;padding-left:12px;border-radius:0;border-bottom:1px solid var(--baseAlt2Color);border-right:1px solid var(--baseAlt2Color)}.field-type-select .options-dropdown .dropdown-item.selected{background:var(--baseAlt1Color)}.form-field-list{border-radius:var(--baseRadius);transition:box-shadow var(--baseAnimationSpeed)}.form-field-list label{padding-bottom:10px}.form-field-list .list{background:var(--baseAlt1Color);border:0;border-radius:0;border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius);transition:background var(--baseAnimationSpeed)}.form-field-list .list .list-item{border-top:1px solid var(--baseAlt2Color)}.form-field-list .list .list-item:hover,.form-field-list .list .list-item:focus,.form-field-list .list .list-item:focus-within,.form-field-list .list .list-item:focus-visible,.form-field-list .list .list-item:active{background:none}.form-field-list .list .list-item.selected{background:var(--baseAlt2Color)}.form-field-list .list .list-item.handle:not(.disabled):hover,.form-field-list .list .list-item.handle:not(.disabled):focus-visible{background:var(--baseAlt2Color)}.form-field-list .list .list-item.handle:not(.disabled):active{background:var(--baseAlt3Color)}.form-field-list .list .list-item.dragging{z-index:9;box-shadow:inset 0 0 0 1px var(--baseAlt3Color)}.form-field-list .list .list-item.dragover{background:var(--baseAlt2Color)}.form-field-list:focus-within .list,.form-field-list:focus-within label{background:var(--baseAlt1Color)}.form-field-list.dragover:not(:has(.dragging)){box-shadow:0 0 0 2px var(--warningColor)}.code-editor{display:flex;flex-direction:column;width:100%}.form-field label~.code-editor{padding-bottom:6px;padding-top:4px}.code-editor .cm-editor{flex-grow:1;border:0!important;outline:none!important}.code-editor .cm-editor .cm-line{padding-left:0;padding-right:0}.code-editor .cm-editor .cm-tooltip-autocomplete{box-shadow:0 2px 5px 0 var(--shadowColor);border-radius:var(--baseRadius);background:var(--baseColor);border:0;z-index:9999;padding:0 3px;font-size:.92rem}.code-editor .cm-editor .cm-tooltip-autocomplete ul{margin:0;border-radius:inherit}.code-editor .cm-editor .cm-tooltip-autocomplete ul>:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.code-editor .cm-editor .cm-tooltip-autocomplete ul>:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.code-editor .cm-editor .cm-tooltip-autocomplete ul li[aria-selected]{background:var(--infoColor)}.code-editor .cm-editor .cm-scroller{flex-grow:1;outline:0!important;font-family:var(--monospaceFontFamily);font-size:var(--baseFontSize);line-height:var(--baseLineHeight)}.code-editor .cm-editor .cm-cursorLayer .cm-cursor{margin-left:0!important}.code-editor .cm-editor .cm-placeholder{color:var(--txtDisabledColor);font-family:var(--monospaceFontFamily);font-size:var(--baseFontSize);line-height:var(--baseLineHeight)}.code-editor .cm-editor .cm-selectionMatch{background:var(--infoAltColor)}.code-editor .cm-editor.cm-focused .cm-matchingBracket{background-color:#328c821a}.code-editor .ͼf{color:var(--dangerColor)}.tinymce-wrapper{min-height:277px}.tinymce-wrapper .tox-tinymce{border-radius:var(--baseRadius);border:0}.form-field label~.tinymce-wrapper{position:relative;z-index:auto;padding:5px 2px 2px}.form-field label~.tinymce-wrapper:before{content:"";position:absolute;z-index:-1;top:5px;left:2px;right:2px;bottom:2px;background:#fff;border-radius:var(--baseRadius)}body .tox .tox-dialog{border:0;border-radius:var(--baseRadius)}body .tox .tox-dialog-wrap__backdrop{background:var(--overlayColor)}body .tox .tox-tbtn{height:30px}body .tox .tox-tbtn svg{transform:scale(.85)}body .tox .tox-collection__item-checkmark,body .tox .tox-collection__item-icon{width:22px;height:22px;transform:scale(.85)}body .tox .tox-tbtn:not(.tox-tbtn--select){width:30px}body .tox .tox-button,body .tox .tox-button--secondary{font-size:var(--smFontSize)}body .tox .tox-toolbar-overlord{box-shadow:0 2px 5px 0 var(--shadowColor)}body .tox .tox-listboxfield .tox-listbox--select,body .tox .tox-textarea,body .tox .tox-textfield,body .tox .tox-toolbar-textfield{padding:3px 5px}body .tox-swatch:not(.tox-swatch--remove):not(.tox-collection__item--enabled) svg{display:none}body .tox .tox-textarea-wrap{display:flex;flex:1}body.tox-fullscreen .overlay-panel-section{overflow:hidden}.main-menu{--menuItemSize: 45px;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:var(--smSpacing);font-size:var(--xlFontSize);color:var(--txtPrimaryColor)}.main-menu i{font-size:24px;line-height:1}.main-menu .menu-item{position:relative;outline:0;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;text-align:center;justify-content:center;-webkit-user-select:none;user-select:none;color:inherit;min-width:var(--menuItemSize);min-height:var(--menuItemSize);border:2px solid transparent;border-radius:var(--lgRadius);transition:background var(--baseAnimationSpeed),border var(--baseAnimationSpeed)}.main-menu .menu-item:focus-visible,.main-menu .menu-item:hover{background:var(--baseAlt1Color)}.main-menu .menu-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.main-menu .menu-item.active,.main-menu .menu-item.current-route{background:var(--baseColor);border-color:var(--primaryColor)}.app-sidebar{position:relative;z-index:1;display:flex;flex-grow:0;flex-shrink:0;flex-direction:column;align-items:center;width:var(--appSidebarWidth);padding:var(--smSpacing) 0px var(--smSpacing);background:var(--baseColor);border-right:1px solid var(--baseAlt2Color)}.app-sidebar .main-menu{flex-grow:1;justify-content:flex-start;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;margin-top:34px;margin-bottom:var(--baseSpacing)}.app-layout{display:flex;width:100%;height:100vh}.app-layout .app-body{flex-grow:1;min-width:0;height:100%;display:flex;align-items:stretch}.app-layout .app-sidebar~.app-body{min-width:650px}.page-sidebar{--sidebarListItemMargin: 10px;position:relative;z-index:0;display:flex;flex-direction:column;width:var(--pageSidebarWidth);min-width:var(--pageSidebarWidth);max-width:400px;flex-shrink:0;flex-grow:0;overflow-x:hidden;overflow-y:auto;background:var(--baseColor);padding:calc(var(--baseSpacing) - 5px) 0 var(--smSpacing);border-right:1px solid var(--baseAlt2Color)}.page-sidebar>*{padding:0 var(--xsSpacing)}.page-sidebar .sidebar-content{overflow-x:hidden;overflow-y:auto;overflow-y:overlay}.page-sidebar .sidebar-content>:first-child{margin-top:0}.page-sidebar .sidebar-content>:last-child{margin-bottom:0}.page-sidebar .sidebar-footer{margin-top:var(--smSpacing)}.page-sidebar .search{display:flex;align-items:center;width:auto;column-gap:5px;margin:0 0 var(--xsSpacing);color:var(--txtHintColor);opacity:.7;transition:opacity var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.page-sidebar .search input{border:0;background:var(--baseColor);transition:box-shadow var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.page-sidebar .search .btn-clear{margin-right:-8px}.page-sidebar .search:hover,.page-sidebar .search:focus-within,.page-sidebar .search.active{opacity:1;color:var(--txtPrimaryColor)}.page-sidebar .search:hover input,.page-sidebar .search:focus-within input,.page-sidebar .search.active input{background:var(--baseAlt2Color)}.page-sidebar .sidebar-title{display:flex;align-items:center;gap:5px;width:100%;margin:var(--baseSpacing) 5px var(--xsSpacing);font-weight:600;font-size:1rem;line-height:var(--smLineHeight);color:var(--txtHintColor)}.page-sidebar .sidebar-title .label{font-weight:400}.page-sidebar .sidebar-list-item{cursor:pointer;outline:0;text-decoration:none;position:relative;display:flex;width:100%;align-items:center;column-gap:10px;margin:var(--sidebarListItemMargin) 0;padding:3px 10px;font-size:var(--xlFontSize);min-height:var(--btnHeight);min-width:0;color:var(--txtHintColor);border-radius:var(--baseRadius);-webkit-user-select:none;user-select:none;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.page-sidebar .sidebar-list-item i{font-size:18px}.page-sidebar .sidebar-list-item .txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.page-sidebar .sidebar-list-item:focus-visible,.page-sidebar .sidebar-list-item:hover,.page-sidebar .sidebar-list-item:active,.page-sidebar .sidebar-list-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.page-sidebar .sidebar-list-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.page-sidebar .sidebar-content-compact .sidebar-list-item{--sidebarListItemMargin: 5px}@media screen and (max-height: 600px){.page-sidebar{--sidebarListItemMargin: 5px}}@media screen and (max-width: 1100px){.page-sidebar{min-width:200px}.page-sidebar>*{padding-left:10px;padding-right:10px}}.page-header{display:flex;flex-shrink:0;align-items:center;width:100%;min-height:var(--btnHeight);gap:var(--xsSpacing);margin:0 0 var(--baseSpacing)}.page-header .btns-group{margin-left:auto;justify-content:end}@media screen and (max-width: 1050px){.page-header{flex-wrap:wrap}.page-header .btns-group{width:100%}.page-header .btns-group .btn{flex-grow:1;flex-basis:0}}.page-header-wrapper{background:var(--baseColor);width:auto;margin-top:calc(-1 * (var(--baseSpacing) - 5px));margin-left:calc(-1 * var(--baseSpacing));margin-right:calc(-1 * var(--baseSpacing));margin-bottom:var(--baseSpacing);padding:calc(var(--baseSpacing) - 5px) var(--baseSpacing);border-bottom:1px solid var(--baseAlt2Color)}.breadcrumbs{display:flex;align-items:center;gap:30px;color:var(--txtDisabledColor)}.breadcrumbs .breadcrumb-item{position:relative;margin:0;line-height:1;font-weight:400}.breadcrumbs .breadcrumb-item:after{content:"/";position:absolute;right:-20px;top:0;width:10px;text-align:center;pointer-events:none;opacity:.4}.breadcrumbs .breadcrumb-item:last-child{word-break:break-word;color:var(--txtPrimaryColor)}.breadcrumbs .breadcrumb-item:last-child:after{content:none;display:none}.breadcrumbs a{text-decoration:none;color:inherit;transition:color var(--baseAnimationSpeed)}.breadcrumbs a:hover{color:var(--txtPrimaryColor)}.page-content{position:relative;display:block;width:100%;flex-grow:1;padding:calc(var(--baseSpacing) - 5px) var(--baseSpacing) var(--smSpacing)}.page-footer{display:flex;gap:5px;align-items:center;justify-content:right;padding:0px var(--baseSpacing) var(--smSpacing);color:var(--txtDisabledColor);font-size:var(--xsFontSize);line-height:var(--smLineHeight)}.page-footer i{font-size:1.2em}.page-footer a{color:inherit;text-decoration:none;transition:color var(--baseAnimationSpeed)}.page-footer a:focus-visible,.page-footer a:hover,.page-footer a:active{color:var(--txtPrimaryColor)}.page-wrapper{display:flex;flex-direction:column;flex-grow:1;width:100%;overflow-x:hidden;overflow-y:auto;scroll-behavior:smooth;scrollbar-gutter:stable}.overlay-active .page-wrapper{overflow-y:hidden}.page-wrapper.full-page{scrollbar-gutter:auto;background:var(--baseColor)}.page-wrapper.center-content .page-content{display:flex;align-items:center}.page-wrapper.flex-content{scrollbar-gutter:auto}.page-wrapper.flex-content .page-content{display:flex;min-height:0;flex-direction:column}@keyframes tabChange{0%{opacity:.7}to{opacity:1}}.tabs-header{display:flex;align-items:stretch;justify-content:flex-start;column-gap:10px;width:100%;min-height:50px;-webkit-user-select:none;user-select:none;margin:0 0 var(--baseSpacing);border-bottom:2px solid var(--baseAlt2Color)}.tabs-header .tab-item{position:relative;outline:0;border:0;background:none;display:inline-flex;align-items:center;justify-content:center;min-width:70px;gap:5px;padding:10px;margin:0;font-size:var(--lgFontSize);line-height:var(--baseLineHeight);font-family:var(--baseFontFamily);color:var(--txtHintColor);text-align:center;text-decoration:none;cursor:pointer;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius);transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}.tabs-header .tab-item:after{content:"";position:absolute;display:block;left:0;bottom:-2px;width:100%;height:2px;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius);background:var(--primaryColor);transform:rotateY(90deg);transition:transform .2s}.tabs-header .tab-item .txt,.tabs-header .tab-item i{display:inline-block;vertical-align:top}.tabs-header .tab-item:hover,.tabs-header .tab-item:focus-visible,.tabs-header .tab-item:active{color:var(--txtPrimaryColor)}.tabs-header .tab-item:focus-visible,.tabs-header .tab-item:active{transition-duration:var(--activeAnimationSpeed);background:var(--baseAlt2Color)}.tabs-header .tab-item.active{color:var(--txtPrimaryColor)}.tabs-header .tab-item.active:after{transform:rotateY(0)}.tabs-header .tab-item.disabled{pointer-events:none;color:var(--txtDisabledColor)}.tabs-header .tab-item.disabled:after{display:none}.tabs-header.right{justify-content:flex-end}.tabs-header.center{justify-content:center}.tabs-header.stretched .tab-item{flex-grow:1;flex-basis:0}.tabs-header.compact{min-height:30px;margin-bottom:var(--smSpacing)}.tabs-header.combined{border:0;margin-bottom:-2px}.tabs-header.combined .tab-item:after{content:none;display:none}.tabs-header.combined .tab-item.active{background:var(--baseAlt1Color)}.tabs-content{position:relative}.tabs-content>.tab-item{width:100%;display:none}.tabs-content>.tab-item.active{display:block;opacity:0;animation:tabChange .2s forwards}.tabs-content>.tab-item>:first-child{margin-top:0}.tabs-content>.tab-item>:last-child{margin-bottom:0}.tabs-content.no-animations>.tab-item.active{opacity:1;animation:none}.tabs{position:relative}.accordion{outline:0;position:relative;border-radius:var(--baseRadius);background:var(--baseColor);border:1px solid var(--baseAlt2Color);transition:border-radius var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed),margin var(--baseAnimationSpeed)}.accordion .accordion-header{outline:0;position:relative;display:flex;min-height:52px;align-items:center;row-gap:10px;column-gap:var(--smSpacing);padding:12px 20px 10px;width:100%;-webkit-user-select:none;user-select:none;color:var(--txtPrimaryColor);border-radius:inherit;transition:border-radius var(--baseAnimationSpeed),background var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.accordion .accordion-header .icon{width:18px;text-align:center}.accordion .accordion-header .icon i{display:inline-block;vertical-align:top;font-size:1.1rem}.accordion .accordion-header.interactive{padding-right:50px;cursor:pointer}.accordion .accordion-header.interactive:after{content:"";position:absolute;right:15px;top:50%;margin-top:-12.5px;width:25px;height:25px;line-height:25px;color:var(--txtHintColor);font-family:var(--iconFontFamily);font-size:1.3em;text-align:center;transition:color var(--baseAnimationSpeed)}.accordion .accordion-header:hover:after,.accordion .accordion-header.focus:after,.accordion .accordion-header:focus-visible:after{color:var(--txtPrimaryColor)}.accordion .accordion-header:active{transition-duration:var(--activeAnimationSpeed)}.accordion .accordion-content{padding:20px}.accordion:hover,.accordion:focus-visible,.accordion.active{z-index:9}.accordion:hover .accordion-header.interactive,.accordion:focus-visible .accordion-header.interactive,.accordion.active .accordion-header.interactive{background:var(--baseAlt1Color)}.accordion.drag-over .accordion-header{background:var(--bodyColor)}.accordion.active{box-shadow:0 2px 5px 0 var(--shadowColor)}.accordion.active .accordion-header{position:relative;top:0;z-index:9;box-shadow:0 0 0 1px var(--baseAlt2Color);border-bottom-left-radius:0;border-bottom-right-radius:0;background:var(--bodyColor)}.accordion.active .accordion-header.interactive{background:var(--bodyColor)}.accordion.active .accordion-header.interactive:after{color:inherit;content:""}.accordion.disabled{z-index:0;border-color:var(--baseAlt1Color)}.accordion.disabled .accordion-header{color:var(--txtDisabledColor)}.accordions .accordion{border-radius:0;margin:-1px 0 0}.accordions .accordion:has(+.accordion.active){border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius)}.accordions>.accordion.active,.accordions>.accordion-wrapper>.accordion.active{margin:var(--smSpacing) 0;border-radius:var(--baseRadius)}.accordions>.accordion.active+.accordion,.accordions>.accordion-wrapper>.accordion.active+.accordion{border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.accordions>.accordion:first-child,.accordions>.accordion-wrapper:first-child>.accordion{margin-top:0;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius)}.accordions>.accordion:last-child,.accordions>.accordion-wrapper:last-child>.accordion{margin-bottom:0;border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius)}table{--entranceAnimationSpeed: .3s;border-collapse:separate;min-width:100%;transition:opacity var(--baseAnimationSpeed)}table .form-field{margin:0;line-height:1;text-align:left}table .txt-ellipsis{flex-shrink:0}table td,table th{outline:0;vertical-align:middle;position:relative;text-align:left;padding:10px;border-bottom:1px solid var(--baseAlt2Color)}table td:first-child,table th:first-child{padding-left:20px}table td:last-child,table th:last-child{padding-right:20px}table th{color:var(--txtHintColor);font-weight:600;font-size:1rem;-webkit-user-select:none;user-select:none;height:50px;line-height:var(--smLineHeight)}table th i{font-size:inherit}table td{height:60px;word-break:break-word}table .min-width{width:1%!important;white-space:nowrap}table .nowrap{white-space:nowrap}table .col-sort{cursor:pointer;border-top-left-radius:var(--baseRadius);border-top-right-radius:var(--baseRadius);padding-right:30px;transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed)}table .col-sort:after{content:"";position:absolute;right:10px;top:50%;margin-top:-12.5px;line-height:25px;height:25px;font-family:var(--iconFontFamily);font-weight:400;color:var(--txtHintColor);opacity:0;transition:color var(--baseAnimationSpeed),opacity var(--baseAnimationSpeed)}table .col-sort.sort-desc:after{content:""}table .col-sort.sort-asc:after{content:""}table .col-sort.sort-active:after{opacity:1}table .col-sort:hover,table .col-sort:focus-visible{background:var(--baseAlt1Color)}table .col-sort:hover:after,table .col-sort:focus-visible:after{opacity:1}table .col-sort:active{transition-duration:var(--activeAnimationSpeed);background:var(--baseAlt2Color)}table .col-sort.col-sort-disabled{cursor:default;background:none}table .col-sort.col-sort-disabled:after{display:none}table .col-header-content{display:inline-flex;align-items:center;flex-wrap:nowrap;gap:5px}table .col-header-content .txt{max-width:140px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}table td.col-field-username,table .col-field-created,table .col-field-updated,table .col-type-action{width:1%!important;white-space:nowrap}table .col-type-action{white-space:nowrap;text-align:right;color:var(--txtHintColor)}table .col-type-action i{display:inline-block;vertical-align:top;transition:transform var(--baseAnimationSpeed)}table td.col-type-json{font-family:monospace;font-size:var(--smFontSize);line-height:var(--smLineHeight);max-width:300px}table .col-type-text{max-width:300px}table .col-type-editor{min-width:300px}table .col-type-select{min-width:150px}table .col-type-email{min-width:120px;white-space:nowrap}table .col-type-file{min-width:100px}table .col-type-number{white-space:nowrap}table td.col-field-id{width:175px;white-space:nowrap}table tr{outline:0;background:var(--bodyColor);transition:background var(--baseAnimationSpeed)}table tr.row-handle{cursor:pointer;-webkit-user-select:none;user-select:none}table tr.row-handle:focus-visible,table tr.row-handle:hover,table tr.row-handle:active{background:var(--baseAlt1Color)}table tr.row-handle:focus-visible .action-col,table tr.row-handle:hover .action-col,table tr.row-handle:active .action-col{color:var(--txtPrimaryColor)}table tr.row-handle:focus-visible .action-col i,table tr.row-handle:hover .action-col i,table tr.row-handle:active .action-col i{transform:translate(3px)}table tr.row-handle:active{transition-duration:var(--activeAnimationSpeed)}table.table-border{border:1px solid var(--baseAlt2Color);border-radius:var(--baseRadius)}table.table-border tr{background:var(--baseColor)}table.table-border td,table.table-border th{height:45px}table.table-border th{background:var(--baseAlt1Color)}table.table-border>:last-child>:last-child th,table.table-border>:last-child>:last-child td{border-bottom:0}table.table-border>tr:first-child>:first-child,table.table-border>:first-child>tr:first-child>:first-child{border-top-left-radius:var(--baseRadius)}table.table-border>tr:first-child>:last-child,table.table-border>:first-child>tr:first-child>:last-child{border-top-right-radius:var(--baseRadius)}table.table-border>tr:last-child>:first-child,table.table-border>:last-child>tr:last-child>:first-child{border-bottom-left-radius:var(--baseRadius)}table.table-border>tr:last-child>:last-child,table.table-border>:last-child>tr:last-child>:last-child{border-bottom-right-radius:var(--baseRadius)}table.table-compact td,table.table-compact th{height:auto}table.table-animate tr{animation:entranceTop var(--entranceAnimationSpeed)}table.table-loading{pointer-events:none;opacity:.7}.table-wrapper{width:auto;padding:0;max-height:100%;max-width:calc(100% + 2 * var(--baseSpacing));margin-left:calc(var(--baseSpacing) * -1);margin-right:calc(var(--baseSpacing) * -1);border-bottom:1px solid var(--baseAlt2Color)}.table-wrapper .bulk-select-col{min-width:70px}.table-wrapper td,.table-wrapper th{position:relative}.table-wrapper td:first-child,.table-wrapper th:first-child{padding-left:calc(var(--baseSpacing) + 3px)}.table-wrapper td:last-child,.table-wrapper th:last-child{padding-right:calc(var(--baseSpacing) + 3px)}.table-wrapper thead{position:sticky;top:0;z-index:100;transition:box-shadow var(--baseAnimationSpeed)}.table-wrapper tbody{position:relative;z-index:0}.table-wrapper tbody tr:last-child td,.table-wrapper tbody tr:last-child th{border-bottom:0}.table-wrapper .bulk-select-col,.table-wrapper .col-type-action{position:sticky;z-index:99;transition:box-shadow var(--baseAnimationSpeed)}.table-wrapper .bulk-select-col{left:0}.table-wrapper .col-type-action{right:0}.table-wrapper .bulk-select-col,.table-wrapper .col-type-action{background:inherit}.table-wrapper th.bulk-select-col,.table-wrapper th.col-type-action{background:var(--bodyColor)}.table-wrapper.h-scroll .bulk-select-col{box-shadow:3px 0 5px 0 var(--shadowColor)}.table-wrapper.h-scroll .col-type-action{box-shadow:-3px 0 5px 0 var(--shadowColor)}.table-wrapper.h-scroll.h-scroll-start .bulk-select-col,.table-wrapper.h-scroll.h-scroll-end .col-type-action{box-shadow:none}.table-wrapper.v-scroll:not(.v-scroll-start) thead{box-shadow:0 2px 5px 0 var(--shadowColor)}.searchbar{--searchHeight: 44px;outline:0;display:flex;align-items:center;min-height:var(--searchHeight);width:100%;padding:5px 7px;margin:0;white-space:nowrap;color:var(--txtHintColor);background:var(--baseAlt1Color);border-radius:var(--btnHeight);transition:color var(--baseAnimationSpeed),background var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed)}.searchbar>:first-child{border-top-left-radius:var(--btnHeight);border-bottom-left-radius:var(--btnHeight)}.searchbar>:last-child{border-top-right-radius:var(--btnHeight);border-bottom-right-radius:var(--btnHeight)}.searchbar .btn{border-radius:var(--btnHeight)}.searchbar .code-editor,.searchbar input,.searchbar input:focus{font-size:var(--baseFontSize);font-family:var(--monospaceFontFamily);border:0;background:none;min-height:0;padding-top:0;padding-bottom:0}.searchbar label>i{line-height:inherit}.searchbar .search-options{flex-shrink:0;width:90px}.searchbar .search-options .selected-container{border-radius:inherit;background:none;padding-right:25px!important}.searchbar .search-options:not(:focus-within) .selected-container{color:var(--txtHintColor)}.searchbar:focus-within{color:var(--txtPrimaryColor);background:var(--baseAlt2Color)}.bulkbar{position:absolute;bottom:var(--baseSpacing);left:50%;z-index:101;gap:10px;display:flex;justify-content:center;align-items:center;width:var(--smWrapperWidth);max-width:100%;margin-bottom:10px;padding:10px var(--smSpacing);border-radius:var(--btnHeight);background:var(--baseColor);border:1px solid var(--baseAlt2Color);box-shadow:0 2px 5px 0 var(--shadowColor);transform:translate(-50%)}.flatpickr-calendar{opacity:0;display:none;text-align:center;visibility:hidden;padding:0;animation:none;direction:ltr;border:0;font-size:1rem;line-height:24px;position:absolute;width:298px;box-sizing:border-box;-webkit-user-select:none;user-select:none;color:var(--txtPrimaryColor);background:var(--baseColor);border-radius:var(--baseRadius);box-shadow:0 2px 5px 0 var(--shadowColor),0 0 0 1px var(--baseAlt2Color)}.flatpickr-calendar input,.flatpickr-calendar select{box-shadow:none;min-height:0;height:var(--smBtnHeight);padding-top:3px;padding-bottom:3px;background:none;border-radius:var(--baseRadius);border:1px solid var(--baseAlt1Color)}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:0;width:100%}.flatpickr-calendar.static{position:absolute;top:100%;margin-top:2px;margin-bottom:10px;width:100%}.flatpickr-calendar.static .flatpickr-days{width:100%}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 var(--baseAlt2Color),5px 0 0 var(--baseAlt2Color);box-shadow:-2px 0 0 var(--baseAlt2Color),5px 0 0 var(--baseAlt2Color)}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid var(--baseAlt2Color)}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:var(--baseColor)}.flatpickr-calendar.arrowTop:after{border-bottom-color:var(--baseColor)}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:var(--baseColor)}.flatpickr-calendar.arrowBottom:after{border-top-color:var(--baseColor)}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative}.flatpickr-months{display:flex;align-items:center;padding:5px 0}.flatpickr-months .flatpickr-month{display:flex;align-items:center;justify-content:center;background:transparent;color:var(--txtPrimaryColor);fill:var(--txtPrimaryColor);line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{display:flex;align-items:center;text-decoration:none;cursor:pointer;height:34px;padding:5px 12px;z-index:3;color:var(--txtPrimaryColor);fill:var(--txtPrimaryColor)}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:var(--txtHintColor)}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto;border-radius:var(--baseRadius)}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:#00000080}.numInputWrapper:hover{background:var(--baseAlt1Color)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{line-height:inherit;color:inherit;width:85%;padding:1px 0;line-height:1;display:flex;gap:10px;align-items:center;justify-content:center;text-align:center}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:var(--baseAlt1Color)}.flatpickr-current-month .numInputWrapper{display:inline-flex;align-items:center;justify-content:center;width:62px}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:var(--txtPrimaryColor)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:var(--txtPrimaryColor)}.flatpickr-current-month input.cur-year{background:transparent;box-sizing:border-box;color:inherit;cursor:text;margin:0;display:inline-block;font-size:inherit;font-family:inherit;line-height:inherit;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{color:var(--txtDisabledColor);background:transparent;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;line-height:inherit;outline:none;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:focus,.flatpickr-current-month .flatpickr-monthDropdown-months:active{outline:none}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:var(--baseAlt1Color)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:none;padding:0}.flatpickr-weekdays{background:transparent;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}span.flatpickr-weekday{display:block;flex:1;margin:0;cursor:default;line-height:1;background:transparent;color:var(--txtHintColor);text-align:center;font-weight:bolder;font-size:var(--smFontSize)}.dayContainer,.flatpickr-weeks{padding:1px 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:100%;box-sizing:border-box;display:inline-block;display:flex;flex-wrap:wrap;transform:translateZ(0);opacity:1}.dayContainer+.dayContainer{-webkit-box-shadow:-1px 0 0 var(--baseAlt2Color);box-shadow:-1px 0 0 var(--baseAlt2Color)}.flatpickr-day{background:none;border:1px solid transparent;border-radius:var(--baseRadius);box-sizing:border-box;color:var(--txtPrimaryColor);cursor:pointer;font-weight:400;width:calc(14.2857143% - 2px);flex-basis:calc(14.2857143% - 2px);height:39px;margin:1px;display:inline-flex;align-items:center;justify-content:center;position:relative;text-align:center;flex-direction:column}.flatpickr-day.weekend,.flatpickr-day:nth-child(7n+6),.flatpickr-day:nth-child(7n+7){color:var(--dangerColor)}.flatpickr-day.inRange,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.today.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day:hover,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.nextMonthDay:hover,.flatpickr-day:focus,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.nextMonthDay:focus{cursor:pointer;outline:0;background:var(--baseAlt2Color);border-color:var(--baseAlt2Color)}.flatpickr-day.today{border-color:var(--baseColor)}.flatpickr-day.today:hover,.flatpickr-day.today:focus{border-color:var(--primaryColor);background:var(--primaryColor);color:var(--baseColor)}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange,.flatpickr-day.selected.inRange,.flatpickr-day.startRange.inRange,.flatpickr-day.endRange.inRange,.flatpickr-day.selected:focus,.flatpickr-day.startRange:focus,.flatpickr-day.endRange:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange:hover,.flatpickr-day.endRange:hover,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.endRange.nextMonthDay{background:var(--primaryColor);-webkit-box-shadow:none;box-shadow:none;color:#fff;border-color:var(--primaryColor)}.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange,.flatpickr-day.endRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange,.flatpickr-day.endRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)){-webkit-box-shadow:-10px 0 0 var(--primaryColor);box-shadow:-10px 0 0 var(--primaryColor)}.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange,.flatpickr-day.endRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;box-shadow:-5px 0 0 var(--baseAlt2Color),5px 0 0 var(--baseAlt2Color)}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.prevMonthDay,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.notAllowed.nextMonthDay{color:var(--txtDisabledColor);background:transparent;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:var(--txtDisabledColor);background:var(--baseAlt2Color)}.flatpickr-day.week.selected{border-radius:0;box-shadow:-5px 0 0 var(--primaryColor),5px 0 0 var(--primaryColor)}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;-webkit-box-shadow:1px 0 0 var(--baseAlt2Color);box-shadow:1px 0 0 var(--baseAlt2Color)}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:var(--txtHintColor);background:transparent;cursor:default;border:none}.flatpickr-innerContainer{display:flex;box-sizing:border-box;overflow:hidden;padding:5px}.flatpickr-rContainer{display:inline-block;padding:0;width:100%;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:var(--txtPrimaryColor)}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:var(--txtPrimaryColor)}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:transparent;box-shadow:none;border:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:var(--txtPrimaryColor);font-size:14px;position:relative;box-sizing:border-box;background:var(--baseColor);-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-time-separator,.flatpickr-time .flatpickr-am-pm{height:inherit;float:left;line-height:inherit;color:var(--txtPrimaryColor);font-weight:700;width:2%;-webkit-user-select:none;user-select:none;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time input:hover,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time .flatpickr-am-pm:focus{background:var(--baseAlt1Color)}.flatpickr-input[readonly]{cursor:pointer}@keyframes fpFadeInDown{0%{opacity:0;transform:translate3d(0,10px,0)}to{opacity:1;transform:translateZ(0)}}.flatpickr-hide-prev-next-month-days .flatpickr-calendar .prevMonthDay{visibility:hidden}.flatpickr-hide-prev-next-month-days .flatpickr-calendar .nextMonthDay,.flatpickr-inline-container .flatpickr-input{display:none}.flatpickr-inline-container .flatpickr-calendar{margin:0;box-shadow:none;border:1px solid var(--baseAlt2Color)}.docs-sidebar{--itemsSpacing: 10px;--itemsHeight: 40px;position:relative;min-width:180px;max-width:300px;height:100%;flex-shrink:0;overflow-x:hidden;overflow-y:auto;overflow-y:overlay;background:var(--bodyColor);padding:var(--smSpacing) var(--xsSpacing);border-right:1px solid var(--baseAlt1Color)}.docs-sidebar .sidebar-content{display:block;width:100%}.docs-sidebar .sidebar-item{position:relative;outline:0;cursor:pointer;text-decoration:none;display:flex;width:100%;gap:10px;align-items:center;text-align:right;justify-content:start;padding:5px 15px;margin:0 0 var(--itemsSpacing) 0;font-size:var(--lgFontSize);min-height:var(--itemsHeight);border-radius:var(--baseRadius);-webkit-user-select:none;user-select:none;color:var(--txtHintColor);transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.docs-sidebar .sidebar-item:last-child{margin-bottom:0}.docs-sidebar .sidebar-item:focus-visible,.docs-sidebar .sidebar-item:hover,.docs-sidebar .sidebar-item:active,.docs-sidebar .sidebar-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.docs-sidebar .sidebar-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.docs-sidebar.compact .sidebar-item{--itemsSpacing: 7px}.docs-content{width:100%;display:block;padding:calc(var(--baseSpacing) - 3px) var(--baseSpacing);overflow:auto}.docs-content-wrapper{display:flex;width:100%;height:100%}.docs-panel{width:960px;height:100%}.docs-panel .overlay-panel-section.panel-header{padding:0;border:0;box-shadow:none}.docs-panel .overlay-panel-section.panel-content{padding:0!important}.docs-panel .overlay-panel-section.panel-footer{display:none}@media screen and (max-width: 1000px){.docs-panel .overlay-panel-section.panel-footer{display:flex}}.schema-field-header{position:relative;display:flex;width:100%;min-height:42px;gap:5px;padding:0 5px;align-items:center;justify-content:stretch;background:var(--baseAlt1Color);border-radius:var(--baseRadius);transition:border-radius var(--baseAnimationSpeed)}.schema-field-header .form-field{margin:0}.schema-field-header .form-field .form-field-addon.prefix{left:10px}.schema-field-header .form-field .form-field-addon.prefix~input,.schema-field-header .form-field .form-field-addon.prefix~select,.schema-field-header .form-field .form-field-addon.prefix~textarea,.schema-field-header .form-field .select .form-field-addon.prefix~.selected-container,.select .schema-field-header .form-field .form-field-addon.prefix~.selected-container,.schema-field-header .form-field .form-field-addon.prefix~.code-editor,.schema-field-header .form-field .form-field-addon.prefix~.tinymce-wrapper{padding-left:37px}.schema-field-header .options-trigger{padding:2px;margin:0 3px}.schema-field-header .options-trigger i{transition:transform var(--baseAnimationSpeed)}.schema-field-header .separator{flex-shrink:0;width:1px;height:42px;background:rgba(0,0,0,.05)}.schema-field-header .drag-handle-wrapper{position:absolute;top:0;left:auto;right:100%;height:100%;display:flex;align-items:center}.schema-field-header .drag-handle{padding:0 5px;transform:translate(5px);opacity:0;visibility:hidden}.schema-field-header .form-field-single-multiple-select{width:100px;flex-shrink:0}.schema-field-header .form-field-single-multiple-select .dropdown{min-width:0}.schema-field-header .field-labels{position:absolute;z-index:1;right:0;top:0;gap:2px;display:inline-flex;align-items:center;transition:opacity var(--baseAnimationSpeed)}.schema-field-header .field-labels .label{min-height:0;font-size:inherit;padding:0 2px;font-size:.7rem;line-height:.75rem;border-radius:var(--baseRadius)}.schema-field-header .field-labels~.inline-error-icon{margin-top:4px}.schema-field-header .field-labels~.inline-error-icon i{font-size:1rem}.schema-field-header .form-field:focus-within .field-labels{opacity:.2}.schema-field-options{background:#fff;padding:var(--xsSpacing);border-bottom-left-radius:var(--baseRadius);border-bottom-right-radius:var(--baseRadius);border-top:2px solid transparent;transition:border-color var(--baseAnimationSpeed)}.schema-field-options-footer{display:flex;flex-wrap:wrap;align-items:center;width:100%;min-width:0;gap:var(--baseSpacing)}.schema-field-options-footer .form-field{margin:0;width:auto}.schema-field{position:relative;margin:0 0 var(--xsSpacing);border-radius:var(--baseRadius);background:var(--baseAlt1Color);transition:border var(--baseAnimationSpeed),box-shadow var(--baseAnimationSpeed);border:2px solid var(--baseAlt1Color)}.schema-field:not(.deleted):hover .drag-handle{transform:translate(0);opacity:1;visibility:visible}.dragover .schema-field,.schema-field.dragover{opacity:.5}.schema-field.expanded{box-shadow:0 2px 5px 0 var(--shadowColor);border-color:var(--baseAlt2Color)}.schema-field.expanded .schema-field-header{border-bottom-left-radius:0;border-bottom-right-radius:0}.schema-field.expanded .schema-field-header .options-trigger i{transform:rotate(-60deg)}.schema-field.expanded .schema-field-options{border-top-color:var(--baseAlt2Color)}.schema-field.deleted .schema-field-header{background:var(--bodyColor)}.schema-field.deleted .markers,.schema-field.deleted .separator{opacity:.5}.schema-field.deleted input,.schema-field.deleted select,.schema-field.deleted textarea,.schema-field.deleted .select .selected-container,.select .schema-field.deleted .selected-container,.schema-field.deleted .code-editor,.schema-field.deleted .tinymce-wrapper{background:none;box-shadow:none}.file-picker-sidebar{flex-shrink:0;width:180px;text-align:right;max-height:100%;overflow:auto}.file-picker-sidebar .sidebar-item{outline:0;cursor:pointer;text-decoration:none;display:flex;width:100%;align-items:center;text-align:left;gap:10px;font-weight:600;padding:5px 10px;margin:0 0 10px;color:var(--txtHintColor);min-height:var(--btnHeight);border-radius:var(--baseRadius);word-break:break-word;transition:background var(--baseAnimationSpeed),color var(--baseAnimationSpeed)}.file-picker-sidebar .sidebar-item:last-child{margin-bottom:0}.file-picker-sidebar .sidebar-item:hover,.file-picker-sidebar .sidebar-item:focus-visible,.file-picker-sidebar .sidebar-item:active,.file-picker-sidebar .sidebar-item.active{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.file-picker-sidebar .sidebar-item:active{background:var(--baseAlt2Color);transition-duration:var(--activeAnimationSpeed)}.files-list{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--xsSpacing);flex-grow:1;min-height:0;max-height:100%;overflow:auto;scrollbar-gutter:stable}.files-list .list-item{cursor:pointer;outline:0;transition:box-shadow var(--baseAnimationSpeed)}.file-picker-size-select{width:170px;margin:0}.file-picker-size-select .selected-container{min-height:var(--btnHeight)}.file-picker-content{position:relative;display:flex;flex-direction:column;width:100%;flex-grow:1;min-width:0;min-height:0;height:100%}.file-picker-content .thumb{--thumbSize: 14.6%}.file-picker{display:flex;height:420px;max-height:100%;align-items:stretch;gap:var(--baseSpacing)}.overlay-panel.file-picker-popup{width:930px}.panel-wrapper.svelte-lxxzfu{animation:slideIn .2s}@keyframes svelte-1bvelc2-refresh{to{transform:rotate(180deg)}}.btn.refreshing.svelte-1bvelc2 i.svelte-1bvelc2{animation:svelte-1bvelc2-refresh .15s ease-out}.datetime.svelte-5pjd03{display:inline-block;vertical-align:top;white-space:nowrap;line-height:var(--smLineHeight)}.time.svelte-5pjd03{font-size:var(--smFontSize);color:var(--txtHintColor)}.scroller.svelte-3a0gfs{width:auto;min-height:0;overflow:auto}.scroller-wrapper.svelte-3a0gfs{position:relative;min-height:0}.scroller-wrapper .columns-dropdown{top:40px;z-index:101;max-height:340px}.chart-wrapper.svelte-vh4sl8.svelte-vh4sl8{position:relative;display:block;width:100%}.chart-wrapper.loading.svelte-vh4sl8 .chart-canvas.svelte-vh4sl8{pointer-events:none;opacity:.5}.chart-loader.svelte-vh4sl8.svelte-vh4sl8{position:absolute;z-index:999;top:50%;left:50%;transform:translate(-50%,-50%)}.prism-light code[class*=language-],.prism-light pre[class*=language-]{color:#111b27;background:0 0;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}.prism-light code[class*=language-] ::-moz-selection,.prism-light code[class*=language-]::-moz-selection,.prism-light pre[class*=language-] ::-moz-selection,.prism-light pre[class*=language-]::-moz-selection{background:#8da1b9}.prism-light code[class*=language-] ::selection,.prism-light code[class*=language-]::selection,.prism-light pre[class*=language-] ::selection,.prism-light pre[class*=language-]::selection{background:#8da1b9}.prism-light pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}.prism-light :not(pre)>code[class*=language-],.prism-light pre[class*=language-]{background:#e3eaf2}.prism-light :not(pre)>code[class*=language-]{padding:.1em .3em;border-radius:.3em;white-space:normal}.prism-light .token.cdata,.prism-light .token.comment,.prism-light .token.doctype,.prism-light .token.prolog{color:#3c526d}.prism-light .token.punctuation{color:#111b27}.prism-light .token.delimiter.important,.prism-light .token.selector .parent,.prism-light .token.tag,.prism-light .token.tag .token.punctuation{color:#006d6d}.prism-light .token.attr-name,.prism-light .token.boolean,.prism-light .token.boolean.important,.prism-light .token.constant,.prism-light .token.number,.prism-light .token.selector .token.attribute{color:#755f00}.prism-light .token.class-name,.prism-light .token.key,.prism-light .token.parameter,.prism-light .token.property,.prism-light .token.property-access,.prism-light .token.variable{color:#005a8e}.prism-light .token.attr-value,.prism-light .token.color,.prism-light .token.inserted,.prism-light .token.selector .token.value,.prism-light .token.string,.prism-light .token.string .token.url-link{color:#116b00}.prism-light .token.builtin,.prism-light .token.keyword-array,.prism-light .token.package,.prism-light .token.regex{color:#af00af}.prism-light .token.function,.prism-light .token.selector .token.class,.prism-light .token.selector .token.id{color:#7c00aa}.prism-light .token.atrule .token.rule,.prism-light .token.combinator,.prism-light .token.keyword,.prism-light .token.operator,.prism-light .token.pseudo-class,.prism-light .token.pseudo-element,.prism-light .token.selector,.prism-light .token.unit{color:#a04900}.prism-light .token.deleted,.prism-light .token.important{color:#c22f2e}.prism-light .token.keyword-this,.prism-light .token.this{color:#005a8e}.prism-light .token.bold,.prism-light .token.important,.prism-light .token.keyword-this,.prism-light .token.this{font-weight:700}.prism-light .token.delimiter.important{font-weight:inherit}.prism-light .token.italic{font-style:italic}.prism-light .token.entity{cursor:help}.prism-light .language-markdown .token.title,.prism-light .language-markdown .token.title .token.punctuation{color:#005a8e;font-weight:700}.prism-light .language-markdown .token.blockquote.punctuation{color:#af00af}.prism-light .language-markdown .token.code{color:#006d6d}.prism-light .language-markdown .token.hr.punctuation{color:#005a8e}.prism-light .language-markdown .token.url>.token.content{color:#116b00}.prism-light .language-markdown .token.url-link{color:#755f00}.prism-light .language-markdown .token.list.punctuation{color:#af00af}.prism-light .language-markdown .token.table-header,.prism-light .language-json .token.operator{color:#111b27}.prism-light .language-scss .token.variable{color:#006d6d}.prism-light .token.token.cr:before,.prism-light .token.token.lf:before,.prism-light .token.token.space:before,.prism-light .token.token.tab:not(:empty):before{color:#3c526d}.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>a,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>button{color:#e3eaf2;background:#005a8e}.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>a:focus,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>a:hover,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>button:focus,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>button:hover{color:#e3eaf2;background:rgba(0,90,142,.8549019608);text-decoration:none}.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>span,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>span:focus,.prism-light div.code-toolbar>.toolbar.toolbar>.toolbar-item>span:hover{color:#e3eaf2;background:#3c526d}.prism-light .line-highlight.line-highlight{background:rgba(141,161,185,.1843137255);background:linear-gradient(to right,rgba(141,161,185,.1843137255) 70%,rgba(141,161,185,.1450980392))}.prism-light .line-highlight.line-highlight:before,.prism-light .line-highlight.line-highlight[data-end]:after{background-color:#3c526d;color:#e3eaf2;box-shadow:0 1px #8da1b9}.prism-light pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows>span:hover:before{background-color:#3c526d1f}.prism-light .line-numbers.line-numbers .line-numbers-rows{border-right:1px solid rgba(141,161,185,.4784313725);background:rgba(208,218,231,.4784313725)}.prism-light .line-numbers .line-numbers-rows>span:before{color:#3c526dda}.prism-light .rainbow-braces .token.token.punctuation.brace-level-1,.prism-light .rainbow-braces .token.token.punctuation.brace-level-5,.prism-light .rainbow-braces .token.token.punctuation.brace-level-9{color:#755f00}.prism-light .rainbow-braces .token.token.punctuation.brace-level-10,.prism-light .rainbow-braces .token.token.punctuation.brace-level-2,.prism-light .rainbow-braces .token.token.punctuation.brace-level-6{color:#af00af}.prism-light .rainbow-braces .token.token.punctuation.brace-level-11,.prism-light .rainbow-braces .token.token.punctuation.brace-level-3,.prism-light .rainbow-braces .token.token.punctuation.brace-level-7{color:#005a8e}.prism-light .rainbow-braces .token.token.punctuation.brace-level-12,.prism-light .rainbow-braces .token.token.punctuation.brace-level-4,.prism-light .rainbow-braces .token.token.punctuation.brace-level-8{color:#7c00aa}.prism-light pre.diff-highlight>code .token.token.deleted:not(.prefix),.prism-light pre>code.diff-highlight .token.token.deleted:not(.prefix){background-color:#c22f2e1f}.prism-light pre.diff-highlight>code .token.token.inserted:not(.prefix),.prism-light pre>code.diff-highlight .token.token.inserted:not(.prefix){background-color:#116b001f}.prism-light .command-line .command-line-prompt{border-right:1px solid rgba(141,161,185,.4784313725)}.prism-light .command-line .command-line-prompt>span:before{color:#3c526dda}code.svelte-10s5tkd.svelte-10s5tkd{display:block;width:100%;padding:10px 15px;white-space:pre-wrap;word-break:break-word}.code-wrapper.svelte-10s5tkd.svelte-10s5tkd{display:block;width:100%;max-height:100%;overflow:auto;overflow:overlay}.prism-light.svelte-10s5tkd code.svelte-10s5tkd{color:var(--txtPrimaryColor);background:var(--baseAlt1Color)}.dragline.svelte-1g2t3dj{position:relative;z-index:101;left:0;top:0;height:100%;width:5px;padding:0;margin:0 -3px 0 -1px;background:none;cursor:ew-resize;box-sizing:content-box;transition:box-shadow var(--activeAnimationSpeed);box-shadow:inset 1px 0 0 0 var(--baseAlt2Color)}.dragline.svelte-1g2t3dj:hover,.dragline.dragging.svelte-1g2t3dj{box-shadow:inset 3px 0 0 0 var(--baseAlt2Color)}.indexes-list.svelte-167lbwu{display:flex;flex-wrap:wrap;width:100%;gap:10px}.label.svelte-167lbwu{overflow:hidden;min-width:50px}.field-types-btn.active.svelte-1gz9b6p{border-bottom-left-radius:0;border-bottom-right-radius:0}.field-types-dropdown{display:flex;flex-wrap:wrap;width:100%;max-width:none;padding:10px;margin-top:2px;border:0;box-shadow:0 0 0 2px var(--primaryColor);border-top-left-radius:0;border-top-right-radius:0}.field-types-dropdown .dropdown-item.svelte-1gz9b6p{width:25%}.form-field-file-max-select{width:100px;flex-shrink:0}.draggable.svelte-28orm4{-webkit-user-select:none;user-select:none;outline:0;min-width:0}.lock-toggle.svelte-1akuazq.svelte-1akuazq{position:absolute;right:0;top:0;min-width:135px;padding:10px;border-top-left-radius:0;border-bottom-right-radius:0;background:rgba(53,71,104,.09)}.rule-field .code-editor .cm-placeholder{font-family:var(--baseFontFamily)}.input-wrapper.svelte-1akuazq.svelte-1akuazq{position:relative}.unlock-overlay.svelte-1akuazq.svelte-1akuazq{--hoverAnimationSpeed:.2s;position:absolute;z-index:1;left:0;top:0;width:100%;height:100%;display:flex;padding:20px;gap:10px;align-items:center;justify-content:end;text-align:center;border-radius:var(--baseRadius);background:rgba(255,255,255,.2);outline:0;cursor:pointer;text-decoration:none;color:var(--successColor);border:2px solid var(--baseAlt1Color);transition:border-color var(--baseAnimationSpeed)}.unlock-overlay.svelte-1akuazq i.svelte-1akuazq{font-size:inherit}.unlock-overlay.svelte-1akuazq .icon.svelte-1akuazq{color:var(--successColor);font-size:1.15rem;line-height:1;font-weight:400;transition:transform var(--hoverAnimationSpeed)}.unlock-overlay.svelte-1akuazq .txt.svelte-1akuazq{opacity:0;font-size:var(--xsFontSize);font-weight:600;line-height:var(--smLineHeight);transform:translate(5px);transition:transform var(--hoverAnimationSpeed),opacity var(--hoverAnimationSpeed)}.unlock-overlay.svelte-1akuazq.svelte-1akuazq:hover,.unlock-overlay.svelte-1akuazq.svelte-1akuazq:focus-visible,.unlock-overlay.svelte-1akuazq.svelte-1akuazq:active{border-color:var(--baseAlt3Color)}.unlock-overlay.svelte-1akuazq:hover .icon.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:focus-visible .icon.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:active .icon.svelte-1akuazq{transform:scale(1.1)}.unlock-overlay.svelte-1akuazq:hover .txt.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:focus-visible .txt.svelte-1akuazq,.unlock-overlay.svelte-1akuazq:active .txt.svelte-1akuazq{opacity:1;transform:scale(1)}.unlock-overlay.svelte-1akuazq.svelte-1akuazq:active{transition-duration:var(--activeAnimationSpeed);border-color:var(--baseAlt3Color)}.changes-list.svelte-xqpcsf.svelte-xqpcsf{word-break:break-word;line-height:var(--smLineHeight)}.changes-list.svelte-xqpcsf li.svelte-xqpcsf{margin-top:10px;margin-bottom:10px}.upsert-panel-title.svelte-12y0yzb{display:inline-flex;align-items:center;min-height:var(--smBtnHeight)}.tabs-content.svelte-12y0yzb:focus-within{z-index:9}.pin-collection.svelte-1u3ag8h.svelte-1u3ag8h{margin:0 -5px 0 -15px;opacity:0;transition:opacity var(--baseAnimationSpeed)}.pin-collection.svelte-1u3ag8h i.svelte-1u3ag8h{font-size:inherit}a.svelte-1u3ag8h:hover .pin-collection.svelte-1u3ag8h{opacity:.4}a.svelte-1u3ag8h:hover .pin-collection.svelte-1u3ag8h:hover{opacity:1}.secret.svelte-1md8247{font-family:monospace;font-weight:400;-webkit-user-select:all;user-select:all}.email-visibility-addon.svelte-1751a4d~input.svelte-1751a4d{padding-right:100px}textarea.svelte-1x1pbts{resize:none;padding-top:4px!important;padding-bottom:5px!important;min-height:var(--inputHeight);height:var(--inputHeight)}.clear-btn.svelte-11df51y{margin-top:20px}.json-state.svelte-p6ecb8{position:absolute;right:10px}.record-info.svelte-fhw3qk.svelte-fhw3qk{display:inline-flex;vertical-align:top;align-items:center;max-width:100%;min-width:0;gap:5px;line-height:normal}.record-info.svelte-fhw3qk>.svelte-fhw3qk{line-height:inherit}.record-info.svelte-fhw3qk .thumb{box-shadow:none}.picker-list.svelte-1u8jhky{max-height:380px}.selected-list.svelte-1u8jhky{display:flex;flex-wrap:wrap;align-items:center;gap:10px;max-height:220px;overflow:auto}.relations-list.svelte-1ynw0pc{max-height:300px;overflow:auto;overflow:overlay}.panel-title.svelte-qc5ngu{line-height:var(--smBtnHeight)}.fallback-block.svelte-jdf51v{max-height:100px;overflow:auto}.col-field.svelte-1nt58f7{max-width:1px}.export-preview.svelte-jm5c4z.svelte-jm5c4z{position:relative;height:500px}.export-preview.svelte-jm5c4z .copy-schema.svelte-jm5c4z{position:absolute;right:15px;top:15px}.collections-diff-table.svelte-lmkr38.svelte-lmkr38{color:var(--txtHintColor);border:2px solid var(--primaryColor)}.collections-diff-table.svelte-lmkr38 tr.svelte-lmkr38{background:none}.collections-diff-table.svelte-lmkr38 th.svelte-lmkr38,.collections-diff-table.svelte-lmkr38 td.svelte-lmkr38{height:auto;padding:2px 15px;border-bottom:1px solid rgba(0,0,0,.07)}.collections-diff-table.svelte-lmkr38 th.svelte-lmkr38{height:35px;padding:4px 15px;color:var(--txtPrimaryColor)}.collections-diff-table.svelte-lmkr38 thead tr.svelte-lmkr38{background:var(--primaryColor)}.collections-diff-table.svelte-lmkr38 thead tr th.svelte-lmkr38{color:var(--baseColor);background:none}.collections-diff-table.svelte-lmkr38 .label.svelte-lmkr38{font-weight:400}.collections-diff-table.svelte-lmkr38 .changed-none-col.svelte-lmkr38{color:var(--txtDisabledColor);background:var(--baseAlt1Color)}.collections-diff-table.svelte-lmkr38 .changed-old-col.svelte-lmkr38{color:var(--txtPrimaryColor);background:var(--dangerAltColor)}.collections-diff-table.svelte-lmkr38 .changed-new-col.svelte-lmkr38{color:var(--txtPrimaryColor);background:var(--successAltColor)}.collections-diff-table.svelte-lmkr38 .field-key-col.svelte-lmkr38{padding-left:30px}.list-label.svelte-1jx20fl{min-width:65px}.popup-title.svelte-1fcgldh{max-width:80%}.list-content.svelte-1ulbkf5.svelte-1ulbkf5{overflow:auto;max-height:342px}.list-content.svelte-1ulbkf5 .list-item.svelte-1ulbkf5{min-height:49px}.backup-name.svelte-1ulbkf5.svelte-1ulbkf5{max-width:300px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} diff --git a/ui/dist/index.html b/ui/dist/index.html index 358ffa42..af08957d 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -45,8 +45,8 @@ window.Prism = window.Prism || {}; window.Prism.manual = true; - - + +
    diff --git a/ui/package-lock.json b/ui/package-lock.json index 133ad065..9c8fee73 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -18,10 +18,10 @@ "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "@sveltejs/vite-plugin-svelte": "^2.4.1", - "chart.js": "^3.7.1", + "chart.js": "^4.0.0", "chartjs-adapter-luxon": "^1.2.0", "luxon": "^2.3.2", - "pocketbase": "^0.18.0", + "pocketbase": "0.20.0-rc2", "prismjs": "^1.28.0", "sass": "^1.45.0", "svelte": "^4.0.0", @@ -44,9 +44,9 @@ } }, "node_modules/@codemirror/autocomplete": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.10.2.tgz", - "integrity": "sha512-3dCL7b0j2GdtZzWN5j7HDpRAJ26ip07R4NGYz7QYthIYMiX8I4E4TNrYcdTayPJGeVQtd/xe7lWU4XL7THFb/w==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.11.0.tgz", + "integrity": "sha512-LCPH3W+hl5vcO7OzEQgX6NpKuKVyiKFLGAy7FXROF6nUpsWUdQEgUb3fe/g7B0E1KZCRFfgzdKASt6Wly2UOBg==", "dev": true, "dependencies": { "@codemirror/language": "^6.0.0", @@ -193,9 +193,9 @@ "dev": true }, "node_modules/@codemirror/view": { - "version": "6.21.4", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.21.4.tgz", - "integrity": "sha512-WKVZ7nvN0lwWPfAf05WxWqTpwjC8YN3q5goj3CsSig7//DD81LULgOx3nBegqpqP0iygBqRmW8z0KSc2QTAdAg==", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.22.0.tgz", + "integrity": "sha512-6zLj4YIoIpfTGKrDMTbeZRpa8ih4EymMCKmddEDcJWrCdp/N1D46B38YEz4creTb4T177AVS9EyXkLeC/HL2jA==", "dev": true, "dependencies": { "@codemirror/state": "^6.1.4", @@ -603,16 +603,22 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@kurkle/color": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz", + "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==", + "dev": true + }, "node_modules/@lezer/common": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz", - "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.1.tgz", + "integrity": "sha512-aAPB9YbvZHqAW+bIwiuuTDGB4DG0sYNRObGLxud8cW7osw1ZQxfDuTZ8KQiqfZ0QJGcR34CvpTMDXEyo/+Htgg==", "dev": true }, "node_modules/@lezer/css": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.3.tgz", - "integrity": "sha512-SjSM4pkQnQdJDVc80LYzEaMiNy9txsFbI7HsMgeVF28NdLaAdHNtQ+kB/QqDUzRBV/75NTXjJ/R5IdC8QQGxMg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.4.tgz", + "integrity": "sha512-CuUwjidrU7FOBokqASRJc72SmJ9g1PsHXDOWMoKg4md6+2u/Zxzwx5YsYrAFxRDsLrjLlsIyEF1rZHK3gFEJbw==", "dev": true, "dependencies": { "@lezer/highlight": "^1.0.0", @@ -620,18 +626,18 @@ } }, "node_modules/@lezer/highlight": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.6.tgz", - "integrity": "sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz", + "integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==", "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } }, "node_modules/@lezer/html": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.6.tgz", - "integrity": "sha512-Kk9HJARZTc0bAnMQUqbtuhFVsB4AnteR2BFUWfZV7L/x1H0aAKz6YabrfJ2gk/BEgjh9L3hg5O4y2IDZRBdzuQ==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.7.tgz", + "integrity": "sha512-Wo+rZ5UjLP0VqUTyXjzgmTYRW5bvTJUFn4Uw0K3HCQjX2/+f+zRo9GLN5BCAojwHQISPvaQk8BWSv2SSKx/UcQ==", "dev": true, "dependencies": { "@lezer/common": "^1.0.0", @@ -640,9 +646,9 @@ } }, "node_modules/@lezer/javascript": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.8.tgz", - "integrity": "sha512-QRmw/5xrcyRLyWr3JT3KCzn2XZr5NYNqQMGsqnYy+FghbQn9DZPuj6JDkE6uSXvfMLpdapu8KBIaeoJFaR4QVw==", + "version": "1.4.9", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.9.tgz", + "integrity": "sha512-7Uv8mBBE6l44spgWEZvEMdDqGV+FIuY7kJ1o5TFm+jxIuxydO3PcKJYiINij09igd1D/9P7l2KDqpkN8c3bM6A==", "dev": true, "dependencies": { "@lezer/highlight": "^1.1.3", @@ -660,18 +666,18 @@ } }, "node_modules/@lezer/lr": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.13.tgz", - "integrity": "sha512-RLAbau/4uSzKgIKj96mI5WUtG1qtiR0Frn0Ei9zhPj8YOkHM+1Bb8SgdVvmR/aWJCFIzjo2KFnDiRZ75Xf5NdQ==", + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.14.tgz", + "integrity": "sha512-z5mY4LStlA3yL7aHT/rqgG614cfcvklS+8oFRFBYrs4YaWLJyKKM4+nN6KopToX0o9Hj6zmH6M5kinOYuy06ug==", "dev": true, "dependencies": { "@lezer/common": "^1.0.0" } }, "node_modules/@sveltejs/vite-plugin-svelte": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.6.tgz", - "integrity": "sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.5.3.tgz", + "integrity": "sha512-erhNtXxE5/6xGZz/M9eXsmI7Pxa6MS7jyTy06zN3Ck++ldrppOnOlJwHHTsMC7DHDQdgUp4NAc4cDNQ9eGdB/w==", "dev": true, "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^1.0.4", @@ -686,7 +692,7 @@ "node": "^14.18.0 || >= 16" }, "peerDependencies": { - "svelte": "^3.54.0 || ^4.0.0", + "svelte": "^3.54.0 || ^4.0.0 || ^5.0.0-next.0", "vite": "^4.0.0" } }, @@ -708,9 +714,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", - "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/acorn": { @@ -778,10 +784,16 @@ } }, "node_modules/chart.js": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.9.1.tgz", - "integrity": "sha512-Ro2JbLmvg83gXF5F4sniaQ+lTbSv18E+TIf2cOeiH1Iqd2PGFOtem+DUufMZsCJwFE7ywPOpfXFBwRTGq7dh6w==", - "dev": true + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.0.tgz", + "integrity": "sha512-vQEj6d+z0dcsKLlQvbKIMYFHd3t8W/7L2vfJIbYcfyPcRx92CsHqECpueN8qVGNlKyDcr5wBrYAYKnfu/9Q1hQ==", + "dev": true, + "dependencies": { + "@kurkle/color": "^0.3.0" + }, + "engines": { + "pnpm": ">=7" + } }, "node_modules/chartjs-adapter-luxon": { "version": "1.3.1", @@ -1083,9 +1095,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, "funding": [ { @@ -1139,9 +1151,9 @@ } }, "node_modules/pocketbase": { - "version": "0.18.3", - "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.18.3.tgz", - "integrity": "sha512-zE4+oue0p0Ntwoil17b2geBpPwV6B6bYdsbXmNWmod6XOqBK2+jLDT5/SlAP3une4bo3U5ZAW2GvigEBAV3bBg==", + "version": "0.20.0-rc2", + "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.20.0-rc2.tgz", + "integrity": "sha512-Kh/xZlz1W4VikFwvb80hF0SKyZyeOcoQBRGfd6eUHi4QcELXUbPZvX3K3TOFsJCER6sEesOh8eq4W10hwaKHAg==", "dev": true }, "node_modules/postcss": { @@ -1251,9 +1263,9 @@ "dev": true }, "node_modules/svelte": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.2.tgz", - "integrity": "sha512-My2tytF2e2NnHSpn2M7/3VdXT4JdTglYVUuSuK/mXL2XtulPYbeBfl8Dm1QiaKRn0zoULRnL+EtfZHHP0k4H3A==", + "version": "4.2.7", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.7.tgz", + "integrity": "sha512-UExR1KS7raTdycsUrKLtStayu4hpdV3VZQgM0akX8XbXgLBlosdE/Sf3crOgyh9xIjqSYB3UEBuUlIQKRQX2hg==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", @@ -1410,9 +1422,9 @@ } }, "@codemirror/autocomplete": { - "version": "6.10.2", - "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.10.2.tgz", - "integrity": "sha512-3dCL7b0j2GdtZzWN5j7HDpRAJ26ip07R4NGYz7QYthIYMiX8I4E4TNrYcdTayPJGeVQtd/xe7lWU4XL7THFb/w==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.11.0.tgz", + "integrity": "sha512-LCPH3W+hl5vcO7OzEQgX6NpKuKVyiKFLGAy7FXROF6nUpsWUdQEgUb3fe/g7B0E1KZCRFfgzdKASt6Wly2UOBg==", "dev": true, "requires": { "@codemirror/language": "^6.0.0", @@ -1553,9 +1565,9 @@ "dev": true }, "@codemirror/view": { - "version": "6.21.4", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.21.4.tgz", - "integrity": "sha512-WKVZ7nvN0lwWPfAf05WxWqTpwjC8YN3q5goj3CsSig7//DD81LULgOx3nBegqpqP0iygBqRmW8z0KSc2QTAdAg==", + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.22.0.tgz", + "integrity": "sha512-6zLj4YIoIpfTGKrDMTbeZRpa8ih4EymMCKmddEDcJWrCdp/N1D46B38YEz4creTb4T177AVS9EyXkLeC/HL2jA==", "dev": true, "requires": { "@codemirror/state": "^6.1.4", @@ -1756,16 +1768,22 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "@kurkle/color": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz", + "integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw==", + "dev": true + }, "@lezer/common": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz", - "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.1.tgz", + "integrity": "sha512-aAPB9YbvZHqAW+bIwiuuTDGB4DG0sYNRObGLxud8cW7osw1ZQxfDuTZ8KQiqfZ0QJGcR34CvpTMDXEyo/+Htgg==", "dev": true }, "@lezer/css": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.3.tgz", - "integrity": "sha512-SjSM4pkQnQdJDVc80LYzEaMiNy9txsFbI7HsMgeVF28NdLaAdHNtQ+kB/QqDUzRBV/75NTXjJ/R5IdC8QQGxMg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@lezer/css/-/css-1.1.4.tgz", + "integrity": "sha512-CuUwjidrU7FOBokqASRJc72SmJ9g1PsHXDOWMoKg4md6+2u/Zxzwx5YsYrAFxRDsLrjLlsIyEF1rZHK3gFEJbw==", "dev": true, "requires": { "@lezer/highlight": "^1.0.0", @@ -1773,18 +1791,18 @@ } }, "@lezer/highlight": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.6.tgz", - "integrity": "sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz", + "integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==", "dev": true, "requires": { "@lezer/common": "^1.0.0" } }, "@lezer/html": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.6.tgz", - "integrity": "sha512-Kk9HJARZTc0bAnMQUqbtuhFVsB4AnteR2BFUWfZV7L/x1H0aAKz6YabrfJ2gk/BEgjh9L3hg5O4y2IDZRBdzuQ==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@lezer/html/-/html-1.3.7.tgz", + "integrity": "sha512-Wo+rZ5UjLP0VqUTyXjzgmTYRW5bvTJUFn4Uw0K3HCQjX2/+f+zRo9GLN5BCAojwHQISPvaQk8BWSv2SSKx/UcQ==", "dev": true, "requires": { "@lezer/common": "^1.0.0", @@ -1793,9 +1811,9 @@ } }, "@lezer/javascript": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.8.tgz", - "integrity": "sha512-QRmw/5xrcyRLyWr3JT3KCzn2XZr5NYNqQMGsqnYy+FghbQn9DZPuj6JDkE6uSXvfMLpdapu8KBIaeoJFaR4QVw==", + "version": "1.4.9", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.9.tgz", + "integrity": "sha512-7Uv8mBBE6l44spgWEZvEMdDqGV+FIuY7kJ1o5TFm+jxIuxydO3PcKJYiINij09igd1D/9P7l2KDqpkN8c3bM6A==", "dev": true, "requires": { "@lezer/highlight": "^1.1.3", @@ -1813,18 +1831,18 @@ } }, "@lezer/lr": { - "version": "1.3.13", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.13.tgz", - "integrity": "sha512-RLAbau/4uSzKgIKj96mI5WUtG1qtiR0Frn0Ei9zhPj8YOkHM+1Bb8SgdVvmR/aWJCFIzjo2KFnDiRZ75Xf5NdQ==", + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.14.tgz", + "integrity": "sha512-z5mY4LStlA3yL7aHT/rqgG614cfcvklS+8oFRFBYrs4YaWLJyKKM4+nN6KopToX0o9Hj6zmH6M5kinOYuy06ug==", "dev": true, "requires": { "@lezer/common": "^1.0.0" } }, "@sveltejs/vite-plugin-svelte": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.4.6.tgz", - "integrity": "sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==", + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-2.5.3.tgz", + "integrity": "sha512-erhNtXxE5/6xGZz/M9eXsmI7Pxa6MS7jyTy06zN3Ck++ldrppOnOlJwHHTsMC7DHDQdgUp4NAc4cDNQ9eGdB/w==", "dev": true, "requires": { "@sveltejs/vite-plugin-svelte-inspector": "^1.0.4", @@ -1846,9 +1864,9 @@ } }, "@types/estree": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", - "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "acorn": { @@ -1901,10 +1919,13 @@ } }, "chart.js": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-3.9.1.tgz", - "integrity": "sha512-Ro2JbLmvg83gXF5F4sniaQ+lTbSv18E+TIf2cOeiH1Iqd2PGFOtem+DUufMZsCJwFE7ywPOpfXFBwRTGq7dh6w==", - "dev": true + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-4.4.0.tgz", + "integrity": "sha512-vQEj6d+z0dcsKLlQvbKIMYFHd3t8W/7L2vfJIbYcfyPcRx92CsHqECpueN8qVGNlKyDcr5wBrYAYKnfu/9Q1hQ==", + "dev": true, + "requires": { + "@kurkle/color": "^0.3.0" + } }, "chartjs-adapter-luxon": { "version": "1.3.1", @@ -2134,9 +2155,9 @@ "dev": true }, "nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true }, "normalize-path": { @@ -2169,9 +2190,9 @@ "dev": true }, "pocketbase": { - "version": "0.18.3", - "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.18.3.tgz", - "integrity": "sha512-zE4+oue0p0Ntwoil17b2geBpPwV6B6bYdsbXmNWmod6XOqBK2+jLDT5/SlAP3une4bo3U5ZAW2GvigEBAV3bBg==", + "version": "0.20.0-rc2", + "resolved": "https://registry.npmjs.org/pocketbase/-/pocketbase-0.20.0-rc2.tgz", + "integrity": "sha512-Kh/xZlz1W4VikFwvb80hF0SKyZyeOcoQBRGfd6eUHi4QcELXUbPZvX3K3TOFsJCER6sEesOh8eq4W10hwaKHAg==", "dev": true }, "postcss": { @@ -2239,9 +2260,9 @@ "dev": true }, "svelte": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.2.tgz", - "integrity": "sha512-My2tytF2e2NnHSpn2M7/3VdXT4JdTglYVUuSuK/mXL2XtulPYbeBfl8Dm1QiaKRn0zoULRnL+EtfZHHP0k4H3A==", + "version": "4.2.7", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.7.tgz", + "integrity": "sha512-UExR1KS7raTdycsUrKLtStayu4hpdV3VZQgM0akX8XbXgLBlosdE/Sf3crOgyh9xIjqSYB3UEBuUlIQKRQX2hg==", "dev": true, "requires": { "@ampproject/remapping": "^2.2.1", diff --git a/ui/package.json b/ui/package.json index e68c9cf8..fa72b786 100644 --- a/ui/package.json +++ b/ui/package.json @@ -25,10 +25,10 @@ "@codemirror/state": "^6.0.0", "@codemirror/view": "^6.0.0", "@sveltejs/vite-plugin-svelte": "^2.4.1", - "chart.js": "^3.7.1", + "chart.js": "^4.0.0", "chartjs-adapter-luxon": "^1.2.0", "luxon": "^2.3.2", - "pocketbase": "^0.18.0", + "pocketbase": "0.20.0-rc2", "prismjs": "^1.28.0", "sass": "^1.45.0", "svelte": "^4.0.0", diff --git a/ui/src/components/logs/LogDate.svelte b/ui/src/components/logs/LogDate.svelte new file mode 100644 index 00000000..07403cc2 --- /dev/null +++ b/ui/src/components/logs/LogDate.svelte @@ -0,0 +1,18 @@ + + + + {date.replace("Z", " UTC")} + diff --git a/ui/src/components/logs/LogLevel.svelte b/ui/src/components/logs/LogLevel.svelte new file mode 100644 index 00000000..7f127fea --- /dev/null +++ b/ui/src/components/logs/LogLevel.svelte @@ -0,0 +1,40 @@ + + +
    + + {label || "N/A"} ({level}) + +
    + + diff --git a/ui/src/components/logs/LogViewPanel.svelte b/ui/src/components/logs/LogViewPanel.svelte index 3640d5ef..d37ca28d 100644 --- a/ui/src/components/logs/LogViewPanel.svelte +++ b/ui/src/components/logs/LogViewPanel.svelte @@ -1,14 +1,22 @@ + + +

    Request log

    @@ -26,69 +80,53 @@ - - - - - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + {#if log.data?.type != "request"} + + + + + {/if} + {#each extractKeys(log.data) as key} + {@const value = log.data[key]} + + + + + {/each}
    ID{item.id}
    Statusid - = 400}> - {item.status} - +
    + +
    {log.id}
    +
    Method{item.method?.toUpperCase()}level
    Auth{item.auth}
    URL{item.url}
    Referer - {#if item.referer} - - {item.referer} - - {:else} - N/A - {/if} -
    Remote IP{item.remoteIp}
    User IP{item.userIp}
    UserAgent{item.userAgent}
    Meta - {#if !CommonHelper.isEmpty(item.meta)} -
    - -
    - {:else} - N/A - {/if} -
    Createdcreated
    message + {#if log.message} + {log.message} + {:else} + N/A + {/if} +
    + data.{key} + + {#if value !== null && typeof value == "object"} + + {:else if CommonHelper.isEmpty(value)} + N/A + {:else} + + {value}{key == "execTime" ? "ms" : ""} + + {/if} +
    @@ -96,5 +134,10 @@ + +
    diff --git a/ui/src/components/logs/LogsChart.svelte b/ui/src/components/logs/LogsChart.svelte index a5054790..1bb44dc7 100644 --- a/ui/src/components/logs/LogsChart.svelte +++ b/ui/src/components/logs/LogsChart.svelte @@ -2,11 +2,12 @@ import { onMount } from "svelte"; import { scale } from "svelte/transition"; import ApiClient from "@/utils/ApiClient"; + import CommonHelper from "@/utils/CommonHelper"; import { Chart, - LineElement, - PointElement, - LineController, + BarController, + BarElement, + CategoryScale, LinearScale, TimeScale, Filler, @@ -20,7 +21,7 @@ let chartCanvas; let chartInst; let chartData = []; - let totalRequests = 0; + let totalLogs = 0; let isLoading = false; $: if (typeof filter !== "undefined" || typeof presets !== "undefined") { @@ -36,24 +37,19 @@ isLoading = true; return ApiClient.logs - .getRequestsStats({ - filter: [presets, filter].filter(Boolean).join("&&"), + .getStats({ + filter: [presets, CommonHelper.normalizeLogsFilter(filter)].filter(Boolean).join("&&"), }) .then((result) => { resetData(); + for (let item of result) { chartData.push({ x: new Date(item.date), y: item.total, }); - totalRequests += item.total; + totalLogs += item.total; } - - // add current time marker to the chart - chartData.push({ - x: new Date(), - y: undefined, - }); }) .catch((err) => { if (!err?.isAbort) { @@ -68,31 +64,31 @@ } function resetData() { - totalRequests = 0; chartData = []; + totalLogs = 0; } onMount(() => { - Chart.register(LineElement, PointElement, LineController, LinearScale, TimeScale, Filler, Tooltip); + Chart.register(BarController, BarElement, CategoryScale, LinearScale, TimeScale, Filler, Tooltip); chartInst = new Chart(chartCanvas, { - type: "line", + type: "bar", data: { datasets: [ { label: "Total requests", data: chartData, - borderColor: "#ef4565", - pointBackgroundColor: "#ef4565", - backgroundColor: "rgb(239,69,101,0.05)", - borderWidth: 2, - pointRadius: 1, - pointBorderWidth: 0, - fill: true, + backgroundColor: "#e34562", + maxBarThickness: 40, + borderRadius: 2, + minBarLength: 7, + hoverBackgroundColor: "#e34562", }, ], }, options: { + resizeDelay: 250, + maintainAspectRatio: false, animation: false, interaction: { intersect: false, @@ -103,25 +99,28 @@ beginAtZero: true, grid: { color: "#edf0f3", - borderColor: "#dee3e8", + }, + border: { + color: "#e4e9ec", }, ticks: { precision: 0, - maxTicksLimit: 6, + maxTicksLimit: 4, autoSkip: true, color: "#666f75", }, }, x: { + // offset: false, type: "time", time: { unit: "hour", tooltipFormat: "DD h a", }, grid: { - borderColor: "#dee3e8", - color: (c) => (c.tick.major ? "#edf0f3" : ""), + color: (c) => (c.tick?.major ? "#edf0f3" : ""), }, + color: "#e4e9ec", ticks: { maxTicksLimit: 15, autoSkip: true, @@ -129,7 +128,7 @@ major: { enabled: true, }, - color: (c) => (c.tick.major ? "#16161a" : "#666f75"), + color: (c) => (c.tick?.major ? "#16161a" : "#666f75"), }, }, }, @@ -146,19 +145,14 @@
    +
    + Found {totalLogs} + {totalLogs == 1 ? "log" : "logs"} +
    {#if isLoading}
    {/if} - -
    - -
    - {#if isLoading} - Loading... - {:else} - {totalRequests} - {totalRequests === 1 ? "log" : "logs"} - {/if} +
    diff --git a/ui/src/components/logs/LogsLevelsInfo.svelte b/ui/src/components/logs/LogsLevelsInfo.svelte new file mode 100644 index 00000000..da2b76ac --- /dev/null +++ b/ui/src/components/logs/LogsLevelsInfo.svelte @@ -0,0 +1,15 @@ + + +
    + Default log levels: +
    + {#each logLevels as options} + {options.level}:{options.label} + {/each} +
    +
    diff --git a/ui/src/components/logs/LogsList.svelte b/ui/src/components/logs/LogsList.svelte index 8a5eaadf..5f1a1f26 100644 --- a/ui/src/components/logs/LogsList.svelte +++ b/ui/src/components/logs/LogsList.svelte @@ -1,43 +1,47 @@ @@ -86,45 +163,41 @@ - + + +
    - - Method + + level
    - +
    - - URL -
    -
    - - -
    - - Referer -
    -
    - - -
    - - User IP -
    -
    - - -
    - - Status + + data
    - Created + created
    @@ -132,53 +205,78 @@
    - {#each items as item (item.id)} + {#each logs as log (log.id)} + {@const hasData = log.data && CommonHelper.isObject(log.data)} dispatch("select", item)} + on:click={() => dispatch("select", log)} on:keydown={(e) => { if (e.code === "Enter") { e.preventDefault(); - dispatch("select", item); + dispatch("select", log); } }} > - - + + - - - - - -
    + {#if isLoading} + + {:else} +
    + toggleSelectAllLogs()} + /> +
    + {/if} +
    - - {item.method?.toUpperCase()} - + + + +
    + toggleSelectLog(log)} + /> +
    - - {item.url} - - {#if item.meta?.errorMessage || item.meta?.errorData} - + + + +
    + {#if log.message} + {log.message} + {/if} + + {#if hasData} + {#if log.data.status} + {log.data.status} + {/if} + {#if log.data.execTime} + {log.data.execTime}ms + {/if} + {#if log.data.auth} + {log.data.auth} + {/if} + {#if log.data.userIp} + {log.data.userIp} + {/if} + {#if log.data.error} + + {CommonHelper.truncate( + typeof log.data.error === "string" + ? log.data.error + : JSON.stringify(log.data.error), + 200 + )} + + {/if} + {/if} +
    + + {#if hasData} +
    + {CommonHelper.truncate(JSON.stringify(log.data), 350)} +
    {/if}
    - - {item.referer || "N/A"} - - - - {item.userIp || "N/A"} - - - = 400}> - {item.status} - - - + @@ -213,12 +311,8 @@
    -{#if items.length} - Showing {items.length} of {totalItems} -{/if} - -{#if items.length && canLoadMore} -
    +{#if logs.length && canLoadMore} +
    {/if} + +{#if totalBulkSelected} +
    +
    + Selected {totalBulkSelected} + {totalBulkSelected === 1 ? "log" : "logs"} +
    + +
    + +
    +{/if} + + diff --git a/ui/src/components/logs/LogsSettingsPanel.svelte b/ui/src/components/logs/LogsSettingsPanel.svelte new file mode 100644 index 00000000..c5f80271 --- /dev/null +++ b/ui/src/components/logs/LogsSettingsPanel.svelte @@ -0,0 +1,138 @@ + + + !isSaving} on:hide on:show> + +

    Logs settings

    +
    + + {#if isLoading} +
    +
    +
    + {:else} +
    + + + +
    + Set to 0 to disable logs persistence. +
    +
    + + + + +
    +

    Logs with level below the minimum will be ignored.

    + +
    +
    + + + + + +
    + {/if} + + + + + + diff --git a/ui/src/components/logs/PageLogs.svelte b/ui/src/components/logs/PageLogs.svelte index 822fa079..bd033341 100644 --- a/ui/src/components/logs/PageLogs.svelte +++ b/ui/src/components/logs/PageLogs.svelte @@ -1,6 +1,8 @@ @@ -50,13 +60,23 @@ + + refresh()} />
    - +
    @@ -64,21 +84,22 @@ (filter = e.detail)} /> - -
    + {#key refreshKey} - + {/key}
    {#key refreshKey} - logPanel?.show(e?.detail)} /> + logViewPanel?.show(e?.detail)} /> {/key} - + + + diff --git a/ui/src/components/records/RecordsList.svelte b/ui/src/components/records/RecordsList.svelte index 5492c0d0..50418e62 100644 --- a/ui/src/components/records/RecordsList.svelte +++ b/ui/src/components/records/RecordsList.svelte @@ -197,12 +197,19 @@ break; // new yield has been started } - records = records.concat(result.items.splice(0, 20)); + const subset = result.items.splice(0, 20); + for (let item of subset) { + CommonHelper.pushOrReplaceByKey(records, item); + } + records = records; await CommonHelper.yieldToMain(); } } else { - records = records.concat(result.items); + for (let item of result.items) { + CommonHelper.pushOrReplaceByKey(records, item); + } + records = records; } }) .catch((err) => { @@ -453,7 +460,7 @@
    -
    {record.id}
    +
    {record.id}
    {#if isAuth} diff --git a/ui/src/components/settings/PageApplication.svelte b/ui/src/components/settings/PageApplication.svelte index 7b50abcc..54cbf144 100644 --- a/ui/src/components/settings/PageApplication.svelte +++ b/ui/src/components/settings/PageApplication.svelte @@ -59,7 +59,6 @@ formSettings = { meta: settings?.meta || {}, - logs: settings?.logs || {}, }; originalFormSettings = JSON.parse(JSON.stringify(formSettings)); @@ -105,11 +104,6 @@
    - - - - -