mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-09-30 11:31:46 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c4fcba5210 | ||
|
|
d8c8289269 | ||
|
|
dbbfa243bc | ||
|
|
a16b0c9004 | ||
|
|
03a7bafa66 | ||
|
|
d129959098 | ||
|
|
6749559a22 | ||
|
|
28bc2678e9 | ||
|
|
d4202e696b | ||
|
|
9de3cc99a0 | ||
|
|
111bc59472 | ||
|
|
b2647ebca9 | ||
|
|
ef226cf9c1 | ||
|
|
63d5a8d633 | ||
|
|
d71c3cd19c | ||
|
|
240bd6790a |
No files matched your search
@@ -91,10 +91,12 @@ Running/building the application is the same as for any other Go program, aka. j
|
||||
|
||||
**PocketBase embeds SQLite, but doesn't require CGO.**
|
||||
|
||||
If CGO is enabled, it will use [mattn/go-sqlite3](https://pkg.go.dev/github.com/mattn/go-sqlite3) driver, otherwise - [modernc.org/sqlite](https://pkg.go.dev/modernc.org/sqlite).
|
||||
If CGO is enabled, it will use [mattn/go-sqlite3](https://pkg.go.dev/github.com/mattn/go-sqlite3) driver, otherwise - [modernc.org/sqlite](https://pkg.go.dev/modernc.org/sqlite). You can enable and disable CGO by setting the `CGO_ENABLED` enviroment variable to `1` or `0` respectively.
|
||||
|
||||
Enable CGO only if you really need to squeeze the read/write query performance at the expense of complicating cross compilation.
|
||||
|
||||
To build the minimal standalone executable, like the prebuilt ones in the releases page, you can simply run `go build` inside the `examples/base` directory.
|
||||
|
||||
### Testing
|
||||
|
||||
PocketBase comes with mixed bag of unit and integration tests.
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ func InitApi(app core.App) (*echo.Echo, error) {
|
||||
|
||||
// truly rare case; eg. client already disconnected
|
||||
if cErr != nil && app.IsDebug() {
|
||||
log.Println(err)
|
||||
log.Println(cErr)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
-13
@@ -159,8 +159,8 @@ func (api *realtimeApi) bindEvents() {
|
||||
adminTable := (&models.Admin{}).TableName()
|
||||
|
||||
// update user/admin auth state
|
||||
api.app.OnModelAfterUpdate().Add(func(data *core.ModelEvent) error {
|
||||
modelTable := data.Model.TableName()
|
||||
api.app.OnModelAfterUpdate().Add(func(e *core.ModelEvent) error {
|
||||
modelTable := e.Model.TableName()
|
||||
|
||||
var contextKey string
|
||||
switch modelTable {
|
||||
@@ -174,8 +174,8 @@ func (api *realtimeApi) bindEvents() {
|
||||
|
||||
for _, client := range api.app.SubscriptionsBroker().Clients() {
|
||||
model, _ := client.Get(contextKey).(models.Model)
|
||||
if model != nil && model.GetId() == data.Model.GetId() {
|
||||
client.Set(contextKey, data.Model)
|
||||
if model != nil && model.GetId() == e.Model.GetId() {
|
||||
client.Set(contextKey, e.Model)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,8 +183,8 @@ func (api *realtimeApi) bindEvents() {
|
||||
})
|
||||
|
||||
// remove user/admin client(s)
|
||||
api.app.OnModelAfterDelete().Add(func(data *core.ModelEvent) error {
|
||||
modelTable := data.Model.TableName()
|
||||
api.app.OnModelAfterDelete().Add(func(e *core.ModelEvent) error {
|
||||
modelTable := e.Model.TableName()
|
||||
|
||||
var contextKey string
|
||||
switch modelTable {
|
||||
@@ -198,7 +198,7 @@ func (api *realtimeApi) bindEvents() {
|
||||
|
||||
for _, client := range api.app.SubscriptionsBroker().Clients() {
|
||||
model, _ := client.Get(contextKey).(models.Model)
|
||||
if model != nil && model.GetId() == data.Model.GetId() {
|
||||
if model != nil && model.GetId() == e.Model.GetId() {
|
||||
api.app.SubscriptionsBroker().Unregister(client.Id())
|
||||
}
|
||||
}
|
||||
@@ -206,18 +206,20 @@ func (api *realtimeApi) bindEvents() {
|
||||
return nil
|
||||
})
|
||||
|
||||
api.app.OnRecordAfterCreateRequest().Add(func(data *core.RecordCreateEvent) error {
|
||||
api.broadcastRecord("create", data.Record)
|
||||
api.app.OnRecordAfterCreateRequest().Add(func(e *core.RecordCreateEvent) error {
|
||||
api.broadcastRecord("create", e.Record)
|
||||
return nil
|
||||
})
|
||||
|
||||
api.app.OnRecordAfterUpdateRequest().Add(func(data *core.RecordUpdateEvent) error {
|
||||
api.broadcastRecord("update", data.Record)
|
||||
api.app.OnRecordAfterUpdateRequest().Add(func(e *core.RecordUpdateEvent) error {
|
||||
api.broadcastRecord("update", e.Record)
|
||||
return nil
|
||||
})
|
||||
|
||||
api.app.OnRecordAfterDeleteRequest().Add(func(data *core.RecordDeleteEvent) error {
|
||||
api.broadcastRecord("delete", data.Record)
|
||||
api.app.OnModelBeforeDelete().Add(func(e *core.ModelEvent) error {
|
||||
if record, ok := e.Model.(*models.Record); ok {
|
||||
api.broadcastRecord("delete", record)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
+8
-10
@@ -64,7 +64,7 @@ func (dao *Dao) expandRecords(records []*models.Record, expandPath string, fetch
|
||||
}
|
||||
|
||||
// extract the id of the relations to expand
|
||||
relIds := []string{}
|
||||
relIds := make([]string, 0, len(records))
|
||||
for _, record := range records {
|
||||
relIds = append(relIds, record.GetStringSliceDataValue(relField.Name)...)
|
||||
}
|
||||
@@ -92,7 +92,7 @@ func (dao *Dao) expandRecords(records []*models.Record, expandPath string, fetch
|
||||
for _, model := range records {
|
||||
relIds := model.GetStringSliceDataValue(relField.Name)
|
||||
|
||||
validRels := []*models.Record{}
|
||||
validRels := make([]*models.Record, 0, len(relIds))
|
||||
for _, id := range relIds {
|
||||
if rel, ok := indexedRels[id]; ok {
|
||||
validRels = append(validRels, rel)
|
||||
@@ -120,20 +120,18 @@ func (dao *Dao) expandRecords(records []*models.Record, expandPath string, fetch
|
||||
// normalizeExpands normalizes expand strings and merges self containing paths
|
||||
// (eg. ["a.b.c", "a.b", " test ", " ", "test"] -> ["a.b.c", "test"]).
|
||||
func normalizeExpands(paths []string) []string {
|
||||
result := []string{}
|
||||
|
||||
// normalize paths
|
||||
normalized := []string{}
|
||||
normalized := make([]string, 0, len(paths))
|
||||
for _, p := range paths {
|
||||
p := strings.ReplaceAll(p, " ", "") // replace spaces
|
||||
p = strings.Trim(p, ".") // trim incomplete paths
|
||||
if p == "" {
|
||||
continue
|
||||
p = strings.ReplaceAll(p, " ", "") // replace spaces
|
||||
p = strings.Trim(p, ".") // trim incomplete paths
|
||||
if p != "" {
|
||||
normalized = append(normalized, p)
|
||||
}
|
||||
normalized = append(normalized, p)
|
||||
}
|
||||
|
||||
// merge containing paths
|
||||
result := make([]string, 0, len(normalized))
|
||||
for i, p1 := range normalized {
|
||||
var skip bool
|
||||
for j, p2 := range normalized {
|
||||
|
||||
+3
-3
@@ -43,10 +43,10 @@ func (dao *Dao) LoadProfiles(users []*models.User) error {
|
||||
}
|
||||
|
||||
// extract user ids
|
||||
ids := []string{}
|
||||
ids := make([]string, len(users))
|
||||
usersMap := map[string]*models.User{}
|
||||
for _, user := range users {
|
||||
ids = append(ids, user.Id)
|
||||
for i, user := range users {
|
||||
ids[i] = user.Id
|
||||
usersMap[user.Id] = user
|
||||
}
|
||||
|
||||
|
||||
+61
-60
@@ -150,76 +150,77 @@ func (form *RecordUpsert) LoadData(r *http.Request) error {
|
||||
value := extendedData[key]
|
||||
value = field.PrepareValue(value)
|
||||
|
||||
if field.Type == schema.FieldTypeFile {
|
||||
options, _ := field.Options.(*schema.FileOptions)
|
||||
oldNames := list.ToUniqueStringSlice(form.Data[key])
|
||||
if field.Type != schema.FieldTypeFile {
|
||||
form.Data[key] = value
|
||||
continue
|
||||
}
|
||||
|
||||
// delete previously uploaded file(s)
|
||||
if options.MaxSelect == 1 {
|
||||
// search for unset zero indexed key as a fallback
|
||||
indexedKeyValue, hasIndexedKey := extendedData[key+".0"]
|
||||
options, _ := field.Options.(*schema.FileOptions)
|
||||
oldNames := list.ToUniqueStringSlice(form.Data[key])
|
||||
|
||||
if cast.ToString(value) == "" || (hasIndexedKey && cast.ToString(indexedKeyValue) == "") {
|
||||
if len(oldNames) > 0 {
|
||||
form.filesToDelete = append(form.filesToDelete, oldNames...)
|
||||
}
|
||||
form.Data[key] = nil
|
||||
// delete previously uploaded file(s)
|
||||
if options.MaxSelect == 1 {
|
||||
// search for unset zero indexed key as a fallback
|
||||
indexedKeyValue, hasIndexedKey := extendedData[key+".0"]
|
||||
|
||||
if cast.ToString(value) == "" || (hasIndexedKey && cast.ToString(indexedKeyValue) == "") {
|
||||
if len(oldNames) > 0 {
|
||||
form.filesToDelete = append(form.filesToDelete, oldNames...)
|
||||
}
|
||||
} else if options.MaxSelect > 1 {
|
||||
// search for individual file index to delete (eg. "file.0")
|
||||
keyExp, _ := regexp.Compile(`^` + regexp.QuoteMeta(key) + `\.\d+$`)
|
||||
indexesToDelete := []int{}
|
||||
for indexedKey := range extendedData {
|
||||
if keyExp.MatchString(indexedKey) && cast.ToString(extendedData[indexedKey]) == "" {
|
||||
index, indexErr := strconv.Atoi(indexedKey[len(key)+1:])
|
||||
if indexErr != nil || index >= len(oldNames) {
|
||||
continue
|
||||
}
|
||||
indexesToDelete = append(indexesToDelete, index)
|
||||
}
|
||||
}
|
||||
|
||||
// slice to fill only with the non-deleted indexes
|
||||
nonDeleted := []string{}
|
||||
for i, name := range oldNames {
|
||||
// not marked for deletion
|
||||
if !list.ExistInSlice(i, indexesToDelete) {
|
||||
nonDeleted = append(nonDeleted, name)
|
||||
form.Data[key] = nil
|
||||
}
|
||||
} else if options.MaxSelect > 1 {
|
||||
// search for individual file index to delete (eg. "file.0")
|
||||
keyExp, _ := regexp.Compile(`^` + regexp.QuoteMeta(key) + `\.\d+$`)
|
||||
indexesToDelete := make([]int, 0, len(extendedData))
|
||||
for indexedKey := range extendedData {
|
||||
if keyExp.MatchString(indexedKey) && cast.ToString(extendedData[indexedKey]) == "" {
|
||||
index, indexErr := strconv.Atoi(indexedKey[len(key)+1:])
|
||||
if indexErr != nil || index >= len(oldNames) {
|
||||
continue
|
||||
}
|
||||
|
||||
// store the id to actually delete the file later
|
||||
form.filesToDelete = append(form.filesToDelete, name)
|
||||
indexesToDelete = append(indexesToDelete, index)
|
||||
}
|
||||
form.Data[key] = nonDeleted
|
||||
}
|
||||
|
||||
// check if there are any new uploaded form files
|
||||
files, err := rest.FindUploadedFiles(r, key)
|
||||
if err != nil {
|
||||
continue // skip invalid or missing file(s)
|
||||
}
|
||||
|
||||
// refresh oldNames list
|
||||
oldNames = list.ToUniqueStringSlice(form.Data[key])
|
||||
|
||||
if options.MaxSelect == 1 {
|
||||
// delete previous file(s) before replacing
|
||||
if len(oldNames) > 0 {
|
||||
form.filesToDelete = list.ToUniqueStringSlice(append(form.filesToDelete, oldNames...))
|
||||
// slice to fill only with the non-deleted indexes
|
||||
nonDeleted := make([]string, 0, len(oldNames))
|
||||
for i, name := range oldNames {
|
||||
// not marked for deletion
|
||||
if !list.ExistInSlice(i, indexesToDelete) {
|
||||
nonDeleted = append(nonDeleted, name)
|
||||
continue
|
||||
}
|
||||
form.filesToUpload = append(form.filesToUpload, files[0])
|
||||
form.Data[key] = files[0].Name()
|
||||
} else if options.MaxSelect > 1 {
|
||||
// append the id of each uploaded file instance
|
||||
form.filesToUpload = append(form.filesToUpload, files...)
|
||||
for _, file := range files {
|
||||
oldNames = append(oldNames, file.Name())
|
||||
}
|
||||
form.Data[key] = oldNames
|
||||
|
||||
// store the id to actually delete the file later
|
||||
form.filesToDelete = append(form.filesToDelete, name)
|
||||
}
|
||||
} else {
|
||||
form.Data[key] = value
|
||||
form.Data[key] = nonDeleted
|
||||
}
|
||||
|
||||
// check if there are any new uploaded form files
|
||||
files, err := rest.FindUploadedFiles(r, key)
|
||||
if err != nil {
|
||||
continue // skip invalid or missing file(s)
|
||||
}
|
||||
|
||||
// refresh oldNames list
|
||||
oldNames = list.ToUniqueStringSlice(form.Data[key])
|
||||
|
||||
if options.MaxSelect == 1 {
|
||||
// delete previous file(s) before replacing
|
||||
if len(oldNames) > 0 {
|
||||
form.filesToDelete = list.ToUniqueStringSlice(append(form.filesToDelete, oldNames...))
|
||||
}
|
||||
form.filesToUpload = append(form.filesToUpload, files[0])
|
||||
form.Data[key] = files[0].Name()
|
||||
} else if options.MaxSelect > 1 {
|
||||
// append the id of each uploaded file instance
|
||||
form.filesToUpload = append(form.filesToUpload, files...)
|
||||
for _, file := range files {
|
||||
oldNames = append(oldNames, file.Name())
|
||||
}
|
||||
form.Data[key] = oldNames
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+25
-24
@@ -98,35 +98,36 @@ func (form *UserOauth2Login) Submit() (*models.User, *auth.AuthUser, error) {
|
||||
return nil, authData, err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if !config.AllowRegistrations {
|
||||
// registration of new users is not allowed via the Oauth2 provider
|
||||
return nil, authData, errors.New("Cannot find user with the authorized email.")
|
||||
}
|
||||
return user, authData, nil
|
||||
}
|
||||
|
||||
// create new user
|
||||
user = &models.User{Verified: true}
|
||||
upsertForm := NewUserUpsert(form.app, user)
|
||||
upsertForm.Email = authData.Email
|
||||
upsertForm.Password = security.RandomString(30)
|
||||
upsertForm.PasswordConfirm = upsertForm.Password
|
||||
if !config.AllowRegistrations {
|
||||
// registration of new users is not allowed via the Oauth2 provider
|
||||
return nil, authData, errors.New("Cannot find user with the authorized email.")
|
||||
}
|
||||
|
||||
event := &core.UserOauth2RegisterEvent{
|
||||
User: user,
|
||||
AuthData: authData,
|
||||
}
|
||||
// create new user
|
||||
user = &models.User{Verified: true}
|
||||
upsertForm := NewUserUpsert(form.app, user)
|
||||
upsertForm.Email = authData.Email
|
||||
upsertForm.Password = security.RandomString(30)
|
||||
upsertForm.PasswordConfirm = upsertForm.Password
|
||||
|
||||
if err := form.app.OnUserBeforeOauth2Register().Trigger(event); err != nil {
|
||||
return nil, authData, err
|
||||
}
|
||||
event := &core.UserOauth2RegisterEvent{
|
||||
User: user,
|
||||
AuthData: authData,
|
||||
}
|
||||
|
||||
if err := upsertForm.Submit(); err != nil {
|
||||
return nil, authData, err
|
||||
}
|
||||
if err := form.app.OnUserBeforeOauth2Register().Trigger(event); err != nil {
|
||||
return nil, authData, err
|
||||
}
|
||||
|
||||
if err := form.app.OnUserAfterOauth2Register().Trigger(event); err != nil {
|
||||
return nil, authData, err
|
||||
}
|
||||
if err := upsertForm.Submit(); err != nil {
|
||||
return nil, authData, err
|
||||
}
|
||||
|
||||
if err := form.app.OnUserAfterOauth2Register().Trigger(event); err != nil {
|
||||
return nil, authData, err
|
||||
}
|
||||
|
||||
return user, authData, nil
|
||||
|
||||
@@ -318,12 +318,10 @@ func (validator *RecordDataValidator) checkFileValue(field *schema.SchemaField,
|
||||
}
|
||||
|
||||
// extract the uploaded files
|
||||
files := []*rest.UploadedFile{}
|
||||
if len(validator.uploadedFiles) > 0 {
|
||||
for _, file := range validator.uploadedFiles {
|
||||
if list.ExistInSlice(file.Name(), names) {
|
||||
files = append(files, file)
|
||||
}
|
||||
files := make([]*rest.UploadedFile, 0, len(validator.uploadedFiles))
|
||||
for _, file := range validator.uploadedFiles {
|
||||
if list.ExistInSlice(file.Name(), names) {
|
||||
files = append(files, file)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -68,10 +68,10 @@ func NewRecordFromNullStringMap(collection *Collection, data dbx.NullStringMap)
|
||||
// NewRecordsFromNullStringMaps initializes a new Record model for
|
||||
// each row in the provided NullStringMap slice.
|
||||
func NewRecordsFromNullStringMaps(collection *Collection, rows []dbx.NullStringMap) []*Record {
|
||||
result := []*Record{}
|
||||
result := make([]*Record, len(rows))
|
||||
|
||||
for _, row := range rows {
|
||||
result = append(result, NewRecordFromNullStringMap(collection, row))
|
||||
for i, row := range rows {
|
||||
result[i] = NewRecordFromNullStringMap(collection, row)
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
+2
-2
@@ -9,10 +9,10 @@ import (
|
||||
var _ Model = (*User)(nil)
|
||||
|
||||
const (
|
||||
// The name of the system user profiles collection.
|
||||
// ProfileCollectionName is the name of the system user profiles collection.
|
||||
ProfileCollectionName = "profiles"
|
||||
|
||||
// The name of the user field from the system user profiles collection.
|
||||
// ProfileCollectionUserFieldName is the name of the user field from the system user profiles collection.
|
||||
ProfileCollectionUserFieldName = "userId"
|
||||
)
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ func (r *RecordFieldResolver) Resolve(fieldName string) (resultName string, plac
|
||||
return "", nil, fmt.Errorf("Failed to find field %q collection.", prop)
|
||||
}
|
||||
newCollectionName := relCollection.Name
|
||||
newTableAlias := (currentTableAlias + "_" + field.Name)
|
||||
newTableAlias := currentTableAlias + "_" + field.Name
|
||||
|
||||
r.addJoin(
|
||||
newCollectionName,
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ func (scenario *ApiScenario) Test(t *testing.T) {
|
||||
recorder := httptest.NewRecorder()
|
||||
req := httptest.NewRequest(scenario.Method, scenario.Url, scenario.Body)
|
||||
|
||||
// add middeware to timeout long running requests (eg. keep-alive routes)
|
||||
// add middleware to timeout long-running requests (eg. keep-alive routes)
|
||||
e.Pre(func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
ctx, cancelFunc := context.WithTimeout(c.Request().Context(), 100*time.Millisecond)
|
||||
|
||||
+3
-1
@@ -44,7 +44,9 @@ func (h *Hook[T]) Reset() {
|
||||
// - any non-nil error is returned in one of the handlers
|
||||
func (h *Hook[T]) Trigger(data T, oneOffHandlers ...Handler[T]) error {
|
||||
h.mux.Lock()
|
||||
handlers := append(h.handlers, oneOffHandlers...) //nolint:gocritic
|
||||
handlers := make([]Handler[T], 0, len(h.handlers)+len(oneOffHandlers))
|
||||
handlers = append(handlers, h.handlers...)
|
||||
handlers = append(handlers, oneOffHandlers...)
|
||||
// unlock is not deferred to avoid deadlocks when Trigger is called recursive by the handlers
|
||||
h.mux.Unlock()
|
||||
|
||||
|
||||
+29
-28
@@ -38,21 +38,23 @@ func ExistInSliceWithRegex(str string, list []string) bool {
|
||||
if str == field {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
// check for regex match
|
||||
pattern, ok := cachedPatterns[field]
|
||||
if !ok {
|
||||
var patternErr error
|
||||
pattern, patternErr = regexp.Compile(field)
|
||||
if patternErr != nil {
|
||||
continue
|
||||
}
|
||||
// "cache" the pattern to avoid compiling it every time
|
||||
cachedPatterns[field] = pattern
|
||||
}
|
||||
if pattern != nil && pattern.MatchString(str) {
|
||||
return true
|
||||
continue
|
||||
}
|
||||
|
||||
// check for regex match
|
||||
pattern, ok := cachedPatterns[field]
|
||||
if !ok {
|
||||
var err error
|
||||
pattern, err = regexp.Compile(field)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
// "cache" the pattern to avoid compiling it every time
|
||||
cachedPatterns[field] = pattern
|
||||
}
|
||||
|
||||
if pattern != nil && pattern.MatchString(str) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,46 +74,45 @@ func ToInterfaceSlice[T any](list []T) []any {
|
||||
|
||||
// NonzeroUniques returns only the nonzero unique values from a slice.
|
||||
func NonzeroUniques[T comparable](list []T) []T {
|
||||
result := []T{}
|
||||
existMap := map[T]bool{}
|
||||
result := make([]T, 0, len(list))
|
||||
existMap := make(map[T]struct{}, len(list))
|
||||
|
||||
var zeroVal T
|
||||
|
||||
for _, val := range list {
|
||||
if !existMap[val] && val != zeroVal {
|
||||
existMap[val] = true
|
||||
result = append(result, val)
|
||||
if _, ok := existMap[val]; ok || val == zeroVal {
|
||||
continue
|
||||
}
|
||||
existMap[val] = struct{}{}
|
||||
result = append(result, val)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// ToUniqueStringSlice casts `value` to a slice of non-zero unique strings.
|
||||
func ToUniqueStringSlice(value any) []string {
|
||||
strings := []string{}
|
||||
|
||||
func ToUniqueStringSlice(value any) (result []string) {
|
||||
switch val := value.(type) {
|
||||
case nil:
|
||||
// nothing to cast
|
||||
case []string:
|
||||
strings = val
|
||||
result = val
|
||||
case string:
|
||||
if val == "" {
|
||||
break
|
||||
}
|
||||
|
||||
// check if it is a json encoded array of strings
|
||||
if err := json.Unmarshal([]byte(val), &strings); err != nil {
|
||||
if err := json.Unmarshal([]byte(val), &result); err != nil {
|
||||
// not a json array, just add the string as single array element
|
||||
strings = append(strings, val)
|
||||
result = append(result, val)
|
||||
}
|
||||
case json.Marshaler: // eg. JsonArray
|
||||
raw, _ := val.MarshalJSON()
|
||||
json.Unmarshal(raw, &strings)
|
||||
_ = json.Unmarshal(raw, &result)
|
||||
default:
|
||||
strings = cast.ToStringSlice(value)
|
||||
result = cast.ToStringSlice(value)
|
||||
}
|
||||
|
||||
return NonzeroUniques(strings)
|
||||
return NonzeroUniques(result)
|
||||
}
|
||||
+25
-42
@@ -27,21 +27,16 @@ var parsedFilterData = store.New(make(map[string][]fexpr.ExprGroup, 50))
|
||||
// BuildExpr parses the current filter data and returns a new db WHERE expression.
|
||||
func (f FilterData) BuildExpr(fieldResolver FieldResolver) (dbx.Expression, error) {
|
||||
raw := string(f)
|
||||
var data []fexpr.ExprGroup
|
||||
|
||||
if parsedFilterData.Has(raw) {
|
||||
data = parsedFilterData.Get(raw)
|
||||
} else {
|
||||
var err error
|
||||
data, err = fexpr.Parse(raw)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// store in cache
|
||||
// (the limit size is arbitrary and it is there to prevent the cache growing too big)
|
||||
parsedFilterData.SetIfLessThanLimit(raw, data, 500)
|
||||
return f.build(parsedFilterData.Get(raw), fieldResolver)
|
||||
}
|
||||
|
||||
data, err := fexpr.Parse(raw)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// store in cache
|
||||
// (the limit size is arbitrary and it is there to prevent the cache growing too big)
|
||||
parsedFilterData.SetIfLessThanLimit(raw, data, 500)
|
||||
return f.build(data, fieldResolver)
|
||||
}
|
||||
|
||||
@@ -94,15 +89,11 @@ func (f FilterData) resolveTokenizedExpr(expr fexpr.Expr, fieldResolver FieldRes
|
||||
|
||||
// merge both operands parameters (if any)
|
||||
params := dbx.Params{}
|
||||
if len(lParams) > 0 {
|
||||
for k, v := range lParams {
|
||||
params[k] = v
|
||||
}
|
||||
for k, v := range lParams {
|
||||
params[k] = v
|
||||
}
|
||||
if len(rParams) > 0 {
|
||||
for k, v := range rParams {
|
||||
params[k] = v
|
||||
}
|
||||
for k, v := range rParams {
|
||||
params[k] = v
|
||||
}
|
||||
|
||||
switch expr.Op {
|
||||
@@ -144,35 +135,31 @@ func (f FilterData) resolveTokenizedExpr(expr fexpr.Expr, fieldResolver FieldRes
|
||||
}
|
||||
|
||||
func (f FilterData) resolveToken(token fexpr.Token, fieldResolver FieldResolver) (name string, params dbx.Params, err error) {
|
||||
if token.Type == fexpr.TokenIdentifier {
|
||||
switch token.Type {
|
||||
case fexpr.TokenIdentifier:
|
||||
name, params, err := fieldResolver.Resolve(token.Literal)
|
||||
|
||||
if name == "" || err != nil {
|
||||
// if `null` field is missing, treat `null` identifier as NULL token
|
||||
if strings.ToLower(token.Literal) == "null" {
|
||||
return "NULL", nil, nil
|
||||
m := map[string]string{
|
||||
// if `null` field is missing, treat `null` identifier as NULL token
|
||||
"null": "NULL",
|
||||
// if `true` field is missing, treat `true` identifier as TRUE token
|
||||
"true": "1",
|
||||
// if `false` field is missing, treat `false` identifier as FALSE token
|
||||
"false": "0",
|
||||
}
|
||||
|
||||
// if `true` field is missing, treat `true` identifier as TRUE token
|
||||
if strings.ToLower(token.Literal) == "true" {
|
||||
return "1", nil, nil
|
||||
if v, ok := m[strings.ToLower(token.Literal)]; ok {
|
||||
return v, nil, nil
|
||||
}
|
||||
|
||||
// if `false` field is missing, treat `false` identifier as FALSE token
|
||||
if strings.ToLower(token.Literal) == "false" {
|
||||
return "0", nil, nil
|
||||
}
|
||||
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
return name, params, err
|
||||
}
|
||||
|
||||
if token.Type == fexpr.TokenNumber || token.Type == fexpr.TokenText {
|
||||
case fexpr.TokenNumber, fexpr.TokenText:
|
||||
placeholder := "t" + security.RandomString(7)
|
||||
name := fmt.Sprintf("{:%s}", placeholder)
|
||||
params := dbx.Params{placeholder: token.Literal}
|
||||
|
||||
return name, params, nil
|
||||
}
|
||||
|
||||
@@ -182,10 +169,6 @@ func (f FilterData) resolveToken(token fexpr.Token, fieldResolver FieldResolver)
|
||||
func (f FilterData) normalizeLikeParams(params dbx.Params) dbx.Params {
|
||||
result := dbx.Params{}
|
||||
|
||||
if len(params) == 0 {
|
||||
return result
|
||||
}
|
||||
|
||||
for k, v := range params {
|
||||
vStr := cast.ToString(v)
|
||||
if !strings.Contains(vStr, "%") {
|
||||
|
||||
+20
-29
@@ -121,8 +121,7 @@ func (s *Provider) Parse(urlQuery string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
rawPage := params.Get(PageQueryParam)
|
||||
if rawPage != "" {
|
||||
if rawPage := params.Get(PageQueryParam); rawPage != "" {
|
||||
page, err := strconv.Atoi(rawPage)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -130,8 +129,7 @@ func (s *Provider) Parse(urlQuery string) error {
|
||||
s.Page(page)
|
||||
}
|
||||
|
||||
rawPerPage := params.Get(PerPageQueryParam)
|
||||
if rawPerPage != "" {
|
||||
if rawPerPage := params.Get(PerPageQueryParam); rawPerPage != "" {
|
||||
perPage, err := strconv.Atoi(rawPerPage)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -139,15 +137,13 @@ func (s *Provider) Parse(urlQuery string) error {
|
||||
s.PerPage(perPage)
|
||||
}
|
||||
|
||||
rawSort := params.Get(SortQueryParam)
|
||||
if rawSort != "" {
|
||||
if rawSort := params.Get(SortQueryParam); rawSort != "" {
|
||||
for _, sortField := range ParseSortFromString(rawSort) {
|
||||
s.AddSort(sortField)
|
||||
}
|
||||
}
|
||||
|
||||
rawFilter := params.Get(FilterQueryParam)
|
||||
if rawFilter != "" {
|
||||
if rawFilter := params.Get(FilterQueryParam); rawFilter != "" {
|
||||
s.AddFilter(FilterData(rawFilter))
|
||||
}
|
||||
|
||||
@@ -165,35 +161,30 @@ func (s *Provider) Exec(items any) (*Result, error) {
|
||||
modelsQuery := *s.query
|
||||
|
||||
// apply filters
|
||||
if len(s.filter) > 0 {
|
||||
for _, f := range s.filter {
|
||||
expr, err := f.BuildExpr(s.fieldResolver)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if expr != nil {
|
||||
modelsQuery.AndWhere(expr)
|
||||
}
|
||||
for _, f := range s.filter {
|
||||
expr, err := f.BuildExpr(s.fieldResolver)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if expr != nil {
|
||||
modelsQuery.AndWhere(expr)
|
||||
}
|
||||
}
|
||||
|
||||
// apply sorting
|
||||
if len(s.sort) > 0 {
|
||||
for _, sortField := range s.sort {
|
||||
expr, err := sortField.BuildExpr(s.fieldResolver)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if expr != "" {
|
||||
modelsQuery.AndOrderBy(expr)
|
||||
}
|
||||
for _, sortField := range s.sort {
|
||||
expr, err := sortField.BuildExpr(s.fieldResolver)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if expr != "" {
|
||||
modelsQuery.AndOrderBy(expr)
|
||||
}
|
||||
}
|
||||
|
||||
// apply field resolver query modifications (if any)
|
||||
updateQueryErr := s.fieldResolver.UpdateQuery(&modelsQuery)
|
||||
if updateQueryErr != nil {
|
||||
return nil, updateQueryErr
|
||||
if err := s.fieldResolver.UpdateQuery(&modelsQuery); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// count
|
||||
|
||||
+4
-12
@@ -34,26 +34,18 @@ func (s *SortField) BuildExpr(fieldResolver FieldResolver) (string, error) {
|
||||
//
|
||||
// Example:
|
||||
// fields := search.ParseSortFromString("-name,+created")
|
||||
func ParseSortFromString(str string) []SortField {
|
||||
result := []SortField{}
|
||||
|
||||
func ParseSortFromString(str string) (fields []SortField) {
|
||||
data := strings.Split(str, ",")
|
||||
|
||||
for _, field := range data {
|
||||
// trim whitespaces
|
||||
field = strings.TrimSpace(field)
|
||||
|
||||
var dir string
|
||||
if strings.HasPrefix(field, "-") {
|
||||
dir = SortDesc
|
||||
field = strings.TrimPrefix(field, "-")
|
||||
fields = append(fields, SortField{strings.TrimPrefix(field, "-"), SortDesc})
|
||||
} else {
|
||||
dir = SortAsc
|
||||
field = strings.TrimPrefix(field, "+")
|
||||
fields = append(fields, SortField{strings.TrimPrefix(field, "+"), SortAsc})
|
||||
}
|
||||
|
||||
result = append(result, SortField{field, dir})
|
||||
}
|
||||
|
||||
return result
|
||||
return
|
||||
}
|
||||
@@ -66,10 +66,5 @@ func Decrypt(cipherText string, key string) ([]byte, error) {
|
||||
}
|
||||
|
||||
nonce, cipherByteClean := cipherByte[:nonceSize], cipherByte[nonceSize:]
|
||||
plainData, err := gcm.Open(nil, nonce, cipherByteClean, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return plainData, nil
|
||||
return gcm.Open(nil, nonce, cipherByteClean, nil)
|
||||
}
|
||||
@@ -24,9 +24,7 @@ func ParseUnverifiedJWT(token string) (jwt.MapClaims, error) {
|
||||
|
||||
// ParseJWT verifies and parses JWT token and returns its claims.
|
||||
func ParseJWT(token string, verificationKey string) (jwt.MapClaims, error) {
|
||||
parser := &jwt.Parser{
|
||||
ValidMethods: []string{"HS256"},
|
||||
}
|
||||
parser := jwt.NewParser(jwt.WithValidMethods([]string{"HS256"}))
|
||||
|
||||
parsedToken, err := parser.Parse(token, func(t *jwt.Token) (any, error) {
|
||||
return []byte(verificationKey), nil
|
||||
@@ -50,10 +48,8 @@ func NewToken(payload jwt.MapClaims, signingKey string, secondsDuration int64) (
|
||||
"exp": time.Now().Add(seconds).Unix(),
|
||||
}
|
||||
|
||||
if len(payload) > 0 {
|
||||
for k, v := range payload {
|
||||
claims[k] = v
|
||||
}
|
||||
for k, v := range payload {
|
||||
claims[k] = v
|
||||
}
|
||||
|
||||
return jwt.NewWithClaims(jwt.SigningMethodHS256, claims).SignedString([]byte(signingKey))
|
||||
|
||||
@@ -13,6 +13,14 @@ func New[T any](data map[string]T) *Store[T] {
|
||||
return &Store[T]{data: data}
|
||||
}
|
||||
|
||||
// RemoveAll removes all the existing store entries.
|
||||
func (s *Store[T]) RemoveAll() {
|
||||
s.mux.Lock()
|
||||
defer s.mux.Unlock()
|
||||
|
||||
s.data = make(map[string]T)
|
||||
}
|
||||
|
||||
// Remove removes a single entry from the store.
|
||||
//
|
||||
// Remove does nothing if key doesn't exist in the store.
|
||||
|
||||
@@ -14,6 +14,20 @@ func TestNew(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemoveAll(t *testing.T) {
|
||||
s := store.New(map[string]bool{"test1": true, "test2": true})
|
||||
|
||||
keys := []string{"test1", "test2"}
|
||||
|
||||
s.RemoveAll()
|
||||
|
||||
for i, key := range keys {
|
||||
if s.Has(key) {
|
||||
t.Errorf("(%d) Expected %q to be removed", i, key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRemove(t *testing.T) {
|
||||
s := store.New(map[string]bool{"test": true})
|
||||
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
import{S as Sa,i as va,s as Ca,e as Aa,f as Ma,g as Da,y as xn,o as Oa,G as Ta,H as Ba,I as Ra,P as Pa,J as La,C as kn,K as Ea}from"./index.c9783c65.js";class z{constructor(){}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),Ve.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),Ve.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 Zt(this),r=new Zt(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 Zt(this,e)}iterRange(e,t=this.length){return new zo(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 qo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new Q(e):Ve.from(Q.split(e,[]))}}class Q extends z{constructor(e,t=Ia(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 Na(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(hr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Pi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new Q(l,o.length+r.length));else{let h=l.length>>1;i.push(new Q(l.slice(0,h)),new Q(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Q))return super.replace(e,t,i);let s=Pi(this.text,Pi(i.text,hr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Q(s,r):Ve.from(Q.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
||||
import{S as Sa,i as va,s as Ca,e as Aa,f as Ma,g as Da,y as xn,o as Oa,G as Ta,H as Ba,I as Ra,J as Pa,K as La,C as kn,L as Ea}from"./index.cb8e511c.js";class z{constructor(){}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),Ve.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),Ve.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 Zt(this),r=new Zt(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 Zt(this,e)}iterRange(e,t=this.length){return new zo(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 qo(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new Q(e):Ve.from(Q.split(e,[]))}}class Q extends z{constructor(e,t=Ia(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 Na(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(hr(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Pi(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new Q(l,o.length+r.length));else{let h=l.length>>1;i.push(new Q(l.slice(0,h)),new Q(l.slice(h)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Q))return super.replace(e,t,i);let s=Pi(this.text,Pi(i.text,hr(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Q(s,r):Ve.from(Q.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
||||
`){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],h=r+l.length;r>e&&o&&(s+=i),e<h&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=h+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 Q(i,s)),i=[],s=-1);return s>-1&&t.push(new Q(i,s)),t}}class Ve extends z{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,h=i+o.lines-1;if((t?h:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=h+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],h=o+l.length;if(e<=h&&t>=o){let a=s&((o<=e?1:0)|(h>=t?2:0));o>=e&&h<=t&&!a?i.push(l):l.decompose(e-o,t-o,i,a)}o=h+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let h=o.replace(e-r,t-r,i),a=this.lines-o.lines+h.lines;if(h.lines<a>>5-1&&h.lines>a>>5+1){let c=this.children.slice();return c[s]=h,new Ve(c,this.length-(t-e)+i.length)}return super.replace(r,l,h)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
||||
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],h=o+l.length;o>e&&r&&(s+=i),e<h&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=h+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ve))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 h=this.children[s],a=e.children[r];if(h!=a)return i+h.scanIdentical(a,t);i+=h.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 Q(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],h=0,a=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Ve)for(let g of d.children)f(g);else d.lines>o&&(h>o||!h)?(u(),l.push(d)):d instanceof Q&&h&&(p=c[c.length-1])instanceof Q&&d.lines+p.lines<=32?(h+=d.lines,a+=d.length+1,c[c.length-1]=new Q(p.text.concat(d.text),p.length+1+d.length)):(h+d.lines>s&&u(),h+=d.lines,a+=d.length+1,c.push(d))}function u(){h!=0&&(l.push(c.length==1?c[0]:Ve.from(c,a)),a=-1,h=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Ve(l,t)}}z.empty=new Q([""],0);function Ia(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Pi(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],h=s+l.length;h>=t&&(h>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=h+1}return e}function hr(n,e,t){return Pi(n,[""],e,t)}class Zt{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Q?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 Q?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 Q){let h=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=s.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof Q?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class zo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Zt(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 qo{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!="undefined"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},Zt.prototype[Symbol.iterator]=zo.prototype[Symbol.iterator]=qo.prototype[Symbol.iterator]=function(){return this});class Na{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 Dt="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;n<Dt.length;n++)Dt[n]+=Dt[n-1];function Va(n){for(let e=1;e<Dt.length;e+=2)if(Dt[e]>n)return Dt[e-1]<=n;return!1}function ar(n){return n>=127462&&n<=127487}const cr=8205;function Ae(n,e,t=!0,i=!0){return(t?Ko:Fa)(n,e,i)}function Ko(n,e,t){if(e==n.length)return e;e&&Uo(n.charCodeAt(e))&&jo(n.charCodeAt(e-1))&&e--;let i=re(n,e);for(e+=ve(i);e<n.length;){let s=re(n,e);if(i==cr||s==cr||t&&Va(s))e+=ve(s),i=s;else if(ar(s)){let r=0,o=e-2;for(;o>=0&&ar(re(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Fa(n,e,t){for(;e>0;){let i=Ko(n,e-2,t);if(i<e)return i;e--}return 0}function Uo(n){return n>=56320&&n<57344}function jo(n){return n>=55296&&n<56320}function re(n,e){let t=n.charCodeAt(e);if(!jo(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Uo(i)?(t-55296<<10)+(i-56320)+65536:t}function Rs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ve(n){return n<65536?1:2}const Kn=/\r\n?|\n/;var me=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(me||(me={}));class We{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Un(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s)
Line truncated
|
||||
`}get readOnly(){return this.facet(tl)}phrase(e,...t){for(let i of this.facet(V.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(Xo))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Xa(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 h=Ae(t,o,!1);if(r(t.slice(h,o))!=ce.Word)break;o=h}for(;l<s;){let h=Ae(t,l);if(r(t.slice(l,h))!=ce.Word)break;l=h}return o==l?null:m.range(o+i,l+i)}}V.allowMultipleSelections=Yo;V.tabSize=T.define({combine:n=>n.length?n[0]:4});V.lineSeparator=_o;V.readOnly=tl;V.phrases=T.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])}});V.languageData=Xo;V.changeFilter=Qo;V.transactionFilter=Zo;V.transactionExtender=el;_e.reconfigure=H.define();function zt(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 pt{eq(e){return this==e}range(e,t=e){return ri.create(e,t,this)}}pt.prototype.startSide=pt.prototype.endSide=0;pt.prototype.point=!1;pt.prototype.mapMode=me.TrackDel;class ri{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ri(e,t,i)}}function Yn(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Es{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 h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let h=0;h<this.value.length;h++){let a=this.value[h],c=this.from[h]+e,f=this.to[h]+e,u,d;if(c==f){let p=t.mapPos(c,a.startSide,a.mapMode);if(p==null||(u=d=p,a.startSide!=a.endSide&&(d=t.mapPos(c,a.endSide),d<u)))continue}else if(u=t.mapPos(c,a.startSide),d=t.mapPos(f,a.endSide),u>d||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Es(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(Yn)),this.isEmpty)return t.length?Y.of(t):this;let l=new sl(this,null,-1).goto(0),h=0,a=[],c=new gt;for(;l.value||h<t.length;)if(h<t.length&&(l.from-t[h].from||l.startSide-t[h].value.startSide)>=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(l.chunkIndex)<t[h].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||a.push(ri.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!a.length?Y.empty:this.nextLayer.update({add:a,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],h=this.chunk[o],a=e.touchesRange(l,l+h.length);if(a===!1)s=Math.max(s,h.maxPoint),t.push(h),i.push(e.mapPos(l));else if(a===!0){let{mapped:c,pos:f}=h.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new Y(i,t,r||Y.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=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 oi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return oi.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),h=dr(o,l,i),a=new Ut(o,h,r),c=new Ut(l
Line truncated
|
||||
`)}static newName(){let e=yr[mr]||1;return yr[mr]=e+1,Zn+e.toString(36)}static mount(e,t){(e[es]||new _a(e)).mount(Array.isArray(t)?t:[t])}}let bi=null;class _a{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet!="undefined"){if(bi)return e.adoptedStyleSheets=[bi.sheet].concat(e.adoptedStyleSheets),e[es]=bi;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),bi=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[es]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let h=0;h<o.rules.length;h++)t.insertRule(o.rules[h],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
|
||||
`;this.styleTag.textContent=r}}}var rt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Rt={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},br=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Qa=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor),Za=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent),wr=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),ec=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tc=br&&(wr||+br[1]<57)||Za&≀for(var oe=0;oe<10;oe++)rt[48+oe]=rt[96+oe]=String(oe);for(var oe=1;oe<=24;oe++)rt[oe+111]="F"+oe;for(var oe=65;oe<=90;oe++)rt[oe]=String.fromCharCode(oe+32),Rt[oe]=String.fromCharCode(oe);for(var vn in rt)Rt.hasOwnProperty(vn)||(Rt[vn]=rt[vn]);function ic(n){var e=tc&&(n.ctrlKey||n.altKey||n.metaKey)||(Qa||ec)&&n.shiftKey&&n.key&&n.key.length==1,t=!e&&n.key||(n.shiftKey?Rt:rt)[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 Hi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Pt(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function nc(){let n=document.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function ts(n,e){if(!e.anchorNode)return!1;try{return Pt(n,e.anchorNode)}catch{return!1}}function li(n){return n.nodeType==3?Lt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Wi(n,e,t,i){return t?xr(n,e,t,i,-1)||xr(n,e,t,i,1):!1}function is(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function xr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:zi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=is(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?zi(n):0}else return!1}}function zi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const rl={left:0,right:0,top:0,bottom:0};function on(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function sc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function rc(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=sc(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let g=e.bottom-e.top,y=f.bottom-f.top;p=(s=="center"&&g<=y?e.top+g/2-y/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-y+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)a.scrollBy(d,p);else{if(p){let g=c.scrollTop;c.scrollTop+=p,p=c.scrollTop-g}if(d){let g=c.scrollLeft;c.scrollLeft+=d,d=c.scrollLeft-g}e={left:e.left-d,top:e.top-p,right:e.right-d,bottom:e.bottom-p}}if(u)break;c=c.assignedSlot||c.parentNode,i=s="nearest"}else if(c.nodeType==11)c=c.host;else break}class oc{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){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let vt=null;function ol(n){if(n.setActive)return n.setActive();if(vt)return n.focus(vt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(vt==null?{get preventScroll(){return vt={preventScroll:!0},!0}}:void 0),!vt){vt=!1;for(let t=0;t<e.length;){let iLine truncated
|
||||
`,this;e--}else if(s instanceof Q){let h=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,h.length>Math.max(0,e))return this.value=e==0?h:t>0?h.slice(e):h.slice(0,h.length-e),this;e-=h.length}else{let h=s.children[o+(t<0?-1:0)];e>h.length?(e-=h.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(h),this.offsets.push(t>0?1:(h instanceof Q?h.text.length:h.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class zo{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Zt(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 qo{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"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},Zt.prototype[Symbol.iterator]=zo.prototype[Symbol.iterator]=qo.prototype[Symbol.iterator]=function(){return this});class Na{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 Dt="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;n<Dt.length;n++)Dt[n]+=Dt[n-1];function Va(n){for(let e=1;e<Dt.length;e+=2)if(Dt[e]>n)return Dt[e-1]<=n;return!1}function ar(n){return n>=127462&&n<=127487}const cr=8205;function Ae(n,e,t=!0,i=!0){return(t?Ko:Fa)(n,e,i)}function Ko(n,e,t){if(e==n.length)return e;e&&Uo(n.charCodeAt(e))&&jo(n.charCodeAt(e-1))&&e--;let i=re(n,e);for(e+=ve(i);e<n.length;){let s=re(n,e);if(i==cr||s==cr||t&&Va(s))e+=ve(s),i=s;else if(ar(s)){let r=0,o=e-2;for(;o>=0&&ar(re(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Fa(n,e,t){for(;e>0;){let i=Ko(n,e-2,t);if(i<e)return i;e--}return 0}function Uo(n){return n>=56320&&n<57344}function jo(n){return n>=55296&&n<56320}function re(n,e){let t=n.charCodeAt(e);if(!jo(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Uo(i)?(t-55296<<10)+(i-56320)+65536:t}function Rs(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ve(n){return n<65536?1:2}const Kn=/\r\n?|\n/;var me=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(me||(me={}));class We{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){Un(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s
Line truncated
|
||||
`}get readOnly(){return this.facet(tl)}phrase(e,...t){for(let i of this.facet(V.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(Xo))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Xa(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 h=Ae(t,o,!1);if(r(t.slice(h,o))!=ce.Word)break;o=h}for(;l<s;){let h=Ae(t,l);if(r(t.slice(l,h))!=ce.Word)break;l=h}return o==l?null:m.range(o+i,l+i)}}V.allowMultipleSelections=Yo;V.tabSize=T.define({combine:n=>n.length?n[0]:4});V.lineSeparator=_o;V.readOnly=tl;V.phrases=T.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])}});V.languageData=Xo;V.changeFilter=Qo;V.transactionFilter=Zo;V.transactionExtender=el;_e.reconfigure=H.define();function zt(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 pt{eq(e){return this==e}range(e,t=e){return ri.create(e,t,this)}}pt.prototype.startSide=pt.prototype.endSide=0;pt.prototype.point=!1;pt.prototype.mapMode=me.TrackDel;class ri{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ri(e,t,i)}}function Yn(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Es{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 h=o+l>>1,a=r[h]-e||(i?this.value[h].endSide:this.value[h].startSide)-t;if(h==o)return a>=0?o:l;a>=0?l=h:o=h+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let h=0;h<this.value.length;h++){let a=this.value[h],c=this.from[h]+e,f=this.to[h]+e,u,d;if(c==f){let p=t.mapPos(c,a.startSide,a.mapMode);if(p==null||(u=d=p,a.startSide!=a.endSide&&(d=t.mapPos(c,a.endSide),d<u)))continue}else if(u=t.mapPos(c,a.startSide),d=t.mapPos(f,a.endSide),u>d||u==d&&a.startSide>0&&a.endSide<=0)continue;(d-u||a.endSide-a.startSide)<0||(o<0&&(o=u),a.point&&(l=Math.max(l,d-u)),i.push(a),s.push(u-o),r.push(d-o))}return{mapped:i.length?new Es(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(Yn)),this.isEmpty)return t.length?Y.of(t):this;let l=new sl(this,null,-1).goto(0),h=0,a=[],c=new gt;for(;l.value||h<t.length;)if(h<t.length&&(l.from-t[h].from||l.startSide-t[h].value.startSide)>=0){let f=t[h++];c.addInner(f.from,f.to,f.value)||a.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(h==t.length||this.chunkEnd(l.chunkIndex)<t[h].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||a.push(ri.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!a.length?Y.empty:this.nextLayer.update({add:a,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],h=this.chunk[o],a=e.touchesRange(l,l+h.length);if(a===!1)s=Math.max(s,h.maxPoint),t.push(h),i.push(e.mapPos(l));else if(a===!0){let{mapped:c,pos:f}=h.map(l,e);c&&(s=Math.max(s,c.maxPoint),t.push(c),i.push(f))}}let r=this.nextLayer.map(e);return t.length==0?r:new Y(i,t,r||Y.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=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 oi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return oi.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),h=dr(o,l,i),a=new Ut(o,h,r),c=new Ut(l
Line truncated
|
||||
`)}static newName(){let e=yr[mr]||1;return yr[mr]=e+1,Zn+e.toString(36)}static mount(e,t){(e[es]||new _a(e)).mount(Array.isArray(t)?t:[t])}}let bi=null;class _a{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if(bi)return e.adoptedStyleSheets=[bi.sheet].concat(e.adoptedStyleSheets),e[es]=bi;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),bi=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[es]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let h=0;h<o.rules.length;h++)t.insertRule(o.rules[h],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
|
||||
`;this.styleTag.textContent=r}}}var rt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Rt={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},br=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Qa=typeof navigator<"u"&&/Apple Computer/.test(navigator.vendor),Za=typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent),wr=typeof navigator<"u"&&/Mac/.test(navigator.platform),ec=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tc=br&&(wr||+br[1]<57)||Za&≀for(var oe=0;oe<10;oe++)rt[48+oe]=rt[96+oe]=String(oe);for(var oe=1;oe<=24;oe++)rt[oe+111]="F"+oe;for(var oe=65;oe<=90;oe++)rt[oe]=String.fromCharCode(oe+32),Rt[oe]=String.fromCharCode(oe);for(var vn in rt)Rt.hasOwnProperty(vn)||(Rt[vn]=rt[vn]);function ic(n){var e=tc&&(n.ctrlKey||n.altKey||n.metaKey)||(Qa||ec)&&n.shiftKey&&n.key&&n.key.length==1,t=!e&&n.key||(n.shiftKey?Rt:rt)[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 Hi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Pt(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function nc(){let n=document.activeElement;for(;n&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function ts(n,e){if(!e.anchorNode)return!1;try{return Pt(n,e.anchorNode)}catch{return!1}}function li(n){return n.nodeType==3?Lt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Wi(n,e,t,i){return t?xr(n,e,t,i,-1)||xr(n,e,t,i,1):!1}function is(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function xr(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:zi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=is(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?zi(n):0}else return!1}}function zi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const rl={left:0,right:0,top:0,bottom:0};function on(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function sc(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function rc(n,e,t,i,s,r,o,l){let h=n.ownerDocument,a=h.defaultView;for(let c=n;c;)if(c.nodeType==1){let f,u=c==h.body;if(u)f=sc(a);else{if(c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.parentNode;continue}let g=c.getBoundingClientRect();f={left:g.left,right:g.left+c.clientWidth,top:g.top,bottom:g.top+c.clientHeight}}let d=0,p=0;if(s=="nearest")e.top<f.top?(p=-(f.top-e.top+o),t>0&&e.bottom>f.bottom+p&&(p=e.bottom-f.bottom+p+o)):e.bottom>f.bottom&&(p=e.bottom-f.bottom+o,t<0&&e.top-p<f.top&&(p=-(f.top+p-e.top+o)));else{let g=e.bottom-e.top,y=f.bottom-f.top;p=(s=="center"&&g<=y?e.top+g/2-y/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-y+o)-f.top}if(i=="nearest"?e.left<f.left?(d=-(f.left-e.left+r),t>0&&e.right>f.right+d&&(d=e.right-f.right+d+r)):e.right>f.right&&(d=e.right-f.right+r,t<0&&e.left<f.left+d&&(d=-(f.left+d-e.left+r))):d=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==l?e.left-r:e.right-(f.right-f.left)+r)-f.left,d||p)if(u)a.scrollBy(d,p);else{if(p){let g=c.scrollTop;c.scrollTop+=p,p=c.scrollTop-g}if(d){let g=c.scrollLeft;c.scrollLeft+=d,d=c.scrollLeft-g}e={left:e.left-d,top:e.top-p,right:e.right-d,bottom:e.bottom-p}}if(u)break;c=c.assignedSlot||c.parentNode,i=s="nearest"}else if(c.nodeType==11)c=c.host;else break}class oc{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){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let vt=null;function ol(n){if(n.setActive)return n.setActive();if(vt)return n.focus(vt);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(vt==null?{get preventScroll(){return vt={preventScroll:!0},!0}}:void 0),!vt){vt=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.Line truncated
|
||||
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),a=m.cursor(t?s.from:s.to)}if(h){if(!h(c))return l}else{if(!i)return a;h=i(c)}l=a}}function Pc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==ce.Space&&(s=o),s==o}}function Lc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return m.cursor(s,e.assoc);let o=e.goalColumn,l,h=n.contentDOM.getBoundingClientRect(),a=n.coordsAtPos(s),c=n.documentTop;if(a)o==null&&(o=a.left-h.left),l=r<0?a.top:a.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(h.right-h.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+c}let f=h.left+o,u=i!=null?i:n.defaultLineHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Il(n,{x:f,y:p},!1,r);if(p<h.top||p>h.bottom||(r<0?g<s:g>s))return m.cursor(g,e.assoc,void 0,o)}}function Dn(n,e,t){let i=n.state.facet(Dl).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,h)=>{t.from>o&&t.from<l&&(t=e.from>t.from?m.cursor(o,1):m.cursor(l,-1),s=!0)});if(!s)return t}}class Ec{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in ie){let i=ie[t];e.contentDOM.addEventListener(t,s=>{!Vr(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))}),this.registeredEvents.push(t)}M.chrome&&M.chrome_version>=102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,M.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!Vr(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Re(t.state,o)}}return!1}runScrollHandlers(e,t){for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Re(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(M.android&&M.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return M.ios&&(i=Nl.find(s=>s.keyCode==t.keyCode))&&!(t.ctrlKey||t.altKey||t.metaKey)&&!t.synthetic?(this.pendingIOSKey=i,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,ti(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:M.safari&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229||e.type=="compositionend"&&!M.ios}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()}}const Nl=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Vl=[16,17,18,20,91,92,224,225];class Ic{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;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(V.allowMultipleSelections)&&Nc(e,t),this.dragMove=Vc(e,t),this.dragging=Fc(e,t)&&Fs(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.i
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\uFEFF\uFFF9-\uFFFC]`,ws),Bf={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",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Bn=null;function Rf(){var n;if(Bn==null&&typeof document!="undefined"&&document.body){let e=document.body.style;Bn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Bn||!1}const Ii=T.define({combine(n){let e=zt(n,{render:null,specialChars:Tf,addSpecialChars:null});return(e.replaceTabs=!Rf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,ws)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,ws)),e}});function Pf(n={}){return[Ii.of(n),Lf()]}let so=null;function Lf(){return so||(so=ue.fromClass(class{constructor(n){this.view=n,this.decorations=R.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ii)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Of({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=re(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=ui(o.text,l,i-o.from);return R.replace({widget:new Vf((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=R.replace({widget:new Nf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ii);n.startState.facet(Ii)!=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 Ef="\u2022";function If(n){return n>=32?Ef:n==10?"\u2424":String.fromCharCode(9216+n)}class Nf extends xt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=If(this.code),i=e.state.phrase("Control character")+" "+(Bf[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 Vf extends xt{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 Ff extends xt{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}ignoreEvent(){return!1}}function ro(n){return ue.fromClass(class{constructor(e){this.view=e,this.placeholder=R.set([R.widget({widget:new Ff(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?R.none:this.placeholder}},{decorations:e=>e.decorations})}const xs=2e3;function Hf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>xs||t.off>xs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(m.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=Qn(a.text,o,n.tabSize,!0);if(c>-1){let f=Qn(a.text,l,n.tabSize);r.push(m.range(a.from+c,a.from+f))}}}return r}function Wf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function oo(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>xs?-1:s==i.length?Wf(n,e.clientX):ui(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function zf(n,e){let t=oo(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=oo(n,s);if(!l)return i;let h=Hf(n.state,t,l);return h.length?o?m.create(h.concat(i.ranges)):m.create(h):i}}:null}function qf(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?zf(t,i):null)}const Rn="-10000px";class Kf{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){let t=e.state.facet(this.facet),i=t.filter(r=>r);if(t===this.input){for(let r of this.tooltipViews)r.update&&r.update(e);return!1}let s=[]
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\uFEFF\uFFF9-\uFFFC]`,ws),Bf={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",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Bn=null;function Rf(){var n;if(Bn==null&&typeof document<"u"&&document.body){let e=document.body.style;Bn=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Bn||!1}const Ii=T.define({combine(n){let e=zt(n,{render:null,specialChars:Tf,addSpecialChars:null});return(e.replaceTabs=!Rf())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,ws)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,ws)),e}});function Pf(n={}){return[Ii.of(n),Lf()]}let so=null;function Lf(){return so||(so=ue.fromClass(class{constructor(n){this.view=n,this.decorations=R.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ii)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Of({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=re(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,h=ui(o.text,l,i-o.from);return R.replace({widget:new Vf((l-h%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=R.replace({widget:new Nf(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ii);n.startState.facet(Ii)!=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 Ef="\u2022";function If(n){return n>=32?Ef:n==10?"\u2424":String.fromCharCode(9216+n)}class Nf extends xt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=If(this.code),i=e.state.phrase("Control character")+" "+(Bf[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 Vf extends xt{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 Ff extends xt{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}ignoreEvent(){return!1}}function ro(n){return ue.fromClass(class{constructor(e){this.view=e,this.placeholder=R.set([R.widget({widget:new Ff(n),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?R.none:this.placeholder}},{decorations:e=>e.decorations})}const xs=2e3;function Hf(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>xs||t.off>xs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let h=i;h<=s;h++){let a=n.doc.line(h);a.length<=l&&r.push(m.range(a.from+o,a.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let h=i;h<=s;h++){let a=n.doc.line(h),c=Qn(a.text,o,n.tabSize,!0);if(c>-1){let f=Qn(a.text,l,n.tabSize);r.push(m.range(a.from+c,a.from+f))}}}return r}function Wf(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function oo(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>xs?-1:s==i.length?Wf(n,e.clientX):ui(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function zf(n,e){let t=oo(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=oo(n,s);if(!l)return i;let h=Hf(n.state,t,l);return h.length?o?m.create(h.concat(i.ranges)):m.create(h):i}}:null}function qf(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return O.mouseSelectionStyle.of((t,i)=>e(i)?zf(t,i):null)}const Rn="-10000px";class Kf{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){let t=e.state.facet(this.facet),i=t.filter(r=>r);if(t===this.input){for(let r of this.tooltipViews)r.update&&r.update(e);return!1}let s=[];for(let
Line truncated
|
||||
`&&(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;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){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 bh(t,e?e.state.tabSize:4,e?bt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=xh(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.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=_.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Wu,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new _(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new _(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function xh(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Xs=Object.create(null),ci=[we.none],Wu=new zs(ci),yo=[],kh=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"]])kh[n]=vh(Xs,e);class Sh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),kh)}resolve(e){return e?this.table[e]||(this.table[e]=vh(this.extra,e)):0}}const zu=new Sh(Xs);function Fn(n,e){yo.indexOf(n)>-1||(yo.push(n),console.warn(e))}function vh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||k[r];o?typeof o=="function"?t?t=o(t):Fn(r,`Modifier ${r} used at start of tag`):t?Fn(r,`Tag ${r} used as modifier`):t=o:Fn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=we.define({id:ci.length,name:i,props:[lu({[i]:t})]});return ci.push(s),s.id}function qu(n){let e=we.define({id:ci.length,name:"Document",props:[ai.add(()=>n)]});return ci.push(e),e}const Ku=n=>{let e=_s(n.state);return e.line?Uu(n):e.block?Gu(n):!1};function Ys(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 Uu=Ys(Xu,0),ju=Ys(Ch,0),Gu=Ys((n,e)=>Ch(n,e,$u(e)),0);function _s(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Jt=50;function Ju(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Jt,i),o=n.sliceDoc(s,s+Jt),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*Jt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Jt),f=n.sliceDoc(s-Jt,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 $u(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,to:s.to})}return e}function Ch(n,e,t=e.selection.ranges){let i=t.map(r=>_s(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Ju(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;o<s.length;o++)if(l=s[o]){let h=i[o],{open:a,close:c}=l;r.push({from:a.pos-h.open.length,to:a.pos+a.margin},{from:c.pos-c.margin,to:c.pos+h.close.length})}return{changes:r}}return null}function Xu(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,h=1e9;for(let a=r;a<=o;){let c=e.doc.lineAt(a);if(c.from>s&&(r==o||o>c.from)){s=c.from;let f=_s(e,a).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c
Line truncated
|
||||
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new op(this):new rp(this)}getCursor(e,t=0,i=e.length){return this.regexp?Mt(this,e,t,i):At(this,e,t,i)}}class la{constructor(e){this.spec=e}}function At(n,e,t,i){return new Ht(e,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase())}class rp extends la{constructor(e){super(e)}nextMatch(e,t,i){let s=At(this.spec,e,i,e.length).nextOverlapping();return s.done&&(s=At(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=At(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=At(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=At(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Mt(n,e,t,i){return new na(e,n.search,n.caseSensitive?void 0:{ignoreCase:!0},t,i)}class op extends la{nextMatch(e,t,i){let s=Mt(this.spec,e,i,e.length).next();return s.done&&(s=Mt(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=Mt(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.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Mt(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Mt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const fi=H.define(),tr=H.define(),it=ke.define({create(n){return new zn(Ts(n).create(),null)},update(n,e){for(let t of e.effects)t.is(fi)?n=new zn(t.value.create(),n.panel):t.is(tr)&&(n=new zn(n.query,t.value?ir:null));return n},provide:n=>Gi.from(n,e=>e.panel)});class zn{constructor(e,t){this.query=e,this.panel=t}}const lp=R.mark({class:"cm-searchMatch"}),hp=R.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ap=ue.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(it))}update(n){let e=n.state.field(it);(e!=n.startState.field(it)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return R.none;let{view:t}=this,i=new gt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:h}=r[s];for(;s<o-1&&h>r[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state.doc,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?hp:lp)})}return i.finish()}},{decorations:n=>n.decorations});function pi(n){return e=>{let t=e.state.field(it,!1);return t&&t.query.spec.valid?n(e,t):ha(e)}}const en=pi((n,{query:e})=>{let{from:t,to:i}=n.state.selection.main,s=e.nextMatch(n.state.doc,t,i);return!s||s.from==t&&s.to==i?!1:(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:nr(n,s),userEvent:"select.search"}),!0)}),tn=pi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main,r=e.prevMatch(t.doc,i,s);return r?(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:nr(n,r),userEvent:"select.search"}),!0):!1}),cp=pi((n,{query:e})=>{let t=e.matchAll(n.state.doc,1e3);return!t||!t.length?!1:(n.dispatch({selection:m.create(t.map(i=>m.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),fp=({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 Ht(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(m.range(l.value.from,l.value.to))}return e(n.update({selection:m.create(r,o),userEvent:"select.search.matches"})),!0},Po=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.doc,i,i);if(!r)return!1;let o=[],l,h,a=[];if(r.from==i&&r.to==s&&(h=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:h}),r=e.nextMatch(t.doc,r.from,r.to),a.push(O.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-h.length;l={anchor:r.from-c,head:r.to-c},a.push(nr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:a,userEvent:"input.replace"}),!0}),up=pi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state.doc,1e9).map(s=>{let{from:r,to:o}=s;re
Line truncated
|
||||
`);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;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){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 bh(t,e?e.state.tabSize:4,e?bt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=xh(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.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=_.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Wu,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new _(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new _(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function xh(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Xs=Object.create(null),ci=[we.none],Wu=new zs(ci),yo=[],kh=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"]])kh[n]=vh(Xs,e);class Sh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),kh)}resolve(e){return e?this.table[e]||(this.table[e]=vh(this.extra,e)):0}}const zu=new Sh(Xs);function Fn(n,e){yo.indexOf(n)>-1||(yo.push(n),console.warn(e))}function vh(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||k[r];o?typeof o=="function"?t?t=o(t):Fn(r,`Modifier ${r} used at start of tag`):t?Fn(r,`Tag ${r} used as modifier`):t=o:Fn(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=we.define({id:ci.length,name:i,props:[lu({[i]:t})]});return ci.push(s),s.id}function qu(n){let e=we.define({id:ci.length,name:"Document",props:[ai.add(()=>n)]});return ci.push(e),e}const Ku=n=>{let e=_s(n.state);return e.line?Uu(n):e.block?Gu(n):!1};function Ys(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 Uu=Ys(Xu,0),ju=Ys(Ch,0),Gu=Ys((n,e)=>Ch(n,e,$u(e)),0);function _s(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Jt=50;function Ju(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Jt,i),o=n.sliceDoc(s,s+Jt),l=/\s*$/.exec(r)[0].length,h=/^\s*/.exec(o)[0].length,a=r.length-l;if(r.slice(a-e.length,a)==e&&o.slice(h,h+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+h,margin:h&&1}};let c,f;s-i<=2*Jt?c=f=n.sliceDoc(i,s):(c=n.sliceDoc(i,i+Jt),f=n.sliceDoc(s-Jt,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 $u(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,to:s.to})}return e}function Ch(n,e,t=e.selection.ranges){let i=t.map(r=>_s(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>Ju(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;o<s.length;o++)if(l=s[o]){let h=i[o],{open:a,close:c}=l;r.push({from:a.pos-h.open.length,to:a.pos+a.margin},{from:c.pos-c.margin,to:c.pos+h.close.length})}return{changes:r}}return null}function Xu(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,h=1e9;for(let a=r;a<=o;){let c=e.doc.lineAt(a);if(c.from>s&&(r==o||o>c.from)){s=c.from;let f=_s(e,a).line;if(!f)continue;let u=/^\s*/.exec(c.text)[0].length,d=u==c
Line truncated
|
||||
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new op(this):new rp(this)}getCursor(e,t=0,i=e.length){return this.regexp?Mt(this,e,t,i):At(this,e,t,i)}}class la{constructor(e){this.spec=e}}function At(n,e,t,i){return new Ht(e,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase())}class rp extends la{constructor(e){super(e)}nextMatch(e,t,i){let s=At(this.spec,e,i,e.length).nextOverlapping();return s.done&&(s=At(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=At(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=At(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=At(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Mt(n,e,t,i){return new na(e,n.search,n.caseSensitive?void 0:{ignoreCase:!0},t,i)}class op extends la{nextMatch(e,t,i){let s=Mt(this.spec,e,i,e.length).next();return s.done&&(s=Mt(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=Mt(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.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Mt(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Mt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const fi=H.define(),tr=H.define(),it=ke.define({create(n){return new zn(Ts(n).create(),null)},update(n,e){for(let t of e.effects)t.is(fi)?n=new zn(t.value.create(),n.panel):t.is(tr)&&(n=new zn(n.query,t.value?ir:null));return n},provide:n=>Gi.from(n,e=>e.panel)});class zn{constructor(e,t){this.query=e,this.panel=t}}const lp=R.mark({class:"cm-searchMatch"}),hp=R.mark({class:"cm-searchMatch cm-searchMatch-selected"}),ap=ue.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(it))}update(n){let e=n.state.field(it);(e!=n.startState.field(it)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return R.none;let{view:t}=this,i=new gt;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:h}=r[s];for(;s<o-1&&h>r[s+1].from-2*250;)h=r[++s].to;n.highlight(t.state.doc,l,h,(a,c)=>{let f=t.state.selection.ranges.some(u=>u.from==a&&u.to==c);i.add(a,c,f?hp:lp)})}return i.finish()}},{decorations:n=>n.decorations});function pi(n){return e=>{let t=e.state.field(it,!1);return t&&t.query.spec.valid?n(e,t):ha(e)}}const en=pi((n,{query:e})=>{let{from:t,to:i}=n.state.selection.main,s=e.nextMatch(n.state.doc,t,i);return!s||s.from==t&&s.to==i?!1:(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:nr(n,s),userEvent:"select.search"}),!0)}),tn=pi((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main,r=e.prevMatch(t.doc,i,s);return r?(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:nr(n,r),userEvent:"select.search"}),!0):!1}),cp=pi((n,{query:e})=>{let t=e.matchAll(n.state.doc,1e3);return!t||!t.length?!1:(n.dispatch({selection:m.create(t.map(i=>m.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),fp=({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 Ht(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(m.range(l.value.from,l.value.to))}return e(n.update({selection:m.create(r,o),userEvent:"select.search.matches"})),!0},Po=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.doc,i,i);if(!r)return!1;let o=[],l,h,a=[];if(r.from==i&&r.to==s&&(h=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:h}),r=e.nextMatch(t.doc,r.from,r.to),a.push(O.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-h.length;l={anchor:r.from-c,head:r.to-c},a.push(nr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:a,userEvent:"input.replace"}),!0}),up=pi((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state.doc,1e9).map(s=>{let{from:r,to:o}=s;re
Line truncated
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
import{S as E,i as G,s as I,F as K,c as F,m as B,t as H,a as N,d as T,C as M,w as q,e as c,f as u,g as b,h as _,x as O,o as w,q as J,b as k,r as L,u as h,v as Q,j as U,l as V,A as X,p as W,B as Y,D as Z,z as S}from"./index.c9783c65.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&O(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,A,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
|
||||
import{S as E,i as G,s as I,F as K,c as F,m as B,t as H,a as N,d as T,C as M,w as q,e as c,f as u,g as b,h as _,x as O,o as w,q as J,b as k,r as L,u as h,v as Q,j as U,l as V,A as X,p as W,B as Y,D as Z,z as S}from"./index.cb8e511c.js";function y(f){let e,o,s;return{c(){e=q("for "),o=c("strong"),s=q(f[3]),u(o,"class","txt-nowrap")},m(l,t){b(l,e,t),b(l,o,t),_(o,s)},p(l,t){t&8&&O(s,l[3])},d(l){l&&w(e),l&&w(o)}}}function x(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0,t.autofocus=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[0]),t.focus(),p||(d=h(t,"input",f[6]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&1&&t.value!==n[0]&&S(t,n[0])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function ee(f){let e,o,s,l,t,r,p,d;return{c(){e=c("label"),o=q("New password confirm"),l=k(),t=c("input"),u(e,"for",s=f[8]),u(t,"type","password"),u(t,"id",r=f[8]),t.required=!0},m(n,i){b(n,e,i),_(e,o),b(n,l,i),b(n,t,i),S(t,f[1]),p||(d=h(t,"input",f[7]),p=!0)},p(n,i){i&256&&s!==(s=n[8])&&u(e,"for",s),i&256&&r!==(r=n[8])&&u(t,"id",r),i&2&&t.value!==n[1]&&S(t,n[1])},d(n){n&&w(e),n&&w(l),n&&w(t),p=!1,d()}}}function te(f){let e,o,s,l,t,r,p,d,n,i,g,R,C,v,P,A,j,m=f[3]&&y(f);return r=new J({props:{class:"form-field required",name:"password",$$slots:{default:[x,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),d=new J({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[ee,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:f}}}),{c(){e=c("form"),o=c("div"),s=c("h4"),l=q(`Reset your admin password
|
||||
`),m&&m.c(),t=k(),F(r.$$.fragment),p=k(),F(d.$$.fragment),n=k(),i=c("button"),g=c("span"),g.textContent="Set new password",R=k(),C=c("div"),v=c("a"),v.textContent="Back to login",u(s,"class","m-b-xs"),u(o,"class","content txt-center m-b-sm"),u(g,"class","txt"),u(i,"type","submit"),u(i,"class","btn btn-lg btn-block"),i.disabled=f[2],L(i,"btn-loading",f[2]),u(e,"class","m-b-base"),u(v,"href","/login"),u(v,"class","link-hint"),u(C,"class","content txt-center")},m(a,$){b(a,e,$),_(e,o),_(o,s),_(s,l),m&&m.m(s,null),_(e,t),B(r,e,null),_(e,p),B(d,e,null),_(e,n),_(e,i),_(i,g),b(a,R,$),b(a,C,$),_(C,v),P=!0,A||(j=[h(e,"submit",Q(f[4])),U(V.call(null,v))],A=!0)},p(a,$){a[3]?m?m.p(a,$):(m=y(a),m.c(),m.m(s,null)):m&&(m.d(1),m=null);const z={};$&769&&(z.$$scope={dirty:$,ctx:a}),r.$set(z);const D={};$&770&&(D.$$scope={dirty:$,ctx:a}),d.$set(D),(!P||$&4)&&(i.disabled=a[2]),$&4&&L(i,"btn-loading",a[2])},i(a){P||(H(r.$$.fragment,a),H(d.$$.fragment,a),P=!0)},o(a){N(r.$$.fragment,a),N(d.$$.fragment,a),P=!1},d(a){a&&w(e),m&&m.d(),T(r),T(d),a&&w(R),a&&w(C),A=!1,X(j)}}}function se(f){let e,o;return e=new K({props:{$$slots:{default:[te]},$$scope:{ctx:f}}}),{c(){F(e.$$.fragment)},m(s,l){B(e,s,l),o=!0},p(s,[l]){const t={};l&527&&(t.$$scope={dirty:l,ctx:s}),e.$set(t)},i(s){o||(H(e.$$.fragment,s),o=!0)},o(s){N(e.$$.fragment,s),o=!1},d(s){T(e,s)}}}function le(f,e,o){let s,{params:l}=e,t="",r="",p=!1;async function d(){if(!p){o(2,p=!0);try{await W.Admins.confirmPasswordReset(l==null?void 0:l.token,t,r),Y("Successfully set a new admin password."),Z("/")}catch(g){W.errorResponseHandler(g)}o(2,p=!1)}}function n(){t=this.value,o(0,t)}function i(){r=this.value,o(1,r)}return f.$$set=g=>{"params"in g&&o(5,l=g.params)},f.$$.update=()=>{f.$$.dirty&32&&o(3,s=M.getJWTPayload(l==null?void 0:l.token).email||"")},[t,r,p,s,d,l,n,i]}class ae extends E{constructor(e){super(),G(this,e,le,se,I,{params:5})}}export{ae as default};
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
import{S as E,i as M,s as T,F as j,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as z,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as A,v as I,w as h,x as J,y as P,z as R}from"./index.c9783c65.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4>
|
||||
import{S as E,i as M,s as T,F as j,c as H,m as L,t as w,a as y,d as S,b as g,e as _,f as p,g as k,h as d,j as z,l as B,k as N,n as D,o as v,p as C,q as G,r as F,u as A,v as I,w as h,x as J,y as P,z as R}from"./index.cb8e511c.js";function K(c){let e,s,n,l,t,o,f,m,i,a,b,u;return l=new G({props:{class:"form-field required",name:"email",$$slots:{default:[Q,({uniqueId:r})=>({5:r}),({uniqueId:r})=>r?32:0]},$$scope:{ctx:c}}}),{c(){e=_("form"),s=_("div"),s.innerHTML=`<h4 class="m-b-xs">Forgotten admin password</h4>
|
||||
<p>Enter the email associated with your account and we\u2019ll send you a recovery link:</p>`,n=g(),H(l.$$.fragment),t=g(),o=_("button"),f=_("i"),m=g(),i=_("span"),i.textContent="Send recovery link",p(s,"class","content txt-center m-b-sm"),p(f,"class","ri-mail-send-line"),p(i,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-lg btn-block"),o.disabled=c[1],F(o,"btn-loading",c[1]),p(e,"class","m-b-base")},m(r,$){k(r,e,$),d(e,s),d(e,n),L(l,e,null),d(e,t),d(e,o),d(o,f),d(o,m),d(o,i),a=!0,b||(u=A(e,"submit",I(c[3])),b=!0)},p(r,$){const q={};$&97&&(q.$$scope={dirty:$,ctx:r}),l.$set(q),(!a||$&2)&&(o.disabled=r[1]),$&2&&F(o,"btn-loading",r[1])},i(r){a||(w(l.$$.fragment,r),a=!0)},o(r){y(l.$$.fragment,r),a=!1},d(r){r&&v(e),S(l),b=!1,u()}}}function O(c){let e,s,n,l,t,o,f,m,i;return{c(){e=_("div"),s=_("div"),s.innerHTML='<i class="ri-checkbox-circle-line"></i>',n=g(),l=_("div"),t=_("p"),o=h("Check "),f=_("strong"),m=h(c[0]),i=h(" for the recovery link."),p(s,"class","icon"),p(f,"class","txt-nowrap"),p(l,"class","content"),p(e,"class","alert alert-success")},m(a,b){k(a,e,b),d(e,s),d(e,n),d(e,l),d(l,t),d(t,o),d(t,f),d(f,m),d(t,i)},p(a,b){b&1&&J(m,a[0])},i:P,o:P,d(a){a&&v(e)}}}function Q(c){let e,s,n,l,t,o,f,m;return{c(){e=_("label"),s=h("Email"),l=g(),t=_("input"),p(e,"for",n=c[5]),p(t,"type","email"),p(t,"id",o=c[5]),t.required=!0,t.autofocus=!0},m(i,a){k(i,e,a),d(e,s),k(i,l,a),k(i,t,a),R(t,c[0]),t.focus(),f||(m=A(t,"input",c[4]),f=!0)},p(i,a){a&32&&n!==(n=i[5])&&p(e,"for",n),a&32&&o!==(o=i[5])&&p(t,"id",o),a&1&&t.value!==i[0]&&R(t,i[0])},d(i){i&&v(e),i&&v(l),i&&v(t),f=!1,m()}}}function U(c){let e,s,n,l,t,o,f,m;const i=[O,K],a=[];function b(u,r){return u[2]?0:1}return e=b(c),s=a[e]=i[e](c),{c(){s.c(),n=g(),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(u,r){a[e].m(u,r),k(u,n,r),k(u,l,r),d(l,t),o=!0,f||(m=z(B.call(null,t)),f=!0)},p(u,r){let $=e;e=b(u),e===$?a[e].p(u,r):(N(),y(a[$],1,1,()=>{a[$]=null}),D(),s=a[e],s?s.p(u,r):(s=a[e]=i[e](u),s.c()),w(s,1),s.m(n.parentNode,n))},i(u){o||(w(s),o=!0)},o(u){y(s),o=!1},d(u){a[e].d(u),u&&v(n),u&&v(l),f=!1,m()}}}function V(c){let e,s;return e=new j({props:{$$slots:{default:[U]},$$scope:{ctx:c}}}),{c(){H(e.$$.fragment)},m(n,l){L(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){S(e,n)}}}function W(c,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.errorResponseHandler(m)}s(1,l=!1)}}function f(){n=this.value,s(0,n)}return[n,l,t,o,f]}class Y extends E{constructor(e){super(),M(this,e,W,V,T,{})}}export{Y as default};
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{S as J,i as M,s as N,F as R,c as S,m as U,t as $,a as v,d as z,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,w as y,e as m,f as d,h as k,x as B,q as D,b as C,r as H,u as E,v as G,y as h,z as T}from"./index.c9783c65.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&L(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address
|
||||
import{S as J,i as M,s as N,F as R,c as S,m as U,t as $,a as v,d as z,C as W,E as Y,g as _,k as j,n as A,o as b,p as F,w as y,e as m,f as d,h as k,x as B,q as D,b as C,r as H,u as E,v as G,y as h,z as T}from"./index.cb8e511c.js";function I(r){let e,s,t,l,n,o,c,a,i,u,g,q,p=r[3]&&L(r);return o=new D({props:{class:"form-field required",name:"password",$$slots:{default:[O,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:r}}}),{c(){e=m("form"),s=m("div"),t=m("h4"),l=y(`Type your password to confirm changing your email address
|
||||
`),p&&p.c(),n=C(),S(o.$$.fragment),c=C(),a=m("button"),i=m("span"),i.textContent="Confirm new email",d(t,"class","m-b-xs"),d(s,"class","content txt-center m-b-sm"),d(i,"class","txt"),d(a,"type","submit"),d(a,"class","btn btn-lg btn-block"),a.disabled=r[1],H(a,"btn-loading",r[1])},m(f,w){_(f,e,w),k(e,s),k(s,t),k(t,l),p&&p.m(t,null),k(e,n),U(o,e,null),k(e,c),k(e,a),k(a,i),u=!0,g||(q=E(e,"submit",G(r[4])),g=!0)},p(f,w){f[3]?p?p.p(f,w):(p=L(f),p.c(),p.m(t,null)):p&&(p.d(1),p=null);const P={};w&769&&(P.$$scope={dirty:w,ctx:f}),o.$set(P),(!u||w&2)&&(a.disabled=f[1]),w&2&&H(a,"btn-loading",f[1])},i(f){u||($(o.$$.fragment,f),u=!0)},o(f){v(o.$$.fragment,f),u=!1},d(f){f&&b(e),p&&p.d(),z(o),g=!1,q()}}}function K(r){let e,s,t,l,n;return{c(){e=m("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content txt-bold"><p>Email address changed</p>
|
||||
<p>You can now sign in with your new email address.</p></div>`,s=C(),t=m("button"),t.textContent="Close",d(e,"class","alert alert-success"),d(t,"type","button"),d(t,"class","btn btn-secondary btn-block")},m(o,c){_(o,e,c),_(o,s,c),_(o,t,c),l||(n=E(t,"click",r[6]),l=!0)},p:h,i:h,o:h,d(o){o&&b(e),o&&b(s),o&&b(t),l=!1,n()}}}function L(r){let e,s,t;return{c(){e=y("to "),s=m("strong"),t=y(r[3]),d(s,"class","txt-nowrap")},m(l,n){_(l,e,n),_(l,s,n),k(s,t)},p(l,n){n&8&&B(t,l[3])},d(l){l&&b(e),l&&b(s)}}}function O(r){let e,s,t,l,n,o,c,a;return{c(){e=m("label"),s=y("Password"),l=C(),n=m("input"),d(e,"for",t=r[8]),d(n,"type","password"),d(n,"id",o=r[8]),n.required=!0,n.autofocus=!0},m(i,u){_(i,e,u),k(e,s),_(i,l,u),_(i,n,u),T(n,r[0]),n.focus(),c||(a=E(n,"input",r[7]),c=!0)},p(i,u){u&256&&t!==(t=i[8])&&d(e,"for",t),u&256&&o!==(o=i[8])&&d(n,"id",o),u&1&&n.value!==i[0]&&T(n,i[0])},d(i){i&&b(e),i&&b(l),i&&b(n),c=!1,a()}}}function Q(r){let e,s,t,l;const n=[K,I],o=[];function c(a,i){return a[2]?0:1}return e=c(r),s=o[e]=n[e](r),{c(){s.c(),t=Y()},m(a,i){o[e].m(a,i),_(a,t,i),l=!0},p(a,i){let u=e;e=c(a),e===u?o[e].p(a,i):(j(),v(o[u],1,1,()=>{o[u]=null}),A(),s=o[e],s?s.p(a,i):(s=o[e]=n[e](a),s.c()),$(s,1),s.m(t.parentNode,t))},i(a){l||($(s),l=!0)},o(a){v(s),l=!1},d(a){o[e].d(a),a&&b(t)}}}function V(r){let e,s;return e=new R({props:{nobranding:!0,$$slots:{default:[Q]},$$scope:{ctx:r}}}),{c(){S(e.$$.fragment)},m(t,l){U(e,t,l),s=!0},p(t,[l]){const n={};l&527&&(n.$$scope={dirty:l,ctx:t}),e.$set(n)},i(t){s||($(e.$$.fragment,t),s=!0)},o(t){v(e.$$.fragment,t),s=!1},d(t){z(e,t)}}}function X(r,e,s){let t,{params:l}=e,n="",o=!1,c=!1;async function a(){if(!o){s(1,o=!0);try{await F.Users.confirmEmailChange(l==null?void 0:l.token,n),s(2,c=!0)}catch(g){F.errorResponseHandler(g)}s(1,o=!1)}}const i=()=>window.close();function u(){n=this.value,s(0,n)}return r.$$set=g=>{"params"in g&&s(5,l=g.params)},r.$$.update=()=>{r.$$.dirty&32&&s(3,t=W.getJWTPayload(l==null?void 0:l.token).newEmail||"")},[n,o,c,t,a,l,i,u]}class x extends J{constructor(e){super(),M(this,e,X,V,N,{params:5})}}export{x as default};
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{S as W,i as Y,s as j,F as A,c as H,m as N,t as P,a as q,d as S,C as B,E as D,g as _,k as G,n as I,o as m,p as z,w as y,e as b,h as w,x as K,q as E,b as C,f as c,r as J,u as h,v as O,y as F,z as R}from"./index.c9783c65.js";function Q(i){let e,l,t,n,s,o,p,a,r,u,v,g,k,L,d=i[4]&&M(i);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:i}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password
|
||||
import{S as W,i as Y,s as j,F as A,c as H,m as N,t as P,a as q,d as S,C as B,E as D,g as _,k as G,n as I,o as m,p as z,w as y,e as b,h as w,x as K,q as E,b as C,f as c,r as J,u as h,v as O,y as F,z as R}from"./index.cb8e511c.js";function Q(i){let e,l,t,n,s,o,p,a,r,u,v,g,k,L,d=i[4]&&M(i);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:i}}}),a=new E({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Z,({uniqueId:f})=>({10:f}),({uniqueId:f})=>f?1024:0]},$$scope:{ctx:i}}}),{c(){e=b("form"),l=b("div"),t=b("h4"),n=y(`Reset your user password
|
||||
`),d&&d.c(),s=C(),H(o.$$.fragment),p=C(),H(a.$$.fragment),r=C(),u=b("button"),v=b("span"),v.textContent="Set new password",c(t,"class","m-b-xs"),c(l,"class","content txt-center m-b-sm"),c(v,"class","txt"),c(u,"type","submit"),c(u,"class","btn btn-lg btn-block"),u.disabled=i[2],J(u,"btn-loading",i[2])},m(f,$){_(f,e,$),w(e,l),w(l,t),w(t,n),d&&d.m(t,null),w(e,s),N(o,e,null),w(e,p),N(a,e,null),w(e,r),w(e,u),w(u,v),g=!0,k||(L=h(e,"submit",O(i[5])),k=!0)},p(f,$){f[4]?d?d.p(f,$):(d=M(f),d.c(),d.m(t,null)):d&&(d.d(1),d=null);const T={};$&3073&&(T.$$scope={dirty:$,ctx:f}),o.$set(T);const U={};$&3074&&(U.$$scope={dirty:$,ctx:f}),a.$set(U),(!g||$&4)&&(u.disabled=f[2]),$&4&&J(u,"btn-loading",f[2])},i(f){g||(P(o.$$.fragment,f),P(a.$$.fragment,f),g=!0)},o(f){q(o.$$.fragment,f),q(a.$$.fragment,f),g=!1},d(f){f&&m(e),d&&d.d(),S(o),S(a),k=!1,L()}}}function V(i){let e,l,t,n,s;return{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content txt-bold"><p>Password changed</p>
|
||||
<p>You can now sign in with your new password.</p></div>`,l=C(),t=b("button"),t.textContent="Close",c(e,"class","alert alert-success"),c(t,"type","button"),c(t,"class","btn btn-secondary btn-block")},m(o,p){_(o,e,p),_(o,l,p),_(o,t,p),n||(s=h(t,"click",i[7]),n=!0)},p:F,i:F,o:F,d(o){o&&m(e),o&&m(l),o&&m(t),n=!1,s()}}}function M(i){let e,l,t;return{c(){e=y("for "),l=b("strong"),t=y(i[4])},m(n,s){_(n,e,s),_(n,l,s),w(l,t)},p(n,s){s&16&&K(t,n[4])},d(n){n&&m(e),n&&m(l)}}}function X(i){let e,l,t,n,s,o,p,a;return{c(){e=b("label"),l=y("New password"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0,s.autofocus=!0},m(r,u){_(r,e,u),w(e,l),_(r,n,u),_(r,s,u),R(s,i[0]),s.focus(),p||(a=h(s,"input",i[8]),p=!0)},p(r,u){u&1024&&t!==(t=r[10])&&c(e,"for",t),u&1024&&o!==(o=r[10])&&c(s,"id",o),u&1&&s.value!==r[0]&&R(s,r[0])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,a()}}}function Z(i){let e,l,t,n,s,o,p,a;return{c(){e=b("label"),l=y("New password confirm"),n=C(),s=b("input"),c(e,"for",t=i[10]),c(s,"type","password"),c(s,"id",o=i[10]),s.required=!0},m(r,u){_(r,e,u),w(e,l),_(r,n,u),_(r,s,u),R(s,i[1]),p||(a=h(s,"input",i[9]),p=!0)},p(r,u){u&1024&&t!==(t=r[10])&&c(e,"for",t),u&1024&&o!==(o=r[10])&&c(s,"id",o),u&2&&s.value!==r[1]&&R(s,r[1])},d(r){r&&m(e),r&&m(n),r&&m(s),p=!1,a()}}}function x(i){let e,l,t,n;const s=[V,Q],o=[];function p(a,r){return a[3]?0:1}return e=p(i),l=o[e]=s[e](i),{c(){l.c(),t=D()},m(a,r){o[e].m(a,r),_(a,t,r),n=!0},p(a,r){let u=e;e=p(a),e===u?o[e].p(a,r):(G(),q(o[u],1,1,()=>{o[u]=null}),I(),l=o[e],l?l.p(a,r):(l=o[e]=s[e](a),l.c()),P(l,1),l.m(t.parentNode,t))},i(a){n||(P(l),n=!0)},o(a){q(l),n=!1},d(a){o[e].d(a),a&&m(t)}}}function ee(i){let e,l;return e=new A({props:{nobranding:!0,$$slots:{default:[x]},$$scope:{ctx:i}}}),{c(){H(e.$$.fragment)},m(t,n){N(e,t,n),l=!0},p(t,[n]){const s={};n&2079&&(s.$$scope={dirty:n,ctx:t}),e.$set(s)},i(t){l||(P(e.$$.fragment,t),l=!0)},o(t){q(e.$$.fragment,t),l=!1},d(t){S(e,t)}}}function te(i,e,l){let t,{params:n}=e,s="",o="",p=!1,a=!1;async function r(){if(!p){l(2,p=!0);try{await z.Users.confirmPasswordReset(n==null?void 0:n.token,s,o),l(3,a=!0)}catch(k){z.errorResponseHandler(k)}l(2,p=!1)}}const u=()=>window.close();function v(){s=this.value,l(0,s)}function g(){o=this.value,l(1,o)}return i.$$set=k=>{"params"in k&&l(6,n=k.params)},i.$$.update=()=>{i.$$.dirty&64&&l(4,t=B.getJWTPayload(n==null?void 0:n.token).email||"")},[s,o,p,a,t,r,n,u,v,g]}class le extends W{constructor(e){super(),Y(this,e,te,ee,j,{params:6})}}export{le as default};
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.c9783c65.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
|
||||
import{S as k,i as v,s as y,F as w,c as x,m as C,t as g,a as $,d as L,p as H,E as M,g as r,o as a,e as u,b as m,f,u as _,y as p}from"./index.cb8e511c.js";function P(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-error-warning-line"></i></div>
|
||||
<div class="content txt-bold"><p>Invalid or expired verification token.</p></div>`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-danger"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[4]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function S(o){let t,s,e,n,i;return{c(){t=u("div"),t.innerHTML=`<div class="icon"><i class="ri-checkbox-circle-line"></i></div>
|
||||
<div class="content txt-bold"><p>Successfully verified email address.</p></div>`,s=m(),e=u("button"),e.textContent="Close",f(t,"class","alert alert-success"),f(e,"type","button"),f(e,"class","btn btn-secondary btn-block")},m(l,c){r(l,t,c),r(l,s,c),r(l,e,c),n||(i=_(e,"click",o[3]),n=!0)},p,d(l){l&&a(t),l&&a(s),l&&a(e),n=!1,i()}}}function T(o){let t;return{c(){t=u("div"),t.innerHTML='<div class="loader loader-lg"><em>Please wait...</em></div>',f(t,"class","txt-center")},m(s,e){r(s,t,e)},p,d(s){s&&a(t)}}}function F(o){let t;function s(i,l){return i[1]?T:i[0]?S:P}let e=s(o),n=e(o);return{c(){n.c(),t=M()},m(i,l){n.m(i,l),r(i,t,l)},p(i,l){e===(e=s(i))&&n?n.p(i,l):(n.d(1),n=e(i),n&&(n.c(),n.m(t.parentNode,t)))},d(i){n.d(i),i&&a(t)}}}function U(o){let t,s;return t=new w({props:{nobranding:!0,$$slots:{default:[F]},$$scope:{ctx:o}}}),{c(){x(t.$$.fragment)},m(e,n){C(t,e,n),s=!0},p(e,[n]){const i={};n&67&&(i.$$scope={dirty:n,ctx:e}),t.$set(i)},i(e){s||(g(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){L(t,e)}}}function V(o,t,s){let{params:e}=t,n=!1,i=!1;l();async function l(){s(1,i=!0);try{await H.Users.confirmVerification(e==null?void 0:e.token),s(0,n=!0)}catch(d){console.warn(d),s(0,n=!1)}s(1,i=!1)}const c=()=>window.close(),b=()=>window.close();return o.$$set=d=>{"params"in d&&s(2,e=d.params)},[n,i,e,c,b]}class E extends k{constructor(t){super(),v(this,t,V,U,y,{params:2})}}export{E as default};
|
||||
Vendored
-376
@@ -1,376 +0,0 @@
|
||||
const zb=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 r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).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)}};zb();function oe(){}const Wl=n=>n;function ct(n,e){for(const t in e)n[t]=e[t];return n}function qg(n){return n()}function bf(){return Object.create(null)}function lt(n){n.forEach(qg)}function Jn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ar;function ei(n,e){return ar||(ar=document.createElement("a")),ar.href=e,n===ar.href}function Bb(n){return Object.keys(n).length===0}function Vg(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function hn(n,e,t){n.$$.on_destroy.push(Vg(e,t))}function Dn(n,e,t,i){if(n){const s=zg(n,e,t,i);return n[0](s)}}function zg(n,e,t,i){return n[1]&&i?ct(t.ctx.slice(),n[1](i(e))):t.ctx}function An(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=[],r=Math.max(e.dirty.length,s.length);for(let o=0;o<r;o+=1)l[o]=e.dirty[o]|s[o];return l}return e.dirty|s}return e.dirty}function En(n,e,t,i,s,l){if(s){const r=zg(e,t,i,l);n.p(r,s)}}function Pn(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function di(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ut(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function yf(n){return n==null?"":n}function Bg(n,e,t){return n.set(t),e}function Xe(n){return n&&Jn(n.destroy)?n.destroy:oe}const Ug=typeof window!="undefined";let So=Ug?()=>window.performance.now():()=>Date.now(),yu=Ug?n=>requestAnimationFrame(n):oe;const Ns=new Set;function Wg(n){Ns.forEach(e=>{e.c(n)||(Ns.delete(e),e.f())}),Ns.size!==0&&yu(Wg)}function Co(n){let e;return Ns.size===0&&yu(Wg),{promise:new Promise(t=>{Ns.add(e={c:n,f:t})}),abort(){Ns.delete(e)}}}function m(n,e){n.appendChild(e)}function Yg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Ub(n){const e=_("style");return Wb(Yg(n),e),e.sheet}function Wb(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Bn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function H(n){return document.createTextNode(n)}function O(){return H(" ")}function st(){return H("")}function Q(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Wt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Un(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Kg(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ci(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?n[i]=e[i]:p(n,i,e[i])}function Ot(n){return n===""?null:+n}function Yb(n){return Array.from(n.childNodes)}function me(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Ce(n,e){n.value=e==null?"":e}function vf(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ee(n,e,t){n.classList[t?"add":"remove"](e)}function Jg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const Xr=new Map;let Qr=0;function Kb(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Jb(n,e){const t={stylesheet:Ub(e),rules:{}};return Xr.set(n,t),t}function Fl(n,e,t,i,s,l,r,o=0){const a=16.666/i;let u=`{
|
||||
`;for(let b=0;b<=1;b+=a){const v=e+(t-e)*l(b);u+=b*100+`%{${r(v,1-v)}}
|
||||
`}const f=u+`100% {${r(t,1-t)}}
|
||||
}`,c=`__svelte_${Kb(f)}_${o}`,d=Yg(n),{stylesheet:h,rules:g}=Xr.get(d)||Jb(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const y=n.style.animation||"";return n.style.animation=`${y?`${y}, `:""}${c} ${i}ms linear ${s}ms 1 both`,Qr+=1,c}function Il(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(", "),Qr-=s,Qr||Gb())}function Gb(){yu(()=>{Qr||(Xr.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),Xr.clear())})}function Zb(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:r=300,easing:o=Wl,start:a=So()+l,end:u=a+r,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function y(){c&&(g=Fl(n,0,1,r,l,o,c)),l||(h=!0)}function b(){c&&Il(n,g),d=!1}return Co(v=>{if(!h&&v>=a&&(h=!0),h&&v>=u&&(f(1,0),b()),!d)return!1;if(h){const C=v-a,S=0+1*o(C/r);f(S,1-S)}return!0}),y(),f(0,1),b}function xb(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,Gg(n,s)}}function Gg(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 Nl;function Cl(n){Nl=n}function $o(){if(!Nl)throw new Error("Function called outside component initialization");return Nl}function pi(n){$o().$$.on_mount.push(n)}function Xb(n){$o().$$.after_update.push(n)}function Qb(n){$o().$$.on_destroy.push(n)}function _n(){const n=$o();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Jg(e,t,{cancelable:i});return s.slice().forEach(r=>{r.call(n,l)}),!l.defaultPrevented}return!0}}function ft(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bl=[],pe=[],qr=[],Pa=[],Zg=Promise.resolve();let La=!1;function xg(){La||(La=!0,Zg.then(Xg))}function Oi(){return xg(),Zg}function Mt(n){qr.push(n)}function je(n){Pa.push(n)}const Ho=new Set;let ur=0;function Xg(){const n=Nl;do{for(;ur<bl.length;){const e=bl[ur];ur++,Cl(e),e1(e.$$)}for(Cl(null),bl.length=0,ur=0;pe.length;)pe.pop()();for(let e=0;e<qr.length;e+=1){const t=qr[e];Ho.has(t)||(Ho.add(t),t())}qr.length=0}while(bl.length);for(;Pa.length;)Pa.pop()();La=!1,Ho.clear(),Cl(n)}function e1(n){if(n.fragment!==null){n.update(),lt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Mt)}}let il;function vu(){return il||(il=Promise.resolve(),il.then(()=>{il=null})),il}function ds(n,e,t){n.dispatchEvent(Jg(`${e?"intro":"outro"}${t}`))}const Vr=new Set;let ai;function Me(){ai={r:0,c:[],p:ai}}function Oe(){ai.r||lt(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(Vr.delete(n),n.i(e))}function F(n,e,t,i){if(n&&n.o){if(Vr.has(n))return;Vr.add(n),ai.c.push(()=>{Vr.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ku={duration:0};function wu(n,e,t){let i=e(n,t),s=!1,l,r,o=0;function a(){l&&Il(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=Wl,tick:g=oe,css:y}=i||ku;y&&(l=Fl(n,0,1,d,c,h,y,o++)),g(0,1);const b=So()+c,v=b+d;r&&r.abort(),s=!0,Mt(()=>ds(n,!0,"start")),r=Co(C=>{if(s){if(C>=v)return g(1,0),ds(n,!0,"end"),a(),s=!1;if(C>=b){const S=h((C-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,Il(n),Jn(i)?(i=i(),vu().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Qg(n,e,t){let i=e(n,t),s=!0,l;const r=ai;r.r+=1;function o(){const{delay:a=0,duration:u=300,easing:f=Wl,tick:c=oe,css:d}=i||ku;d&&(l=Fl(n,1,0,u,a,f,d));const h=So()+a,g=h+u;Mt(()=>ds(n,!1,"start")),Co(y=>{if(s){if(y>=g)return c(0,1),ds(n,!1,"end"),--r.r||lt(r.c),!1;if(y>=h){const b=f((y-h)/u);c(1-b,b)}}return s})}return Jn(i)?vu().then(()=>{i=i(),o()}):o(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&Il(n,l),s=!1)}}}function at(n,e,t,i){let s=e(n,t),l=i?0:1,r=null,o=null,a=null;function u(){a&&Il(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:y=Wl,tick:b=oe,css:v}=s||ku,C={start:So()+h,b:d};d||(C.group=ai,ai.r+=1),r||o?o=C:(v&&(u(),a=Fl(n,l,d,g,h,y,v)),d&&b(0,1),r=f(C,g),Mt(()=>ds(n,d,"start")),Co(S=>{if(o&&S>o.start&&(r=f(o,g),o=null,ds(n,r.b,"start"),v&&(u(),a=Fl(n,l,r.b,r.duration,0,y,s.css))),r){if(S>=r.end)b(l=r.b,1-l),ds(n,r.b,"end"),o||(r.b?u():--r.group.r||lt(r.group.c)),r=null;else if(S>=r.start){const $=S-r.start;l=r.a+r.d*y($/r.duration),b(l,1-l)}}return!!(r||o)}))}return{run(d){Jn(s)?vu().then(()=>{s=s(),c(d)}):c(d)},end(){u(),r=o=null}}}function fn(n,e){n.d(1),e.delete(n.key)}function Ft(n,e){F(n,1,1,()=>{e.delete(n.key)})}function t1(n,e){n.f(),Ft(n,e)}function rt(n,e,t,i,s,l,r,o,a,u,f,c){let d=n.length,h=
Line truncated
|
||||
`),function(l){if(i=l.indexOf(":"),e=zo.trim(l.substr(0,i)).toLowerCase(),t=zo.trim(l.substr(i+1)),e){if(s[e]&&k1.indexOf(e)>=0)return;s[e]=e==="set-cookie"?(s[e]?s[e]:[]).concat([t]):s[e]?s[e]+", "+t:t}}),s},T1=w1,Bo=a_,D1=function(n){return new Promise(function(e,t){var i=n.data,s=n.headers,l=n.responseType;dr.isFormData(i)&&delete s["Content-Type"];var r=new XMLHttpRequest;if(n.auth){var o=n.auth.username||"",a=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";s.Authorization="Basic "+btoa(o+":"+a)}var u=M1(n.baseURL,n.url);function f(){if(r){var d="getAllResponseHeaders"in r?O1(r.getAllResponseHeaders()):null,h={data:l&&l!=="text"&&l!=="json"?r.response:r.responseText,status:r.status,statusText:r.statusText,headers:d,config:n,request:r};S1(e,t,h),r=null}}if(r.open(n.method.toUpperCase(),$1(u,n.params,n.paramsSerializer),!0),r.timeout=n.timeout,"onloadend"in r?r.onloadend=f:r.onreadystatechange=function(){r&&r.readyState===4&&(r.status!==0||r.responseURL&&r.responseURL.indexOf("file:")===0)&&setTimeout(f)},r.onabort=function(){r&&(t(Bo("Request aborted",n,"ECONNABORTED",r)),r=null)},r.onerror=function(){t(Bo("Network Error",n,null,r)),r=null},r.ontimeout=function(){var d="timeout of "+n.timeout+"ms exceeded";n.timeoutErrorMessage&&(d=n.timeoutErrorMessage),t(Bo(d,n,n.transitional&&n.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",r)),r=null},dr.isStandardBrowserEnv()){var c=(n.withCredentials||T1(u))&&n.xsrfCookieName?C1.read(n.xsrfCookieName):void 0;c&&(s[n.xsrfHeaderName]=c)}"setRequestHeader"in r&&dr.forEach(s,function(d,h){i===void 0&&h.toLowerCase()==="content-type"?delete s[h]:r.setRequestHeader(h,d)}),dr.isUndefined(n.withCredentials)||(r.withCredentials=!!n.withCredentials),l&&l!=="json"&&(r.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&r.addEventListener("progress",n.onDownloadProgress),typeof n.onUploadProgress=="function"&&r.upload&&r.upload.addEventListener("progress",n.onUploadProgress),n.cancelToken&&n.cancelToken.promise.then(function(d){r&&(r.abort(),t(d),r=null)}),i||(i=null),r.send(i)})},tn=In,Ef=function(n,e){m1.forEach(n,function(t,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(n[e]=t,delete n[i])})},A1=o_,E1={"Content-Type":"application/x-www-form-urlencoded"};function Pf(n,e){!tn.isUndefined(n)&&tn.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}var Lf,Ur={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(Lf=D1),Lf),transformRequest:[function(n,e){return Ef(e,"Accept"),Ef(e,"Content-Type"),tn.isFormData(n)||tn.isArrayBuffer(n)||tn.isBuffer(n)||tn.isStream(n)||tn.isFile(n)||tn.isBlob(n)?n:tn.isArrayBufferView(n)?n.buffer:tn.isURLSearchParams(n)?(Pf(e,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):tn.isObject(n)||e&&e["Content-Type"]==="application/json"?(Pf(e,"application/json"),function(t,i,s){if(tn.isString(t))try{return(i||JSON.parse)(t),tn.trim(t)}catch(l){if(l.name!=="SyntaxError")throw l}return(s||JSON.stringify)(t)}(n)):n}],transformResponse:[function(n){var e=this.transitional,t=e&&e.silentJSONParsing,i=e&&e.forcedJSONParsing,s=!t&&this.responseType==="json";if(s||i&&tn.isString(n)&&n.length)try{return JSON.parse(n)}catch(l){if(s)throw l.name==="SyntaxError"?A1(l,this,"E_JSON_PARSE"):l}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300}};Ur.headers={common:{Accept:"application/json, text/plain, */*"}},tn.forEach(["delete","get","head"],function(n){Ur.headers[n]={}}),tn.forEach(["post","put","patch"],function(n){Ur.headers[n]=tn.merge(E1)});var Su=Ur,P1=In,L1=Su,u_=function(n){return!(!n||!n.__CANCEL__)},Ff=In,Uo=function(n,e,t){var i=this||L1;return P1.forEach(t,function(s){n=s.call(i,n,e)}),n},F1=u_,I1=Su;function Wo(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var rn=In,f_=function(n,e){e=e||{};var t={},i=["url","method","data"],s=["headers","auth","proxy","params"],l=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],r=["validateStatus"];function o(c,d){return rn.isPlainObject(c)&&rn.isPlainObject(d)?rn.merge(c,d):rn.isPlainObject(d)?rn.merge({},d):rn.isArray(d)?d.slice():d}function a(c){rn.isUndefined(e[c])?rn.isUndefined(n[c])||(t[c]=o(void 0,n[c])):t[c]=o(n[c],e[c])}rn.forEach(i,function(c){rn.isUndefined(e[c])||(t[c]=o(void 0,e[c]))}),rn.forEach(s,a),rn.forEach(l,function(c){rn.isUndefined(e[c])?rn.isUndefined(n[c])||(t[c]=o(void 0,n[c])):t[c]=o(void 0,e[c])}),rn.forEach(r,function(c){c in e?t[c]=o(n[c],e[c]):
Line truncated
|
||||
`+e.prev+e.base;return t+ri.call(n,","+t)+`
|
||||
`+e.prev}function gr(n,e){var t=Ha(n),i=[];if(t){i.length=n.length;for(var s=0;s<n.length;s++)i[s]=Ii(n,s)?e(n[s],n):""}var l,r=typeof Qo=="function"?Qo(n):[];if(Us){l={};for(var o=0;o<r.length;o++)l["$"+r[o]]=r[o]}for(var a in n)Ii(n,a)&&(t&&String(Number(a))===a&&a<n.length||Us&&l["$"+a]instanceof Symbol||(v_.call(/[^\w$]/,a)?i.push(e(a,n)+": "+e(n[a],n)):i.push(a+": "+e(n[a],n))));if(typeof Qo=="function")for(var u=0;u<r.length;u++)k_.call(n,r[u])&&i.push("["+e(r[u])+"]: "+e(n[r[u]],n));return i}var $_,Au=Mu,xs=function(n,e){var t=b_(n,!!e);return typeof t=="function"&&ly(n,".prototype.")>-1?y_(t):t},by=function n(e,t,i,s){var l=t||{};if(Ii(l,"quoteStyle")&&l.quoteStyle!=="single"&&l.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ii(l,"maxStringLength")&&(typeof l.maxStringLength=="number"?l.maxStringLength<0&&l.maxStringLength!==1/0:l.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var r=!Ii(l,"customInspect")||l.customInspect;if(typeof r!="boolean"&&r!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ii(l,"indent")&&l.indent!==null&&l.indent!==" "&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ii(l,"numericSeparator")&&typeof l.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=l.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return C_(e,l);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var a=String(e);return o?Jf(e,a):a}if(typeof e=="bigint"){var u=String(e)+"n";return o?Jf(e,u):u}var f=l.depth===void 0?5:l.depth;if(i===void 0&&(i=0),i>=f&&f>0&&typeof e=="object")return Ha(e)?"[Array]":"[Object]";var c=function(j,G){var Y;if(j.indent===" ")Y=" ";else{if(!(typeof j.indent=="number"&&j.indent>0))return null;Y=ri.call(Array(j.indent+1)," ")}return{base:Y,prev:ri.call(Array(G+1),Y)}}(l,i);if(s===void 0)s=[];else if(Xf(s,e)>=0)return"[Circular]";function d(j,G,Y){if(G&&(s=hy.call(s)).push(G),Y){var q={depth:l.depth};return Ii(l,"quoteStyle")&&(q.quoteStyle=l.quoteStyle),n(j,q,i+1,s)}return n(j,l,i+1,s)}if(typeof e=="function"&&!xf(e)){var h=function(j){if(j.name)return j.name;var G=dy.call(cy.call(j),/^function\s*([\w$]+)/);return G?G[1]:null}(e),g=gr(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(g.length>0?" { "+ri.call(g,", ")+" }":"")}if(S_(e)){var y=Us?qi.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Ra.call(e);return typeof e!="object"||Us?y:rl(y)}if(function(j){return!j||typeof j!="object"?!1:typeof HTMLElement!="undefined"&&j instanceof HTMLElement?!0:typeof j.nodeName=="string"&&typeof j.getAttribute=="function"}(e)){for(var b="<"+Uf.call(String(e.nodeName)),v=e.attributes||[],C=0;C<v.length;C++)b+=" "+v[C].name+"="+w_(my(v[C].value),"double",l);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+Uf.call(String(e.nodeName))+">"}if(Ha(e)){if(e.length===0)return"[]";var S=gr(e,d);return c&&!function(j){for(var G=0;G<j.length;G++)if(Xf(j[G],`
|
||||
`)>=0)return!1;return!0}(S)?"["+qa(S,c)+"]":"[ "+ri.call(S,", ")+" ]"}if(function(j){return!(Ni(j)!=="[object Error]"||on&&typeof j=="object"&&on in j)}(e)){var $=gr(e,d);return"cause"in Error.prototype||!("cause"in e)||k_.call(e,"cause")?$.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ri.call($,", ")+" }":"{ ["+String(e)+"] "+ri.call(Wf.call("[cause]: "+d(e.cause),$),", ")+" }"}if(typeof e=="object"&&r){if(Zf&&typeof e[Zf]=="function"&&ja)return ja(e,{depth:f-i});if(r!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(function(j){if(!hr||!j||typeof j!="object")return!1;try{hr.call(j);try{mr.call(j)}catch{return!0}return j instanceof Map}catch{}return!1}(e)){var M=[];return oy.call(e,function(j,G){M.push(d(G,e,!0)+" => "+d(j,e))}),Qf("Map",hr.call(e),M,c)}if(function(j){if(!mr||!j||typeof j!="object")return!1;try{mr.call(j);try{hr.call(j)}catch{return!0}return j instanceof Set}catch{}return!1}(e)){var T=[];return ay.call(e,function(j){T.push(d(j,e))}),Qf("Set",mr.call(e),T,c)}if(function(j){if(!sl||!j||typeof j!="object")return!1;try{sl.call(j,sl);try{ll.call(j,ll)}catch{return!0}return j instanceof WeakMap}catch{}return!1}(e))return ea("WeakMap");if(function(j){if(!ll||!j||typeof j!="object")return!1;try{ll.call(j,ll);try{sl.call(j,sl)}catch{return!0}return j instanceof WeakSet}catch{}return!1}(e))return ea("WeakSet");if(function(j){if(!Bf||!j||typeof j!="object")return!1;try{return Bf.call(j),!0}catch{}return!1}(e))return ea("WeakRef");if(function(j){return!(Ni(j)!=="[object Number]"||on&&typeof j=="object"&&on in j)}(e))return rl(d(Number(e)));if(function(j){if(!j||typeof j!="object"||!Xo)return!1;try{return Xo.call(j),!0}catch{}return!1}(e))return rl(d(Xo.call(e)));if(function(j){return!(Ni(j)!=="[object Boolean]"||on&&typeof j=="object"&&on in j)}(e))return rl(uy.call(e));if(function(j){return!(Ni(j)!=="[object String]"||on&&typeof j=="object"&&on in j)}(e))return rl(d(String(e)));if(!function(j){return!(Ni(j)!=="[object Date]"||on&&typeof j=="object"&&on in j)}(e)&&!xf(e)){var E=gr(e,d),D=Kf?Kf(e)===Object.prototype:e instanceof Object||e.constructor===Object,P=e instanceof Object?"":"null prototype",L=!D&&on&&Object(e)===e&&on in e?Du.call(Ni(e),8,-1):P?"Object":"",R=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(L||P?"["+ri.call(Wf.call([],L||[],P||[]),": ")+"] ":"");return E.length===0?R+"{}":c?R+"{"+qa(E,c)+"}":R+"{ "+ri.call(E,", ")+" }"}return String(e)},yy=Au("%TypeError%"),_r=Au("%WeakMap%",!0),br=Au("%Map%",!0),vy=xs("WeakMap.prototype.get",!0),ky=xs("WeakMap.prototype.set",!0),wy=xs("WeakMap.prototype.has",!0),Sy=xs("Map.prototype.get",!0),Cy=xs("Map.prototype.set",!0),$y=xs("Map.prototype.has",!0),ta=function(n,e){for(var t,i=n;(t=i.next)!==null;i=t)if(t.key===e)return i.next=t.next,t.next=n.next,n.next=t,t},My=String.prototype.replace,Oy=/%20/g,ec="RFC3986",Eu={default:ec,formatters:{RFC1738:function(n){return My.call(n,Oy,"+")},RFC3986:function(n){return String(n)}},RFC1738:"RFC1738",RFC3986:ec},Ty=Eu,na=Object.prototype.hasOwnProperty,Xi=Array.isArray,si=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),tc=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},i=0;i<n.length;++i)n[i]!==void 0&&(t[i]=n[i]);return t},M_={arrayToObject:tc,assign:function(n,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},n)},combine:function(n,e){return[].concat(n,e)},compact:function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],i=0;i<e.length;++i)for(var s=e[i],l=s.obj[s.prop],r=Object.keys(l),o=0;o<r.length;++o){var a=r[o],u=l[a];typeof u=="object"&&u!==null&&t.indexOf(u)===-1&&(e.push({obj:l,prop:a}),t.push(u))}return function(f){for(;f.length>1;){var c=f.pop(),d=c.obj[c.prop];if(Xi(d)){for(var h=[],g=0;g<d.length;++g)d[g]!==void 0&&h.push(d[g]);c.obj[c.prop]=h}}}(e),n},decode:function(n,e,t){var i=n.replace(/\+/g," ");if(t==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},encode:function(n,e,t,i,s){if(n.length===0)return n;var l=n;if(typeof n=="symbol"?l=Symbol.prototype.toString.call(n):typeof n!="string"&&(l=String(n)),t==="iso-8859-1")return escape(l).replace(/%u[0-9a-f]{4}/gi,function(u){return"%26%23"+parseInt(u.slice(2),16)+"%3B"});for(var r="",o=0;o<l.length;++o){var a=l.charCodeAt(o);a===45||a===46||a===95||a===126||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122||s===Ty.RFC1738&&(a===40||a===41)?r+=l.charAt(o):a<128?r+=si[a]:a<2048?r+=si[192|a>>6]+si[128|63&a]:a<55296||a>=57344?r+=si[224|a>>12]+si[128|a>>6&63]+si[128|63&a]:(o+=1,a=65536+((1023&a)<<10|1023&l.charCodeAt(o)),r+=si[240|a>>18]+si[128|a>>12&63]+si[128|a>>6&63]+si[128|63&a])}return r},isBuffer:function(n){return!(!n||typeof n!="object")&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},isRegExp:function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},maybeMap:function(n,e){if(Xi(n)){for(var t=[],i=0;i<n.length;
Line truncated
|
||||
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=O(),i=_("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),s&&k(t),s&&k(i)}}}function Kk(n){let e,t,i,s,l,r,o,a,u=!n[0]&&Tc();const f=n[2].default,c=Dn(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=O(),s=_("div"),u&&u.c(),l=O(),c&&c.c(),r=O(),o=_("div"),p(t,"class","flex-fill"),p(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),p(o,"class","flex-fill"),p(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,r),m(e,o),a=!0},p(d,[h]){d[0]?u&&(u.d(1),u=null):u||(u=Tc(),u.c(),u.m(s,l)),c&&c.p&&(!a||h&2)&&En(c,f,d,d[1],a?An(f,d[1],h,null):Pn(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){F(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function Jk(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=r=>{"nobranding"in r&&t(0,l=r.nobranding),"$$scope"in r&&t(1,s=r.$$scope)},[l,s,i]}class I0 extends Pe{constructor(e){super(),Ee(this,e,Jk,Kk,De,{nobranding:0})}}function Dc(n,e,t){const i=n.slice();return i[11]=e[t],i}const Gk=n=>({}),Ac=n=>({uniqueId:n[3]});function Zk(n){let e=(n[11]||oo)+"",t;return{c(){t=H(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||oo)+"")&&me(t,e)},d(i){i&&k(t)}}}function xk(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||oo)+"",t;return{c(){t=H(e)},m(l,r){w(l,t,r)},p(l,r){var o,a;r&4&&e!==(e=(((o=l[11])==null?void 0:o.message)||((a=l[11])==null?void 0:a.code)||oo)+"")&&me(t,e)},d(l){l&&k(t)}}}function Ec(n){let e,t;function i(r,o){return typeof r[11]=="object"?xk:Zk}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=O(),p(e,"class","help-block help-block-error")},m(r,o){w(r,e,o),l.m(e,null),m(e,t)},p(r,o){s===(s=i(r))&&l?l.p(r,o):(l.d(1),l=s(r),l&&(l.c(),l.m(e,t)))},d(r){r&&k(e),l.d()}}}function Xk(n){let e,t,i,s,l;const r=n[7].default,o=Dn(r,n,n[6],Ac);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Ec(Dc(n,a,f));return{c(){e=_("div"),o&&o.c(),t=O();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),ee(e,"error",n[2].length)},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=Q(e,"click",n[8]),s=!0)},p(f,[c]){if(o&&o.p&&(!i||c&64)&&En(o,r,f,f[6],i?An(r,f[6],c,Gk):Pn(f[6]),Ac),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Dc(f,a,d);u[d]?u[d].p(h,c):(u[d]=Ec(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),c&5&&ee(e,"error",f[2].length)},i(f){i||(A(o,f),i=!0)},o(f){F(o,f),i=!1},d(f){f&&k(e),o&&o.d(f),Bn(u,f),n[9](null),s=!1,l()}}}const oo="Invalid value";function Qk(n,e,t){let i;hn(n,ys,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const r="field_"+W.randomString(7);let{name:o=""}=e,{class:a=void 0}=e,u,f=[];function c(){F0(o)}pi(()=>(u.addEventListener("change",c),()=>{u.removeEventListener("change",c)}));function d(g){ft.call(this,n,g)}function h(g){pe[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,o=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,o)))},[a,u,f,r,o,i,l,s,d,h]}class Fe extends Pe{constructor(e){super(),Ee(this,e,Qk,Xk,De,{name:4,class:0})}}function e2(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Email"),s=O(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",r=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),o||(a=Q(l,"input",n[5]),o=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&r!==(r=u[9])&&p(l,"id",r),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function t2(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("Password"),s=O(),l=_("input"),o=O(),a=_("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",r=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[1]),w(c,o,d),w(c,a,d),u||(f=Q(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&r!==(r=c[9])&&p(l,"id",r),d&2&&l.value!==c[1]&&Ce(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function n2(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Password confirm"),s=O(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",r=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[2]),o||(a=Q(l,"input",n[7]),o=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&r!==(r=u[9])&&p(l,"id",r),f&4&&l.value!==u[2]&&Ce(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function i2(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;return s=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[e2,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),r=new Fe({propsLine truncated
|
||||
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ee(f,"btn-disabled",n[3]),ee(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,y){w(g,e,y),m(e,t),m(e,i),V(s,e,null),m(e,l),V(r,e,null),m(e,o),V(a,e,null),m(e,u),m(e,f),c=!0,d||(h=Q(e,"submit",Wt(n[4])),d=!0)},p(g,[y]){const b={};y&1537&&(b.$$scope={dirty:y,ctx:g}),s.$set(b);const v={};y&1538&&(v.$$scope={dirty:y,ctx:g}),r.$set(v);const C={};y&1540&&(C.$$scope={dirty:y,ctx:g}),a.$set(C),y&8&&ee(f,"btn-disabled",g[3]),y&8&&ee(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(r.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){F(s.$$.fragment,g),F(r.$$.fragment,g),F(a.$$.fragment,g),c=!1},d(g){g&&k(e),z(s),z(r),z(a),d=!1,h()}}}function s2(n,e,t){const i=_n();let s="",l="",r="",o=!1;async function a(){if(!o){t(3,o=!0);try{await ke.Admins.create({email:s,password:l,passwordConfirm:r}),await ke.Admins.authViaEmail(s,l),i("submit")}catch(d){ke.errorResponseHandler(d)}t(3,o=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){r=this.value,t(2,r)}return[s,l,r,o,a,u,f,c]}class l2 extends Pe{constructor(e){super(),Ee(this,e,s2,i2,De,{})}}function Pc(n){let e,t;return e=new I0({props:{$$slots:{default:[r2]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(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){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function r2(n){let e,t;return e=new l2({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function o2(n){let e,t,i=n[0]&&Pc(n);return{c(){i&&i.c(),e=st()},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=Pc(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Me(),F(i,1,1,()=>{i=null}),Oe())},i(s){t||(A(i),t=!0)},o(s){F(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function a2(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ke.logout(!1),t(0,i=!0);return}ke.AuthStore.isValid?Zs("/collections"):ke.logout()}return[i,async()=>{t(0,i=!1),await Oi(),window.location.search=""}]}class u2 extends Pe{constructor(e){super(),Ee(this,e,a2,o2,De,{})}}let Qa,ts;const eu="app-tooltip";function Lc(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Bi(){return ts=ts||document.querySelector("."+eu),ts||(ts=document.createElement("div"),ts.classList.add(eu),document.body.appendChild(ts)),ts}function N0(n,e){let t=Bi();if(!t.classList.contains("active")||!(e!=null&&e.text)){tu();return}t.textContent=e.text,t.className=eu+" active",e.class&&t.classList.add(e.class),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),r=0,o=0,a=5;e.position=="left"?(r=l.top+l.height/2-i/2,o=l.left-s-a):e.position=="right"?(r=l.top+l.height/2-i/2,o=l.right+a):e.position=="top"?(r=l.top-i-a,o=l.left+l.width/2-s/2):e.position=="top-left"?(r=l.top-i-a,o=l.left):e.position=="top-right"?(r=l.top-i-a,o=l.right-s):e.position=="bottom-left"?(r=l.top+l.height+a,o=l.left):e.position=="bottom-right"?(r=l.top+l.height+a,o=l.right-s):(r=l.top+l.height+a,o=l.left+l.width/2-s/2),o+s>document.documentElement.clientWidth&&(o=document.documentElement.clientWidth-s),o=o>=0?o:0,r+i>document.documentElement.clientHeight&&(r=document.documentElement.clientHeight-i),r=r>=0?r:0,t.style.top=r+"px",t.style.left=o+"px"}function tu(){clearTimeout(Qa),Bi().classList.remove("active"),Bi().activeNode=void 0}function f2(n,e){Bi().activeNode=n,clearTimeout(Qa),Qa=setTimeout(()=>{Bi().classList.add("active"),N0(n,e)},isNaN(e.delay)?250:e.delay)}function St(n,e){let t=Lc(e);function i(){f2(n,t)}function s(){tu()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&W.isFocusable(n))&&n.addEventListener("click",s),Bi(),{update(l){var r,o;t=Lc(l),(o=(r=Bi())==null?void 0:r.activeNode)!=null&&o.contains(n)&&N0(n,t)},destroy(){var l,r;(r=(l=Bi())==null?void 0:l.activeNode)!=null&&r.contains(n)&&tu(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Eo(n){const e=n-1;return e*e*e+1}function ao(n,{delay:e=0,duration:t=400,easing:i=Wl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ni(n,{delay:e=0,duration:t=400,easing:i=Eo,x:s=0,y:l=0,opacity:r=0}={}){const o=getComputedStyle(n),a=+o.opacity,u=o.transform==="none"?"":o.transform,f=a*(1-r);return{delay:e,duration:t,easing:i,css:(c,d)=>`
|
||||
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
|
||||
opacity: ${a-f*d}`}}function Xt(n,{delay:e=0,duration:t=400,easing:i=Eo}={}){const s=getComputedStyle(n),l=+s.opacity,r=parseFloat(s.height),o=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*r}px;padding-top: ${h*o}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Wn(n,{delay:e=0,duration:t=400,easing:i=Eo,start:s=0,opacity:l=0}={}){const r=getComputedStyle(n),o=+r.opacity,a=r.transform==="none"?"":r.transform,u=1-s,f=o*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
|
||||
transform: ${a} scale(${1-u*d});
|
||||
opacity: ${o-f*d}
|
||||
`}}function c2(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,r){w(l,e,r),n[13](e),Ce(e,n[7]),i||(s=Q(e,"input",n[14]),i=!0)},p(l,r){r&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),r&128&&e.value!==l[7]&&Ce(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function d2(n){let e,t,i,s;function l(a){n[12](a)}var r=n[4];function o(a){let u={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return r&&(e=new r(o(n)),pe.push(()=>Ie(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=st()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(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],je(()=>t=!1)),r!==(r=a[4])){if(e){Me();const c=e;F(c.$$.fragment,1,0,()=>{z(c,1)}),Oe()}r?(e=new r(o(a)),pe.push(()=>Ie(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else r&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&F(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&z(e,a)}}}function Fc(n){let e,t,i,s,l,r,o=n[7]!==n[0]&&Ic();return{c(){o&&o.c(),e=O(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){o&&o.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(r=Q(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?o?u&129&&A(o,1):(o=Ic(),o.c(),A(o,1),o.m(e.parentNode,e)):o&&(Me(),F(o,1,1,()=>{o=null}),Oe())},i(a){s||(A(o),Mt(()=>{i||(i=at(t,ni,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){F(o),i||(i=at(t,ni,{duration:150,x:5},!1)),i.run(0),s=!1},d(a){o&&o.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,r()}}}function Ic(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(Mt(()=>{t||(t=at(e,ni,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=at(e,ni,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function p2(n){let e,t,i,s,l,r,o,a,u,f,c;const d=[d2,c2],h=[];function g(b,v){return b[4]&&!b[5]?0:1}r=g(n),o=h[r]=d[r](n);let y=(n[0].length||n[7].length)&&Fc(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=O(),o.c(),a=O(),y&&y.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,v){w(b,e,v),m(e,t),m(t,i),m(i,s),m(t,l),h[r].m(t,null),m(t,a),y&&y.m(t,null),u=!0,f||(c=[Q(t,"submit",Wt(n[10])),Q(e,"click",Un(n[11]))],f=!0)},p(b,[v]){let C=r;r=g(b),r===C?h[r].p(b,v):(Me(),F(h[C],1,1,()=>{h[C]=null}),Oe(),o=h[r],o?o.p(b,v):(o=h[r]=d[r](b),o.c()),A(o,1),o.m(t,a)),b[0].length||b[7].length?y?(y.p(b,v),v&129&&A(y,1)):(y=Fc(b),y.c(),A(y,1),y.m(t,null)):y&&(Me(),F(y,1,1,()=>{y=null}),Oe())},i(b){u||(A(o),A(y),u=!0)},o(b){F(o),F(y),u=!1},d(b){b&&k(e),h[r].d(),y&&y.d(),f=!1,lt(c)}}}function h2(n,e,t){const i=_n(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:r='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:o=new Fn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function y(){u||f||(t(5,f=!0),t(4,u=(await as(()=>import("./FilterAutocompleteInput.50934e7a.js"),[])).default),t(5,f=!1))}pi(()=>{y()});function b(M){ft.call(this,n,M)}function v(M){d=M,t(7,d),t(0,l)}function C(M){pe[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),g()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,r=M.placeholder),"autocompleteCollection"in M&&t(2,o=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,r,o,a,u,f,c,d,s,h,g,b,v,C,S,$]}class Po extends Pe{constructor(e){super(),Ee(this,e,h2,p2,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function m2(n){let e,t,i,s,l;const r=n[6].default,o=Dn(r,n,n[5],null);return{c(){e=_("th"),o&&o.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),ee(e,"col-sort-disabled",n[3]),ee(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ee(e,"sort-desc",n[0]==="-"+n[2]),ee(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),o&&o.m(e,null),i=!0,s||(l=[Q(e,"click",n[7]),Q(e,"keydown",n[8])],s=!0)},p(a,[u]){o&&o.p&&(!i||u&32)&&En(o,r,a,a[5],i?An(r,a[5],u,null):Pn(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),u&10&&ee(e,"col-sort-disabled",a[3]),u&7&&ee(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&ee(e,"sort-desc",a[0]==="-"+a[2]),u&7&&ee(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(o,a),i=!0)},o(a){F(o,a),i=!1},d(a){a&&k(e),o&&o.d(a),s=!1,lt(l)}}}function g2(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,
Line truncated
|
||||
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function w2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="url",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function S2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="referer",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function C2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="status",p(t,"class",W.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function $2(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Rc(n){let e;function t(l,r){return l[6]?O2:M2}let i=t(n),s=i(n);return{c(){s.c(),e=st()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function M2(n){var o;let e,t,i,s,l,r=((o=n[0])==null?void 0:o.length)&&jc(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),r&&r.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?r?r.p(a,u):(r=jc(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function O2(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function jc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Hc(n){let e;return{c(){e=_("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 qc(n,e){var se,x,Te;let t,i,s,l=((se=e[21].method)==null?void 0:se.toUpperCase())+"",r,o,a,u,f,c=e[21].url+"",d,h,g,y,b,v,C=(e[21].referer||"N/A")+"",S,$,M,T,E,D=e[21].status+"",P,L,R,j,G,Y,q,Z,J,K,ne=(((x=e[21].meta)==null?void 0:x.errorMessage)||((Te=e[21].meta)==null?void 0:Te.errorData))&&Hc();j=new $i({props:{date:e[21].created}});function ce(){return e[16](e[21])}function be(...te){return e[17](e[21],...te)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),r=H(l),a=O(),u=_("td"),f=_("span"),d=H(c),g=O(),ne&&ne.c(),y=O(),b=_("td"),v=_("span"),S=H(C),M=O(),T=_("td"),E=_("span"),P=H(D),L=O(),R=_("td"),B(j.$$.fragment),G=O(),Y=_("td"),Y.innerHTML='<i class="ri-arrow-right-line"></i>',q=O(),p(s,"class",o="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(v,"class","txt txt-ellipsis"),p(v,"title",$=e[21].referer),ee(v,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","label"),ee(E,"label-danger",e[21].status>=400),p(T,"class","col-type-number col-field-status"),p(R,"class","col-type-date col-field-created"),p(Y,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,_e){w(te,t,_e),m(t,i),m(i,s),m(s,r),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ne&&ne.m(u,null),m(t,y),m(t,b),m(b,v),m(v,S),m(t,M),m(t,T),m(T,E),m(E,P),m(t,L),m(t,R),V(j,R,null),m(t,G),m(t,Y),m(t,q),Z=!0,J||(K=[Q(t,"click",ce),Q(t,"keydown",be)],J=!0)},p(te,_e){var ie,ye,He;e=te,(!Z||_e&8)&&l!==(l=((ie=e[21].method)==null?void 0:ie.toUpperCase())+"")&&me(r,l),(!Z||_e&8&&o!==(o="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",o),(!Z||_e&8)&&c!==(c=e[21].url+"")&&me(d,c),(!Z||_e&8&&h!==(h=e[21].url))&&p(f,"title",h),((ye=e[21].meta)==null?void 0:ye.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?ne||(ne=Hc(),ne.c(),ne.m(u,null)):ne&&(ne.d(1),ne=null),(!Z||_e&8)&&C!==(C=(e[21].referer||"N/A")+"")&&me(S,C),(!Z||_e&8&&$!==($=e[21].referer))&&p(v,"title",$),_e&8&&ee(v,"txt-hint",!e[21].referer),(!Z||_e&8)&&D!==(D=e[21].status+"")&&me(P,D),_e&8&&ee(E,"label-danger",e[21].status>=400);const fe={};_e&8&&(fe.date=e[21].created),j.$set(fe)},i(te){Z||(A(j.$$.fragment,te),Z=!0)},o(te){F(j.$$.fragment,te),Z=!1},d(te){te&&k(t),ne&&ne.d(),z(j),J=!1,lt(K)}}}function Vc(n){let e,t,i=n[3].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a&8&&i!==(i=o[3].length+"")&&me(s,i),a&16&&me(r,o[4])},d(o){o&&k(e)}}}function zc(n){let e,t,i,s,l=n[4]-n[3].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[6]),ee(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=Q(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&me(r,l),c&64&&ee(t,"btn-loading",f[6]),c&64&&ee(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function T2(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S,$,M,T,E=[],D=new Map,P,L,R,j;function G(ie){n[11](ie)}let Y={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[k2]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),l=new nn({props:Y}),pe.push(()=>Ie(l,"sort",G));function q(ie){n[12](ie)}let Z={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[w2]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),a=new nn({props:Z}),pe.push(()=>Ie(a,"sort",q));function J(ie){n[13](ie)}let K={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[S2]},$$scope:{ctx:n}};n[1]!==void 0&&(K.sort=n[1]),c=new nn({props:K}),pe.push(()=>Ie(c,"sort",J));function ne(ie){n[14](ie)}let ce={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[C2]},$$scope:{ctx:n}};n[1]!==void 0&&(ce.sort=n[1]),g=new nn({props:ce}),pe.push(()=>Ie(g,"sort",ne));function be(ie){n[15](ie)}let se={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[$2]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),v=new nn({props:se}),pe.push(()=>Ie(v,"sort",be));let x=n[3];const Te=ie=>ie[21].id;for(let ie=0;ie<x.length;ie+=1){let ye=Nc(n,x,ie),He=Te(ye);D.set(He,E[ie]=qc(He,ye))}let te=
Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/const R0=function(){return typeof window=="undefined"?function(n){return n()}:window.requestAnimationFrame}();function j0(n,e,t){const i=t||(r=>Array.prototype.slice.call(r));let s=!1,l=[];return function(...r){l=i(r),s||(s=!0,R0.call(window,()=>{s=!1,n.apply(e,l)}))}}function E2(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const P2=n=>n==="start"?"left":n==="end"?"right":"center",Bc=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function _i(){}const L2=function(){let n=0;return function(){return n++}}();function $t(n){return n===null||typeof n=="undefined"}function Lt(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 pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const qt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function jn(n,e){return qt(n)?n:e}function mt(n,e){return typeof n=="undefined"?e:n}const F2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,H0=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Ct(n,e,t,i){let s,l,r;if(Lt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(pt(n))for(r=Object.keys(n),l=r.length,s=0;s<l;s++)e.call(t,n[r[s]],r[s])}function uo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function fo(n){if(Lt(n))return n.map(fo);if(pt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=fo(n[t[s]]);return e}return n}function q0(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function I2(n,e,t,i){if(!q0(n))return;const s=e[n],l=t[n];pt(s)&&pt(l)?Rl(s,l,i):e[n]=fo(l)}function Rl(n,e,t){const i=Lt(e)?e:[e],s=i.length;if(!pt(n))return n;t=t||{};const l=t.merger||I2;for(let r=0;r<s;++r){if(e=i[r],!pt(e))continue;const o=Object.keys(e);for(let a=0,u=o.length;a<u;++a)l(o[a],n,e,t)}return n}function Tl(n,e){return Rl(n,e,{merger:N2})}function N2(n,e,t){if(!q0(n))return;const i=e[n],s=t[n];pt(i)&&pt(s)?Tl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=fo(s))}const R2="",j2=".";function Uc(n,e){const t=n.indexOf(j2,e);return t===-1?n.length:t}function Wi(n,e){if(e===R2)return n;let t=0,i=Uc(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=Uc(e,t);return n}function Uu(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Yn=n=>typeof n!="undefined",Yi=n=>typeof n=="function",Wc=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function H2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ht=Math.PI,At=2*Ht,q2=At+Ht,co=Number.POSITIVE_INFINITY,V2=Ht/180,jt=Ht/2,cl=Ht/4,Yc=Ht*2/3,Vn=Math.log10,ui=Math.sign;function Kc(n){const e=Math.round(n);n=Dl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Vn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function z2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function jl(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Dl(n,e,t){return Math.abs(n-e)<t}function B2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function V0(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(Ht/180)}function Wu(n){return n*(180/Ht)}function Jc(n){if(!qt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function z0(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Ht&&(l+=At),{angle:l,distance:s}}function nu(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function U2(n,e){return(n-e+q2)%At-Ht}function Mn(n){return(n%At+At)%At}function Hl(n,e,t,i){const s=Mn(n),l=Mn(e),r=Mn(t),o=Mn(l-s),a=Mn(r-s),u=Mn(s-l),f=Mn(s-r);return s===l||s===r||i&&l===r||o>a&&u<f}function un(n,e,t){return Math.max(e,Math.min(t,n))}function W2(n){return un(n,-32768,32767)}function ql(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}const Cr=n=>n===0||n===1,Gc=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*At/t)),Zc=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*At/t)+1,Al={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*jt)+1,easeOutSine:n=>Math.sin(n*jt),easeInOutSine:n=>-.5*(Math.cos(Ht*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1Line truncated
|
||||
* @kurkle/color v0.2.1
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2022 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/function Xl(n){return n+.5|0}const Vi=(n,e,t)=>Math.max(Math.min(n,t),e);function wl(n){return Vi(Xl(n*2.55),0,255)}function Ui(n){return Vi(Xl(n*255),0,255)}function ki(n){return Vi(Xl(n/2.55)/100,0,1)}function xc(n){return Vi(Xl(n*100),0,100)}const Rn={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},iu=[..."0123456789ABCDEF"],Y2=n=>iu[n&15],K2=n=>iu[(n&240)>>4]+iu[n&15],$r=n=>(n&240)>>4===(n&15),J2=n=>$r(n.r)&&$r(n.g)&&$r(n.b)&&$r(n.a);function G2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Rn[n[1]]*17,g:255&Rn[n[2]]*17,b:255&Rn[n[3]]*17,a:e===5?Rn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Rn[n[1]]<<4|Rn[n[2]],g:Rn[n[3]]<<4|Rn[n[4]],b:Rn[n[5]]<<4|Rn[n[6]],a:e===9?Rn[n[7]]<<4|Rn[n[8]]:255})),t}const Z2=(n,e)=>n<255?e(n):"";function x2(n){var e=J2(n)?Y2:K2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Z2(n.a,e):void 0}const X2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function B0(n,e,t){const i=e*Math.min(t,1-t),s=(l,r=(l+n/30)%12)=>t-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Q2(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 ew(n,e,t){const i=B0(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 tw(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Yu(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),r=Math.min(t,i,s),o=(l+r)/2;let a,u,f;return l!==r&&(f=l-r,u=o>.5?f/(2-l-r):f/(l+r),a=tw(t,i,s,f,l),a=a*60+.5),[a|0,u||0,o]}function Ku(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ui)}function Ju(n,e,t){return Ku(B0,n,e,t)}function nw(n,e,t){return Ku(ew,n,e,t)}function iw(n,e,t){return Ku(Q2,n,e,t)}function U0(n){return(n%360+360)%360}function sw(n){const e=X2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?wl(+e[5]):Ui(+e[5]));const s=U0(+e[2]),l=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?i=nw(s,l,r):e[1]==="hsv"?i=iw(s,l,r):i=Ju(s,l,r),{r:i[0],g:i[1],b:i[2],a:t}}function lw(n,e){var t=Yu(n);t[0]=U0(t[0]+e),t=Ju(t),n.r=t[0],n.g=t[1],n.b=t[2]}function rw(n){if(!n)return;const e=Yu(n),t=e[0],i=xc(e[1]),s=xc(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ki(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Xc={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"},Qc={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 ow(){const n={},e=Object.keys(Qc),t=Object.keys(Xc);let i,s,l,r,o;for(i=0;i<e.length;i++){for(r=o=e[i],s=0;s<t.length;s++)l=t[s]Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/class cS{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],r=t.duration;l.forEach(o=>o({chart:e,initial:t.initial,numSteps:r,currentStep:Math.min(i-t.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=R0.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 r=l.length-1,o=!1,a;for(;r>=0;--r)a=l[r],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),o=!0):(l[r]=l[l.length-1],l.pop());o&&(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 bi=new cS;const dd="transparent",dS={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=td(n||dd),s=i.valid&&td(e||dd);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class pS{constructor(e,t,i,s){const l=t[i];s=Tr([e.to,s,l,e.from]);const r=Tr([e.from,l,s]);this._active=!0,this._fn=e.fn||dS[e.type||typeof r],this._easing=Al[e.easing]||Al.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=r,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,r=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Tr([e.to,t,s,e.from]),this._from=Tr([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,r=this._loop,o=this._to;let a;if(this._active=l!==o&&(r||t<i),!this._active){this._target[s]=o,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=r&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,o,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;s<i.length;s++)i[s][t]()}}const hS=["x","y","borderWidth","radius","tension"],mS=["color","borderColor","backgroundColor"];gt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const gS=Object.keys(gt.animation);gt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});gt.set("animations",{colors:{type:"color",properties:mS},numbers:{type:"number",properties:hS}});gt.describe("animations",{_fallback:"animation"});gt.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 ob{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!pt(s))return;const l={};for(const r of gS)l[r]=s[r];(Lt(s.properties)&&s.properties||[i]).forEach(r=>{(r===i||!t.has(r))&&t.set(r,l)})})}_animateOptions(e,t){const i=t.options,s=bS(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&_S(e.options.$animations,i).then(()=>{e.options=i},()=>{}),l}_createAnimations(e,t){const i=this._properties,s=[],l=e.$animations||(e.$animations={}),r=Object.keys(t),o=Date.now();let a;for(a=r.length-1;a>=0;--a){const u=r[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,o);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}l[u]=c=new pS(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 bi.add(this._chart,i),!0}}function _S(n,e){const t=[]Line truncated
|
||||
`)>-1?n.split(`
|
||||
`):n}function FC(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:r,value:o}=l.getLabelAndValue(s);return{chart:n,label:r,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function zd(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:r,boxHeight:o}=e,a=Tn(e.bodyFont),u=Tn(e.titleFont),f=Tn(e.footerFont),c=l.length,d=s.length,h=i.length,g=Kn(e.padding);let y=g.height,b=0,v=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,c&&(y+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),v){const $=e.displayColors?Math.max(o,a.lineHeight):a.lineHeight;y+=h*$+(v-h)*a.lineHeight+(v-1)*e.bodySpacing}d&&(y+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const S=function($){b=Math.max(b,t.measureText($).width+C)};return t.save(),t.font=u.string,Ct(n.title,S),t.font=a.string,Ct(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?r+2+e.boxPadding:0,Ct(i,$=>{Ct($.before,S),Ct($.lines,S),Ct($.after,S)}),C=0,t.font=f.string,Ct(n.footer,S),t.restore(),b+=g.width,{width:b,height:y}}function IC(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function NC(n,e,t,i){const{x:s,width:l}=i,r=t.caretSize+t.caretPadding;if(n==="left"&&s+l+r>e.width||n==="right"&&s-l-r<0)return!0}function RC(n,e,t,i){const{x:s,width:l}=t,{width:r,chartArea:{left:o,right:a}}=n;let u="center";return i==="center"?u=s<=(o+a)/2?"left":"right":s<=l/2?u="left":s>=r-l/2&&(u="right"),NC(u,n,e,t)&&(u="center"),u}function Bd(n,e,t){const i=t.yAlign||e.yAlign||IC(n,t);return{xAlign:t.xAlign||e.xAlign||RC(n,e,t,i),yAlign:i}}function jC(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function HC(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Ud(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:r}=n,{xAlign:o,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=qs(r);let g=jC(e,o);const y=HC(e,a,u);return a==="center"?o==="left"?g+=u:o==="right"&&(g-=u):o==="left"?g-=Math.max(f,d)+s:o==="right"&&(g+=Math.max(c,h)+s),{x:un(g,0,i.width-e.width),y:un(y,0,i.height-e.height)}}function Ir(n,e,t){const i=Kn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Wd(n){return li([],yi(n))}function qC(n,e,t){return Ji(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Yd(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class du extends Di{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 ob(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=qC(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]),r=i.afterTitle.apply(this,[e]);let o=[];return o=li(o,yi(s)),o=li(o,yi(l)),o=li(o,yi(r)),o}getBeforeBody(e,t){return Wd(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Ct(e,l=>{const r={before:[],lines:[],after:[]},o=Yd(i,l);li(r.before,yi(o.beforeLabel.call(this,l))),li(r.lines,o.label.call(this,l)),li(r.after,yi(o.afterLabel.call(this,l))),s.push(r)}),s}getAfterBody(e,t){return Wd(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]),r=i.afterFooter.apply(this,[e]);let o=[];return o=li(o,yi(s)),o=li(o,yi(l)),o=li(o,yi(r)),o}_createItems(e){const t=this._active,i=this.chart.data,s=[],l=[],r=[];let o=[],a,u;for(a=0,u=t.length;a<u;++a)o.push(FC(this.chart,t[a]));return e.filter&&(o=o.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(o=o.sort((f,c)=>e.itemSort(f,c,i))),Ct(o,f=>{const c=Yd(e.callbacks,f);s.push(c.labelColor.call(this,f)),l.push(c.labelPointStyle.call(this,f)),r.push(c.labelTextColor.call(this,f))}),this.labelColors=s,this.labelPointStyles=l,this.labelTextColors=r,this.dataPoints=o,o}update(e,t){const i=this.options.setContext(this.getContext()),s=this._active;l
Line truncated
|
||||
* chartjs-adapter-luxon v1.1.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2021 chartjs-adapter-luxon Contributors
|
||||
* Released under the MIT license
|
||||
*/const o$={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};cb._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},formats:function(){return o$},parse:function(n,e){const t=this.options;if(n===null||typeof n=="undefined")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):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 ep(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Mt(()=>{t||(t=at(e,Wn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=at(e,Wn,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function a$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=H(n[1]),t=O(),s=H(i)},m(l,r){w(l,e,r),w(l,t,r),w(l,s,r)},p(l,r){r&2&&me(e,l[1]),r&2&&i!==(i=l[1]===1?"log":"logs")&&me(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function u$(n){let e;return{c(){e=H("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function f$(n){let e,t,i,s,l,r,o=n[2]&&ep();function a(c,d){return c[2]?u$:a$}let u=a(n),f=u(n);return{c(){e=_("div"),o&&o.c(),t=O(),i=_("canvas"),s=O(),l=_("div"),f.c(),p(i,"class","chart-canvas svelte-vh4sl8"),vf(i,"height","250px"),vf(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ee(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),r=!0},p(c,[d]){c[2]?o?d&4&&A(o,1):(o=ep(),o.c(),A(o,1),o.m(e,t)):o&&(Me(),F(o,1,1,()=>{o=null}),Oe()),d&4&&ee(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){r||(A(o),r=!0)},o(c){F(o),r=!1},d(c){c&&k(e),o&&o.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function c$(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,r,o=[],a=0,u=!1;async function f(){return t(2,u=!0),ke.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)o.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);o.push({x:new Date,y:void 0})}).catch(h=>{h!==null&&(c(),console.warn(h),ke.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,o=[])}pi(()=>(vo.register(Gi,Io,tr,df,ir,LC,VC),t(6,r=new vo(l,{type:"line",data:{datasets:[{label:"Total requests",data:o,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,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}}}})),()=>r==null?void 0:r.destroy()));function d(h){pe[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!="undefined"||typeof s!="undefined")&&f(),n.$$.dirty&192&&typeof o!="undefined"&&r&&(t(6,r.data.datasets[0].data=o,r),r.update())},[l,a,u,i,s,f,r,o,d]}class d$ extends Pe{constructor(e){super(),Ee(this,e,c$,f$,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var tp=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},Pb={exports:{}};(function(n){var e=typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope?self:{};/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
*
|
||||
* @license MIT <https://opensource.org/licenses/MIT>
|
||||
* @author Lea Verou <https://lea.verou.me>
|
||||
* @namespace
|
||||
* @public
|
||||
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,r={},o={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C(S){return S instanceof a?new a(S.type,C(S.content),S.alias):Array.isArray(S)?S.map(C):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++l}),C.__id},clone:function C(S,$){$=$||{};var M,T;switch(o.util.type(S)){case"Object":if(T=o.util.objId(S),$[T])return $[T];M={},$[T]=M;for(var E in S)S.hasOwnProperty(E)&&(M[E]=C(S[E],$));return M;case"Array":return T=o.util.objId(S),$[T]?$[T]:(M=[],$[T]=M,S.forEach(function(D,P){M[P]=C(D,$)}),M);default:return S}},getLanguage:function(C){for(;C;){var S=s.exec(C.className);if(S)return S[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,S){C.className=C.className.replace(RegExp(s,"gi"),""),C.classList.add("language-"+S)},currentScript:function(){if(typeof document=="undefined")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(C){var S=document.getElementsByTagName("script");for(var $ in S)if(S[$].src==C)return S[$]}return null}},isActive:function(C,S,$){for(var M="no-"+S;C;){var T=C.classList;if(T.contains(S))return!0;if(T.contains(M))return!1;C=C.parentElement}return!!$}},languages:{plain:r,plaintext:r,text:r,txt:r,extend:function(C,S){var $=o.util.clone(o.languages[C]);for(var M in S)$[M]=S[M];return $},insertBefore:function(C,S,$,M){M=M||o.languages;var T=M[C],E={};for(var D in T)if(T.hasOwnProperty(D)){if(D==S)for(var P in $)$.hasOwnProperty(P)&&(E[P]=$[P]);$.hasOwnProperty(D)||(E[D]=T[D])}var L=M[C];return M[C]=E,o.languages.DFS(o.languages,function(R,j){j===L&&R!=C&&(this[R]=E)}),E},DFS:function C(S,$,M,T){T=T||{};var E=o.util.objId;for(var D in S)if(S.hasOwnProperty(D)){$.call(S,D,S[D],M||D);var P=S[D],L=o.util.type(P);L==="Object"&&!T[E(P)]?(T[E(P)]=!0,C(P,$,null,T)):L==="Array"&&!T[E(P)]&&(T[E(P)]=!0,C(P,$,D,T))}}},plugins:{},highlightAll:function(C,S){o.highlightAllUnder(document,C,S)},highlightAllUnder:function(C,S,$){var M={callback:$,container:C,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};o.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),o.hooks.run("before-all-elements-highlight",M);for(var T=0,E;E=M.elements[T++];)o.highlightElement(E,S===!0,M.callback)},highlightElement:function(C,S,$){var M=o.util.getLanguage(C),T=o.languages[M];o.util.setLanguage(C,M);var E=C.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&o.util.setLanguage(E,M);var D=C.textContent,P={element:C,language:M,grammar:T,code:D};function L(j){P.highlightedCode=j,o.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,o.hooks.run("after-highlight",P),o.hooks.run("complete",P),$&&$.call(P.element)}if(o.hooks.run("before-sanity-check",P),E=P.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!P.code){o.hooks.run("complete",P),$&&$.call(P.element);return}if(o.hooks.run("before-highlight",P),!P.grammar){L(o.util.encode(P.code));return}if(S&&i.Worker){var R=new Worker(o.filename);R.onmessage=function(j){L(j.data)},R.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else L(o.highlight(P.code,P.grammar,P.language))},highlight:function(C,S,$){var M={code:C,grammar:S,language:$};if(o.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=o.tokenize(M.code,M.grammar),o.hooks.run("after-tokenize",M),a.stringify(o.util.encode(M.tokens),M.language)},tokenize:function(C,S){var $=S.rest;if($){for(var M in $)S[M]=$[M];delete S.rest}var T=new c;return d(T,T.head,C),f(C,T,S,T.head,0),g(T)},hooks:{all:{},add:function(C,S){var $=o.hooks.all;$[C]=$[C]||[],$[C].push(S)},run:function(C,S){var $=o.hooks.all[C];if(!(!$||!$.length))for(var M=0,T;T=$[M++];)T(S)}},Token:a};i.Prism=o;function a(C,S,$,M){this.type=C,this.content=S,this.alias=$,this.length=(M||"").length|0}a.stringify=function C(S,$){if(typeof S=="string")return S;if(Array.isArray(S)){var M="";return S.forEach(function(L){M+=C(L,$)}),M}var T={type:S.type,content:C(S.content,$),tag:"span",classes:["token",S.type],attributes:{},language:$},E=S.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(T.classes,E):T.classes.push(E)),o.hooks.run("wrap",T);var D="";for(var P in T.attributes)D+=" "+P+'="'+(T.attributes[P]||"").replace(/"/g,""")+'"';return"<"+T.tag+' class="'+T.classes.join(" ")+'"'+D+">"+T.content+"</"+T.tag+">"};function u(C,S,$,M){C.lastIndex=S;var T=C.exec($);if(T&&M&&T[1]){var E=T[1].length;T.index+=E,T[0]=T[0].slice(E)}retLine truncated
|
||||
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(P+1))}v.textContent=T,t.highlightElement(v)},function(T){b.setAttribute(o,f),v.textContent=T})}}),t.plugins.fileHighlight={highlight:function(b){for(var v=(b||document).querySelectorAll(c),C=0,S;S=v[C++];)t.highlightElement(S)}};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)}}()})(Pb);var _l=Pb.exports,p$={exports:{}};(function(n){(function(){if(typeof Prism=="undefined")return;var e=Object.assign||function(l,r){for(var o in r)r.hasOwnProperty(o)&&(l[o]=r[o]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(r,o){return o.toUpperCase()})}function s(l){for(var r=0,o=0;o<l.length;++o)l.charCodeAt(o)==" ".charCodeAt(0)&&(r+=3);return l.length+r}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,r){r=e(this.defaults,r);for(var o in r){var a=i(o);o!=="normalize"&&a!=="setDefaults"&&r[o]&&this[a]&&(l=this[a].call(this,l,r[o]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,r){return r=r|0||4,l.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(l,r){return r=r|0||4,l.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var r=l.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(o,a){return o.length-a.length}),!r[0].length)?l:l.replace(RegExp("^"+r[0],"gm"),"")},indent:function(l,r){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(l,r){r=r===!0?80:r|0||80;for(var o=l.split(`
|
||||
`),a=0;a<o.length;++a)if(!(s(o[a])<=r)){for(var u=o[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>r&&(u[c]=`
|
||||
`+u[c],f=d)}o[a]=u.join("")}return o.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(l){var r=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=r.normalize(l.code,l.settings);return}var o=l.element.parentNode;if(!(!l.code||!o||o.nodeName.toLowerCase()!=="pre")){for(var a=o.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var h=a[d];h==l.element?c=!0:h.nodeName==="#text"&&(c?f+=h.nodeValue:u+=h.nodeValue,o.removeChild(h),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=r.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=r.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(p$);function h$(n){let e,t;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-tv7jme"),p(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:oe,o:oe,d(i){i&&k(e)}}}function m$(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function r(o){return o=typeof o=="string"?o:"",o=_l.plugins.NormalizeWhitespace.normalize(o,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),_l.highlight(o,_l.languages[s]||_l.languages.javascript,s)}return n.$$set=o=>{"content"in o&&t(1,i=o.content),"language"in o&&t(2,s=o.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof _l!="undefined"&&i&&t(0,l=r(i))},[l,i,s]}class sn extends Pe{constructor(e){super(),Ee(this,e,m$,h$,De,{content:1,language:2})}}const g$=n=>({}),np=n=>({}),_$=n=>({}),ip=n=>({});function sp(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S=n[4]&&!n[2]&&lp(n);const $=n[18].header,M=Dn($,n,n[17],ip);let T=n[4]&&n[2]&&rp(n);const E=n[18].default,D=Dn(E,n,n[17],null),P=n[18].footer,L=Dn(P,n,n[17],np);return{c(){e=_("div"),t=_("div"),s=O(),l=_("div"),r=_("div"),S&&S.c(),o=O(),M&&M.c(),a=O(),T&&T.c(),u=O(),f=_("div"),D&&D.c(),c=O(),d=_("div"),L&&L.c(),p(t,"class","overlay"),p(r,"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]),ee(l,"popup",n[2]),p(e,"class","overlay-panel-container"),ee(e,"padded",n[2]),ee(e,"active",n[0])},m(R,j){w(R,e,j),m(e,t),m(e,s),m(e,l),m(l,r),S&&S.m(r,null),m(r,o),M&&M.m(r,null),m(r,a),T&&T.m(r,null),m(l,u),m(l,f),D&&D.m(f,null),n[20](f),m(l,c),m(l,d),L&&L.m(d,null),b=!0,v||(C=[Q(t,"click",Wt(n[19])),Q(f,"scroll",n[21])],v=!0)},p(R,j){n=R,n[4]&&!n[2]?S?S.p(n,j):(S=lp(n),S.c(),S.m(r,o)):S&&(S.d(1),S=null),M&&M.p&&(!b||j&131072)&&En(M,$,n,n[17],b?An($,n[17],j,_$):Pn(n[17]),ip),n[4]&&n[2]?T?T.p(n,j):(T=rp(n),T.c(),T.m(r,null)):T&&(T.d(1),T=null),D&&D.p&&(!b||j&131072)&&En(D,E,n,n[17],b?An(E,n[17],j,null):Pn(n[17]),null),L&&L.p&&(!b||j&131072)&&En(L,P,n,n[17],b?An(P,n[17],j,g$):Pn(n[17]),np),(!b||j&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),j&262&&ee(l,"popup",n[2]),j&4&&ee(e,"padded",n[2]),j&1&&ee(e,"active",n[0])},i(R){b||(Mt(()=>{i||(i=at(t,ao,{duration:Ls,opacity:0},!0)),i.run(1)}),A(M,R),A(D,R),A(L,R),Mt(()=>{y&&y.end(1),g=wu(l,ni,n[2]?{duration:Ls,y:-10}:{duration:Ls,x:50}),g.start()}),b=!0)},o(R){i||(i=at(t,ao,{duration:Ls,opacity:0},!1)),i.run(0),F(M,R),F(D,R),F(L,R),g&&g.invalidate(),y=Qg(l,ni,n[2]?{duration:Ls,y:10}:{duration:Ls,x:50}),b=!1},d(R){R&&k(e),R&&i&&i.end(),S&&S.d(),M&&M.d(R),T&&T.d(),D&&D.d(R),n[20](null),L&&L.d(R),R&&y&&y.end(),v=!1,lt(C)}}}function lp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=Q(e,"click",Wt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function rp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=Q(e,"click",Wt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function b$(n){let e,t,i,s,l=n[0]&&sp(n);return{c(){e=_("div"),l&&l.c(),p(e,"class","overlay-panel-wrapper")},m(r,o){w(r,e,o),l&&l.m(e,null),n[22](e),t=!0,i||(s=[Q(window,"resize",n[10]),Q(window,"keydown",n[9])],i=!0)},p(r,[o]){r[0]?l?(l.p(r,o),o&1&&A(l,1)):(l=sp(r),l.c(),A(l,1),l.m(e,null)):l&&(Me(),F(l,1,1,()=>{l=null}),Oe())},i(r){t||(A(l),t=!0)},o(r){F(l),t=!1},d(r){r&&k(e),l&&l.d(),n[22](null),i=!1,lt(s)}}}let ss;function Lb(){return ss=ss||document.querySelector(".overlays"),ss||(ss=document.createElement("div"),ss.classList.add("overlays"),document.body.appendChild(ss)),ss}let Ls=150;function op(){return 1e3+Lb().querySelectorAll(".overlay-panel-container.active").length}function y$(n,e,t){let{$$slots:i={},$$scope:s}=e,{class:l=""}=e,{active:r=!1}=e,{popup:o=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void
Line truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&16&&l!==(l=b[4]))&&p(e,"for",l);const C={};v&16&&(C.id=b[4]),v&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&v&1&&(a=!0,C.value=b[0].exceptDomains,je(()=>a=!1)),o.$set(C)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function S4(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[3](b)}let y={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(y.value=n[0].onlyDomains),o=new Ss({props:y}),pe.push(()=>Ie(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:`Domains that are ONLY allowed as value.
|
||||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,v){(!c||v&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const C={};v&16&&(C.id=b[4]+".options.onlyDomains"),v&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&v&1&&(a=!0,C.value=b[0].onlyDomains,je(()=>a=!1)),o.$set(C)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function C4(n){let e,t,i,s,l,r,o;return i=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[w4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[S4,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),o=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),r.$set(c)},i(a){o||(A(i.$$.fragment,a),A(r.$$.fragment,a),o=!0)},o(a){F(i.$$.fragment,a),F(r.$$.fragment,a),o=!1},d(a){a&&k(e),z(i),z(r)}}}function $4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(o){n.$$.not_equal(s.exceptDomains,o)&&(s.exceptDomains=o,t(0,s))}function r(o){n.$$.not_equal(s.onlyDomains,o)&&(s.onlyDomains=o,t(0,s))}return n.$$set=o=>{"key"in o&&t(1,i=o.key),"options"in o&&t(0,s=o.options)},[s,i,l,r]}class Nb extends Pe{constructor(e){super(),Ee(this,e,$4,C4,De,{key:1,options:0})}}function M4(n){let e,t,i,s;function l(a){n[2](a)}function r(a){n[3](a)}let o={};return n[0]!==void 0&&(o.key=n[0]),n[1]!==void 0&&(o.options=n[1]),e=new Nb({props:o}),pe.push(()=>Ie(e,"key",l)),pe.push(()=>Ie(e,"options",r)),{c(){B(e.$$.fragment)},m(a,u){V(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],je(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],je(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){F(e.$$.fragment,a),s=!1},d(a){z(e,a)}}}function O4(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(o){i=o,t(0,i)}function r(o){s=o,t(1,s)}return n.$$set=o=>{"key"in o&&t(0,i=o.key),"options"in o&&t(1,s=o.options)},[i,s,l,r]}class T4 extends Pe{constructor(e){super(),Ee(this,e,O4,M4,De,{key:0,options:1})}}var Ma=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Vs={_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!="undefined"&&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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Bl={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:"Clic
Line truncated
|
||||
<span class='flatpickr-weekday'>
|
||||
`+I.join("</span><span class='flatpickr-weekday'>")+`
|
||||
</span>
|
||||
`}}function ce(){t.calendarContainer.classList.add("hasWeeks");var N=kt("div","flatpickr-weekwrapper");N.appendChild(kt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var I=kt("div","flatpickr-weeks");return N.appendChild(I),{weekWrapper:N,weekNumbers:I}}function be(N,I){I===void 0&&(I=!0);var U=I?N:N-t.currentMonth;U<0&&t._hidePrevMonthArrow===!0||U>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=U,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,et("onYearChange"),G()),j(),et("onMonthChange"),Ze())}function se(N,I){if(N===void 0&&(N=!0),I===void 0&&(I=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,I===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var U=Aa(t.config),le=U.hours,Ne=U.minutes,Be=U.seconds;h(le,Ne,Be)}t.redraw(),N&&et("onChange")}function x(){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 Te(){t.config!==void 0&&et("onDestroy");for(var N=t._handlers.length;N--;)t._handlers[N].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 I=t.calendarContainer.parentNode;if(I.lastChild&&I.removeChild(I.lastChild),I.parentNode){for(;I.firstChild;)I.parentNode.insertBefore(I.firstChild,I);I.parentNode.removeChild(I)}}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(U){try{delete t[U]}catch{}})}function te(N){return t.calendarContainer.contains(N)}function _e(N){if(t.isOpen&&!t.config.inline){var I=Cn(N),U=te(I),le=I===t.input||I===t.altInput||t.element.contains(I)||N.path&&N.path.indexOf&&(~N.path.indexOf(t.input)||~N.path.indexOf(t.altInput)),Ne=!le&&!U&&!te(N.relatedTarget),Be=!t.config.ignoredFocusElements.some(function(tt){return tt.contains(I)});Ne&&Be&&(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 fe(N){if(!(!N||t.config.minDate&&N<t.config.minDate.getFullYear()||t.config.maxDate&&N>t.config.maxDate.getFullYear())){var I=N,U=t.currentYear!==I;t.currentYear=I||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)),U&&(t.redraw(),et("onYearChange"),G())}}function ie(N,I){var U;I===void 0&&(I=!0);var le=t.parseDate(N,void 0,I);if(t.config.minDate&&le&&$n(le,t.config.minDate,I!==void 0?I:!t.minDateHasTime)<0||t.config.maxDate&&le&&$n(le,t.config.maxDate,I!==void 0?I:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(le===void 0)return!1;for(var Ne=!!t.config.enable,Be=(U=t.config.enable)!==null&&U!==void 0?U:t.config.disable,tt=0,Ke=void 0;tt<Be.length;tt++){if(Ke=Be[tt],typeof Ke=="function"&&Ke(le))return Ne;if(Ke instanceof Date&&le!==void 0&&Ke.getTime()===le.getTime())return Ne;if(typeof Ke=="string"){var nt=t.parseDate(Ke,void 0,!0);return nt&&nt.getTime()===le.getTime()?Ne:!Ne}else if(typeof Ke=="object"&&le!==void 0&&Ke.from&&Ke.to&&le.getTime()>=Ke.from.getTime()&&le.getTime()<=Ke.to.getTime())return Ne}return!Ne}function ye(N){return t.daysContainer!==void 0?N.className.indexOf("hidden")===-1&&N.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(N):!1}function He(N){var I=N.target===t._input,U=t._input.value.trimEnd()!==Gt();I&&U&&!(N.relatedTarget&&te(N.relatedTarget))&&t.setDate(t._input.value,!0,N.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Le(N){var I=
Line truncated
|
||||
`),d=_("span"),h=_("span"),h.textContent="Choose presets",g=O(),B(y.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(f,"class","help-block")},m(M,T){w(M,e,T),m(e,t),m(e,i),m(e,s),w(M,r,T),V(o,M,T),w(M,u,T),w(M,f,T),m(f,c),m(f,d),m(d,h),m(d,g),V(y,d,null),b=!0,v||(C=Xe(St.call(null,s,{text:`Allow uploading files ONLY with the listed mime types.
|
||||
Leave empty for no restriction.`,position:"top"})),v=!0)},p(M,T){(!b||T&512&&l!==(l=M[9]))&&p(e,"for",l);const E={};T&512&&(E.id=M[9]),!a&&T&1&&(a=!0,E.value=M[0].mimeTypes,je(()=>a=!1)),o.$set(E);const D={};T&1025&&(D.$$scope={dirty:T,ctx:M}),y.$set(D)},i(M){b||(A(o.$$.fragment,M),A(y.$$.fragment,M),b=!0)},o(M){F(o.$$.fragment,M),F(y.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(r),z(o,M),M&&k(u),M&&k(f),z(y),v=!1,C()}}}function tM(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[8](b)}let y={id:n[9],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(y.value=n[0].thumbs),o=new Ss({props:y}),pe.push(()=>Ie(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[9]),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,v){(!c||v&512&&l!==(l=b[9]))&&p(e,"for",l);const C={};v&512&&(C.id=b[9]),!a&&v&1&&(a=!0,C.value=b[0].thumbs,je(()=>a=!1)),o.$set(C)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function nM(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;return i=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[x4,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[X4,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[eM,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[tM,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,y){w(g,e,y),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),m(e,f),m(e,c),V(d,c,null),h=!0},p(g,[y]){const b={};y&2&&(b.name="schema."+g[1]+".options.maxSize"),y&1537&&(b.$$scope={dirty:y,ctx:g}),i.$set(b);const v={};y&2&&(v.name="schema."+g[1]+".options.maxSelect"),y&1537&&(v.$$scope={dirty:y,ctx:g}),r.$set(v);const C={};y&2&&(C.name="schema."+g[1]+".options.mimeTypes"),y&1537&&(C.$$scope={dirty:y,ctx:g}),u.$set(C);const S={};y&2&&(S.name="schema."+g[1]+".options.thumbs"),y&1537&&(S.$$scope={dirty:y,ctx:g}),d.$set(S)},i(g){h||(A(i.$$.fragment,g),A(r.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){F(i.$$.fragment,g),F(r.$$.fragment,g),F(u.$$.fragment,g),F(d.$$.fragment,g),h=!1},d(g){g&&k(e),z(i),z(r),z(u),z(d)}}}function iM(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Ot(this.value),t(0,s)}function r(){s.maxSelect=Ot(this.value),t(0,s)}function o(d){n.$$.not_equal(s.mimeTypes,d)&&(s.mimeTypes=d,t(0,s))}const a=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},u=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},f=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function c(d){n.$$.not_equal(s.thumbs,d)&&(s.thumbs=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,r,o,a,u,f,c]}class sM extends Pe{constructor(e){super(),Ee(this,e,iM,nM,De,{key:1,options:0})}}function lM(n){let e,t,i,s,l,r,o;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new ws({props:u}),pe.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=H("Collection"),s=O(),B(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),V(l,f,c),o=!0},p(f,c){(!o||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!r&&c&1&&(r=!0,d.keyOfSelected=f[0].collectionId,je(()=>r=!1)),l.$set(d)},i(f){o||(A(l.$$.fragment,f),o=!0)},o(f){F(l.$$.fragment,f),o=!1},d(f){f&&k(e),f&&k(s),z(l,f)}}}function rM(n){let e,t,i,s,l,r,o,a;return{c(
Line truncated
|
||||
<code>@request.query.*</code>
|
||||
<code>@request.data.*</code>
|
||||
<code>@request.user.*</code>`,S=O(),$=_("hr"),M=O(),T=_("p"),T.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",E=O(),D=_("div"),D.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",P=O(),L=_("hr"),R=O(),j=_("p"),j.innerHTML=`Example rule:
|
||||
<br/>
|
||||
<code>@request.user.id!=null && created>"2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(r,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(C,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(T,"class","m-b-0"),p(D,"class","inline-flex flex-gap-5"),p(L,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(J,K){w(J,e,K),m(e,t),m(t,i),m(i,s),m(i,l),m(i,r),m(r,o),m(r,a),m(r,u),m(r,f),m(r,c),m(r,d);for(let ne=0;ne<Z.length;ne+=1)Z[ne].m(r,null);m(i,h),m(i,g),m(i,y),m(i,b),m(i,v),m(i,C),m(i,S),m(i,$),m(i,M),m(i,T),m(i,E),m(i,D),m(i,P),m(i,L),m(i,R),m(i,j),Y=!0},p(J,K){if(K&1){q=J[0].schema;let ne;for(ne=0;ne<q.length;ne+=1){const ce=Jp(J,q,ne);Z[ne]?Z[ne].p(ce,K):(Z[ne]=Zp(ce),Z[ne].c(),Z[ne].m(r,null))}for(;ne<Z.length;ne+=1)Z[ne].d(1);Z.length=q.length}},i(J){Y||(J&&Mt(()=>{G||(G=at(e,Xt,{duration:150},!0)),G.run(1)}),Y=!0)},o(J){J&&(G||(G=at(e,Xt,{duration:150},!1)),G.run(0)),Y=!1},d(J){J&&k(e),Bn(Z,J),J&&G&&G.end()}}}function HM(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=H(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&me(i,t)},d(s){s&&k(e)}}}function qM(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=H(t),s=H(".*")},m(l,r){w(l,e,r),m(e,i),m(e,s)},p(l,r){r&1&&t!==(t=l[19].name+"")&&me(i,t)},d(l){l&&k(e)}}}function Zp(n){let e;function t(l,r){return l[19].type==="relation"||l[19].type==="user"?qM:HM}let i=t(n),s=i(n);return{c(){s.c(),e=st()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function VM(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const r=o=>o[14];for(let o=0;o<l.length;o+=1){let a=Kp(n,l,o),u=r(a);t.set(u,e[o]=xp(u,a))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=st()},m(o,a){for(let u=0;u<e.length;u+=1)e[u].m(o,a);w(o,i,a),s=!0},p(o,a){a&262235&&(l=Object.entries(o[6]),Me(),e=rt(e,a,r,1,o,l,t,i.parentNode,Ft,xp,i,Kp),Oe())},i(o){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(o){for(let a=0;a<e.length;a+=1)F(e[a]);s=!1},d(o){for(let a=0;a<e.length;a+=1)e[a].d(o);o&&k(i)}}}function zM(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function BM(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,r){w(l,e,r),t||(i=[Xe(St.call(null,e,"Lock and set to Admins only")),Q(e,"click",s)],t=!0)},p(l,r){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function UM(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,r){w(l,e,r),t||(i=[Xe(St.call(null,e,"Unlock and set custom rule")),Q(e,"click",s)],t=!0)},p(l,r){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function WM(n){let e;return{c(){e=H("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function YM(n){let e;return{c(){e=H("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function KM(n){let e,t=n[15]+"",i,s,l=Hi(n[0][n[14]])?"Admins only":"Custom rule",r,o,a,u,f=n[14],c,d,h,g,y,b,v;function C(){return n[10](n[14])}const S=()=>n[11](u,f),$=()=>n[11](null,f);function M(R){n[12](R,n[14])}var T=n[4];function E(R){let j={baseCollection:R[0],disabled:Hi(R[0][R[14]])};return R[0][R[14]]!==void 0&&(j.value=R[0][R[14]]),{props:j}}T&&(u=new T(E(n)),S(),pe.push(()=>Ie(u,"value",M)));function D(R,j){return j&1&&(g=null),g==null&&(g=!!Hi(R[0][R[14]])),g?YM:WM}let P=D(n,-1),L=P(n);return{c(){e=_("label"),i=H(t),s=H(" - "),r=H(l),a=O(),u&&B(u.$$.fragment),d=O(),h=_("div"),L.c(),p(e,"for",o=n[18]),p(h,"class","help-block")},m(R,j){w(R,e,j),m(e,i),m(e,s),m(e,r),w(R,a,j),u&&V(u,R,j),w(R,d,j),w(R,h,j),L.m(h,null),y=!0,b||(v=Q(e,"click",C),b=!0)},p(R,j){n=R,(!y||j&1)&&l!==(l=Hi(n[0][n[14]])?"Admins only":"Custom rule")&&me(r,l),(!y||j&262144&&o!==(o=n[18]))&&p(e,"for",o),f!==n[14]&&($(),f=n[14],S());const G={};if(j&1&&(G.baseCollection=n[0]),j&1&&(G.disabled=Hi(n[0][n[14]])),!c&&j&65&&(c=!0,G.value=n[0][n[14]],je(()=>c=!1)),T!==(T=n[4])){if(u){Me();const Y=u;F(Y.$$.fragment,1,0,()=>{z(Y,1)}),Oe()}T?(u=new T(E(n)),S(),pe.push(()=>Ie(u,"value",M)),B(u.$$.fragment),A(u.$$.fragment,1),V(u,d.parentNode,d)):u=null}else T&&u.$set(G);P!==(P=D(n,j))&&(L.d(1),L=P(n),L&&(L.c(),L.m(h,null)))},i(R){y||(u&&A(u.$$.fragment,R),y=!0)},o(R){u&&F(u.$$.fragment,R),y=!1},d(R){R&&k(e),R&&k(a),$(),u&&z(u,R),R&&k(d),R&&k(h),L.d(),b=!1,v()}}}function xp(n,e){let t,i,s,l,r,o,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Hi(h[0][h[14]])),l?UM:BM}let c=f(e,-1),d=c(e);return o=new Fe({props:{class:"form-field rule-field m-0 "+(Hi(e[0][e[14]])?"disabled":""),name:e[14],$$slots:{defaLine truncated
|
||||
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||||
</a>.`,s=O(),l=_("span"),o=H(r),a=O(),b&&b.c(),u=O(),c.c(),d=st(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,a),b&&b.m(e,null),w($,u,M),C[f].m($,M),w($,d,M),h=!0,g||(y=Q(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&r!==(r=$[2]?"Hide available fields":"Show available fields")&&me(o,r),$[2]?b?(b.p($,M),M&4&&A(b,1)):(b=Gp($),b.c(),A(b,1),b.m(e,null)):b&&(Me(),F(b,1,1,()=>{b=null}),Oe());let T=f;f=S($),f===T?C[f].p($,M):(Me(),F(C[T],1,1,()=>{C[T]=null}),Oe(),c=C[f],c?c.p($,M):(c=C[f]=v[f]($),c.c()),A(c,1),c.m(d.parentNode,d))},i($){h||(A(b),A(c),h=!0)},o($){F(b),F(c),h=!1},d($){$&&k(e),b&&b.d(),$&&k(u),C[f].d($),$&&k(d),g=!1,y()}}}function Hi(n){return n===null}function GM(n,e,t){let{collection:i=new Fn}=e,s={},l=!1,r={},o,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,o=(await as(()=>import("./FilterAutocompleteInput.50934e7a.js"),[])).default)}catch(v){console.warn(v),t(4,o=null)}t(5,a=!1)}pi(()=>{f()});const c=()=>t(2,l=!l),d=async v=>{var C;t(0,i[v]=s[v]||"",i),await Oi(),(C=r[v])==null||C.focus()},h=v=>{t(1,s[v]=i[v],s),t(0,i[v]=null,i)},g=v=>{var C;return(C=r[v])==null?void 0:C.focus()};function y(v,C){pe[v?"unshift":"push"](()=>{r[C]=v,t(3,r)})}function b(v,C){n.$$.not_equal(i[C],v)&&(i[C]=v,t(0,i))}return n.$$set=v=>{"collection"in v&&t(0,i=v.collection)},[i,s,l,r,o,a,u,c,d,h,g,y,b]}class ZM extends Pe{constructor(e){super(),Ee(this,e,GM,JM,De,{collection:0})}}function Xp(n,e,t){const i=n.slice();return i[14]=e[t],i}function Qp(n,e,t){const i=n.slice();return i[14]=e[t],i}function eh(n){let e;return{c(){e=_("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 th(n){let e,t,i,s,l=n[1].originalName+"",r,o,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=H(`Renamed collection
|
||||
`),s=_("strong"),r=H(l),o=O(),a=_("i"),u=O(),f=_("strong"),d=H(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")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,r),m(t,o),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&2&&l!==(l=h[1].originalName+"")&&me(r,l),g&2&&c!==(c=h[1].name+"")&&me(d,c)},d(h){h&&k(e)}}}function nh(n){let e,t,i,s,l=n[14].originalName+"",r,o,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=H(`Renamed field
|
||||
`),s=_("strong"),r=H(l),o=O(),a=_("i"),u=O(),f=_("strong"),d=H(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")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(t,s),m(s,r),m(t,o),m(t,a),m(t,u),m(t,f),m(f,d)},p(h,g){g&16&&l!==(l=h[14].originalName+"")&&me(r,l),g&16&&c!==(c=h[14].name+"")&&me(d,c)},d(h){h&&k(e)}}}function ih(n){let e,t,i,s=n[14].name+"",l,r;return{c(){e=_("li"),t=H("Removed field "),i=_("span"),l=H(s),r=O(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(o,a){w(o,e,a),m(e,t),m(e,i),m(i,l),m(e,r)},p(o,a){a&8&&s!==(s=o[14].name+"")&&me(l,s)},d(o){o&&k(e)}}}function xM(n){let e,t,i,s,l,r,o,a,u,f,c,d,h=n[3].length&&eh(),g=n[5]&&th(n),y=n[4],b=[];for(let S=0;S<y.length;S+=1)b[S]=nh(Qp(n,y,S));let v=n[3],C=[];for(let S=0;S<v.length;S+=1)C[S]=ih(Xp(n,v,S));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=O(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
|
||||
update it manually!`,r=O(),h&&h.c(),o=O(),a=_("h6"),a.textContent="Changes:",u=O(),f=_("ul"),g&&g.c(),c=O();for(let S=0;S<b.length;S+=1)b[S].c();d=O();for(let S=0;S<C.length;S+=1)C[S].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(S,$){w(S,e,$),m(e,t),m(e,i),m(e,s),m(s,l),m(s,r),h&&h.m(s,null),w(S,o,$),w(S,a,$),w(S,u,$),w(S,f,$),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<C.length;M+=1)C[M].m(f,null)},p(S,$){if(S[3].length?h||(h=eh(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),S[5]?g?g.p(S,$):(g=th(S),g.c(),g.m(f,c)):g&&(g.d(1),g=null),$&16){y=S[4];let M;for(M=0;M<y.length;M+=1){const T=Qp(S,y,M);b[M]?b[M].p(T,$):(b[M]=nh(T),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=y.length}if($&8){v=S[3];let M;for(M=0;M<v.length;M+=1){const T=Xp(S,v,M);C[M]?C[M].p(T,$):(C[M]=ih(T),C[M].c(),C[M].m(f,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=v.length}},d(S){S&&k(e),h&&h.d(),S&&k(o),S&&k(a),S&&k(u),S&&k(f),g&&g.d(),Bn(b,S),Bn(C,S)}}}function XM(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function QM(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=O(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),e.focus(),s||(l=[Q(e,"click",n[8]),Q(i,"click",n[9])],s=!0)},p:oe,d(r){r&&k(e),r&&k(t),r&&k(i),s=!1,lt(l)}}}function eO(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[QM],header:[XM],default:[xM]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const r={};l&524346&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[10](null),z(e,s)}}}function tO(n,e,t){let i,s,l;const r=_n();let o,a;async function u(v){t(1,a=v),await Oi(),!i&&!s.length&&!l.length?c():o==null||o.show()}function f(){o==null||o.hide()}function c(){f(),r("confirm")}const d=()=>f(),h=()=>c();function g(v){pe[v?"unshift":"push"](()=>{o=v,t(2,o)})}function y(v){ft.call(this,n,v)}function b(v){ft.call(this,n,v)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(v=>v.id&&!v.toDelete&&v.originalName!=v.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(v=>v.id&&v.toDelete))||[])},[f,a,o,l,s,i,c,u,d,h,g,y,b]}class nO extends Pe{constructor(e){super(),Ee(this,e,tO,eO,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function sh(n){let e,t,i,s;function l(o){n[26](o)}let r={};return n[2]!==void 0&&(r.collection=n[2]),t=new ZM({props:r}),pe.push(()=>Ie(t,"collection",l)),{c(){e=_("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(o,a){w(o,e,a),V(t,e,null),s=!0},p(o,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=o[2],je(()=>i=!1)),t.$set(u)},i(o){s||(A(t.$$.fragment,o),s=!0)},o(o){F(t.$$.fragment,o),s=!1},d(o){o&&k(e),z(t)}}}function iO(n){let e,t,i,s,l,r;function o(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new jM({props:a}),pe.push(()=>Ie(i,"collection",o));let u=n[9]===Ul&&sh(n);return{c(){e=_("div"),t=_("div"),B(i.$$.fragment),l=O(),u&&u.c(),p(t,"class","tab-item"),ee(t,"active",n[9]===gs),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),V(i,t,null),m(e,l),u&&u.m(e,null),r=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],je(()=>s=!1)),i.$set(d),c[0]&512&&ee(t,"active",f[9]===gs),f[9]===Ul?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=sh(f),u.c(),A(u,1),u.m(e,null)):u&&(Me(),F(u,1,1,()=>{u=null}),Oe())},i(f){r||(A(i.$$.fragment,f),A(u),r=!0)},o(f){F(i.$$.fragment,f),F(u),r=!1},d(f){f&&k(e),z(i),u&&u.d()}}}function lh(n){let e,t,i,s,l,r,o;return r=new ks({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[sO]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=O(),i=_("button"),s=_("i"),l=O(),B(r.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),V(r,i,null),o=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),r.$set(f)},i(a){o||(A(r.$$.fragment,a),o=!0)},o(a){F(r.$$.fragment,a),o=!1},d(a){a&&k(e),a&&k(t),a&&k(i),z(r)}}}function sO(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function rh(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function lO(n){let e,t,i,s,l,r,o,a,u,f,c,d,h=n[2].system&&rh();return{c(){e=_("label"),t=H("Name"),s=O(),l=_("input"),u=O(),h&&h.c(),f=st(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",r=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=o=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,y){w(g,e,y),m(e,t),w(g,s,y),w(g,l,y),w(g,u,y),h&&h.m(g,y),w(g,f,y),n[2].isNew&&l.focus(),c||(d=Q(l,"input",n[21]),c=!0)},p(g,y){y[1]&128&&i!==(i=g[38])&&p(e,"for",i),y[1]&128&&r!==(r=g[38])&&p(l,"id",r),y[0]&2048&&(l.disabled=g[11]),y[0]&4&&o!==(o=g[2].isNew)&&(l.autofocus=o),y[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?h||(h=rh(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function oh(n){let e,t,i,s,l,r;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,a){w(o,e,a),s=!0,l||(r=Xe(t=St.call(null,e,n[12])),l=!0)},p(o,a){t&&Jn(t.update)&&a[0]&4096&&t.update.call(null,o[12])},i(o){s||(o&&Mt(()=>{i||(i=at(e,Wn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(o){o&&(i||(i=at(e,Wn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(o){o&&k(e),o&&i&&i.end(),l=!1,r()}}}function ah(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,o){w(r,e,o),i=!0,s||(l=Xe(St.call(null,e,"Has errors")),s=!0)},i(r){i||(r&&Mt(()=>{t||(t=at(e,Wn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(r){r&&(t||(t=at(e,Wn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(r){r&&k(e),r&&t&&t.end(),s=!1,l()}}}function rO(n){var R,j,G,Y,q,Z;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,r,o,a,u,f,c,d,h,g,y=!W.isEmpty((R=n[4])==null?void 0:R.schema),b,v,C,S,$=!W.isEmpty((j=n[4])==null?void 0:j.listRule)||!W.isEmpty((G=n[4])==null?void 0:G.viewRule)||!W.isEmpty((Y=n[4])==null?void 0:Y.createRule)||!W.isEmpty((q=n[4])==null?void 0:q.updateRule)||!W.isEmpty((Z=n[4])==null?void 0:Z.deleteRule),M,T,E,D=!n[2].isNew&&!n[2].system&&lh(n);o=new Fe({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[lO,({uniqueId:J})=>({38:J}),({uniqueId:J})=>[0,J?128:0]]},$$scope:{ctx:n}}});let P=y&&oh(n),L=$&&ah();return{c(){e=_("h4"),i=H(t),s=O(),D&&D.c(),l=O(),r=_("form"),B(o.$$.fragment),a=O(),u=_("input"),f=O(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=O(),P&&P.c(),b=O(),v=_("button"),C=_("span"),C.textContent="API Rules",S=O(),L&&L.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(r,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ee(d,"active",n[9]===gs),p(C,"class","txt"),p(v,"type","button"),p(v,"class","tab-item"),ee(v,"active",n[9]===Ul),p(c,"class","tabs-header stretched")},m(J,K){w(J,e,K),m(e,i),w(J,s,K),D&&D.m(J,K),w(J,l,K),w(J,r,K),V(o,r,null),m(r,a),m(r,u),w(J,f,K),w(J,c,K),m(c,d),m(d,h),m(d,g),P&&P.m(d,null),m(c,b),m(c,v),m(v,C),m(v,S),L&&L.m(v,null),M=!0,T||(E=[Q(r,"submit",Wt(n[22])),Q(d,"click",n[23]),Q(v,"click",n[24])],T=!0)},p(J,K){var ce,be,se,x,Te,te;(!M||K[0]&4)&&t!==(t=J[2].isNew?"New collection":"Edit collection")&&me(i,t),!J[2].isNew&&!J[2].system?D?(D.p(J,K),K[0]&4&&A(D,1)):(D=lh(J),D.c(),A(D,1),D.m(l.parentNode,l)):D&&(Me(),F(D,1,1,()=>{D=null}),Oe());const ne={};K[0]&2048&&(ne.class="form-field required m-b-0 "+(J[11]?"disabled":"")),K[0]&2052|K[1]&384&&(ne.$$scope={dirty:K,ctx:J}),o.$set(ne),K[0]&16&&(y=!W.isEmpty((ce=J[4])==null?void 0:ce.schema)),y?P?(P.p(J,K),K[0]&16&&A(P,1)):(P=oh(J),P.c(),A(P,1),P.m(d,null)):P&&(Me(),F(P,1,1,()=>{P=null}),Oe()),K[0]&512&&ee(d,"active",J[9]===gs),K[0]&16&&($=!W.isEmpty((be=J[4])==null?void 0:be.listRule)||!W.isEmpty((se=J[4])==null?void 0:se.viewRule)||!W.isEmpty((x=J[4])==null?void 0:x.createRule)||!W.isEmpty((Te=J[4])==null?void 0:Te.updateRule)||!W.isEmpty((te=J[4])==null?void 0:te.deleteRule)),$?L?K[0]&16&&A(L,1):(L=ah(),L.c(),A(L,1),L.m(v,null)):L&&(Me(),F(L,1,1,()=>{L=null}),Oe()),K[0]&512&&ee(v,"active",J[9]===Ul)},i(J){M||(A(D),A(o.$$.fragment,J),A(P),A(L),M=!0)},o(J){F(D),F(o.$$.fragment,J),F(P),F(L),M=!1},d(J){J&&k(e),J&&k(s),D&&D.d(J),J&&k(l),J&&k(r),z(o),J&&k(f),J&&k(c),P&&P.d(),L&&L.d(),T=!1,lt(E)}}}function oO(n){let e,t,i,s,l,r=n[2].isNew?"Create":"Save changes",o,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=O(),s=_("button"),l=_("span"),o=H(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ee(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,o),u||(f=[Q(e,"click",n[18]),Q(s,"click",n[19Line truncated
|
||||
<span class="txt">New collection</span>`,v=O(),B(C.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ee(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(i,"class","form-field search"),ee(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(y,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(L,R){w(L,e,R),m(e,t),m(t,i),m(i,s),m(s,l),m(i,r),m(i,o),Ce(o,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let j=0;j<d.length;j+=1)d[j].m(c,null);D&&D.m(c,null),m(e,g),m(e,y),m(y,b),w(L,v,R),V(C,L,R),S=!0,$||(M=[Q(l,"click",n[8]),Q(o,"input",n[9]),Q(b,"click",n[11])],$=!0)},p(L,[R]){R&16&&ee(l,"hidden",!L[4]),R&1&&o.value!==L[0]&&Ce(o,L[0]),R&16&&ee(i,"active",L[4]),R&106&&(T=L[3],d=rt(d,R,E,1,L,T,h,c,fn,dh,null,uh),!T.length&&D?D.p(L,R):T.length?D&&(D.d(1),D=null):(D=fh(L),D.c(),D.m(c,null)));const j={};C.$set(j)},i(L){S||(A(C.$$.fragment,L),S=!0)},o(L){F(C.$$.fragment,L),S=!1},d(L){L&&k(e);for(let R=0;R<d.length;R+=1)d[R].d();D&&D.d(),L&&k(v),n[12](null),z(C,L),$=!1,lt(M)}}}function pO(n,e,t){let i,s,l,r,o;hn(n,fi,b=>t(5,r=b)),hn(n,Gs,b=>t(7,o=b));let a,u="";function f(b){Bg(fi,r=b,r)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),g=()=>a==null?void 0:a.show();function y(b){pe[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=o.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,r,f,o,c,d,h,g,y]}class hO extends Pe{constructor(e){super(),Ee(this,e,pO,dO,De,{})}}function mO(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S,$,M,T,E,D,P,L,R,j,G,Y,q,Z,J,K,ne,ce,be,se,x,Te,te,_e,fe,ie,ye,He,Le,Re,ae,re,ve,qe;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
|
||||
<code><span class="txt-success">OPERAND</span>
|
||||
<span class="txt-danger">OPERATOR</span>
|
||||
<span class="txt-success">OPERAND</span></code>, where:`,t=O(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||||
quoted), number, null, true, false`,l=O(),r=_("li"),o=_("code"),o.textContent="OPERATOR",a=H(` - is one of:
|
||||
`),u=_("br"),f=O(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=O(),y=_("span"),y.textContent="Equal",b=O(),v=_("li"),C=_("code"),C.textContent="!=",S=O(),$=_("span"),$.textContent="NOT equal",M=O(),T=_("li"),E=_("code"),E.textContent=">",D=O(),P=_("span"),P.textContent="Greater than",L=O(),R=_("li"),j=_("code"),j.textContent=">=",G=O(),Y=_("span"),Y.textContent="Greater than or equal",q=O(),Z=_("li"),J=_("code"),J.textContent="<",K=O(),ne=_("span"),ne.textContent="Less than or equal",ce=O(),be=_("li"),se=_("code"),se.textContent="<=",x=O(),Te=_("span"),Te.textContent="Less than or equal",te=O(),_e=_("li"),fe=_("code"),fe.textContent="~",ie=O(),ye=_("span"),ye.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||||
match)`,He=O(),Le=_("li"),Re=_("code"),Re.textContent="!~",ae=O(),re=_("span"),re.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,ve=O(),qe=_("p"),qe.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(o,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(y,"class","txt-hint"),p(C,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(E,"class","filter-op svelte-1w7s5nw"),p(P,"class","txt-hint"),p(j,"class","filter-op svelte-1w7s5nw"),p(Y,"class","txt-hint"),p(J,"class","filter-op svelte-1w7s5nw"),p(ne,"class","txt-hint"),p(se,"class","filter-op svelte-1w7s5nw"),p(Te,"class","txt-hint"),p(fe,"class","filter-op svelte-1w7s5nw"),p(ye,"class","txt-hint"),p(Re,"class","filter-op svelte-1w7s5nw"),p(re,"class","txt-hint")},m(Ve,Je){w(Ve,e,Je),w(Ve,t,Je),w(Ve,i,Je),m(i,s),m(i,l),m(i,r),m(r,o),m(r,a),m(r,u),m(r,f),m(r,c),m(c,d),m(d,h),m(d,g),m(d,y),m(c,b),m(c,v),m(v,C),m(v,S),m(v,$),m(c,M),m(c,T),m(T,E),m(T,D),m(T,P),m(c,L),m(c,R),m(R,j),m(R,G),m(R,Y),m(c,q),m(c,Z),m(Z,J),m(Z,K),m(Z,ne),m(c,ce),m(c,be),m(be,se),m(be,x),m(be,Te),m(c,te),m(c,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(c,He),m(c,Le),m(Le,Re),m(Le,ae),m(Le,re),w(Ve,ve,Je),w(Ve,qe,Je)},p:oe,i:oe,o:oe,d(Ve){Ve&&k(e),Ve&&k(t),Ve&&k(i),Ve&&k(ve),Ve&&k(qe)}}}class gO extends Pe{constructor(e){super(),Ee(this,e,null,mO,De,{})}}function ph(n,e,t){const i=n.slice();return i[8]=e[t],i}function hh(n,e,t){const i=n.slice();return i[8]=e[t],i}function mh(n,e,t){const i=n.slice();return i[13]=e[t],i}function gh(n,e,t){const i=n.slice();return i[13]=e[t],i}function _h(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function bh(n,e){let t,i=e[13].lang+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function yh(n,e){let t,i,s,l;return i=new sn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&ee(t,"active",e[3]===e[13].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function vh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function kh(n,e){let t,i,s,l;return i=new sn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&ee(t,"active",e[2]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function _O(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v=n[0].name+"",C,S,$,M,T,E,D,P=[],L=new Map,R,j,G=[],Y=new Map,q,Z,J,K,ne,ce,be,se,x,Te,te,_e,fe,ie,ye,He,Le,Re,ae,re,ve,qe,Ve,Je,ge,Ae,X,ue,Ue,bt,it,yt,ut,dt,Tt,Pt,Jt,he,we,Ge,et,Et,de,Se,Ze,Gt,Vt,ii,ot,N,I,U,le,Ne,Be,tt,Ke,nt,Ye,xe=[],wt=new Map,Sn,Yt,Zt=[],gi=new Map,Ei,Qt=n[1]&&_h(),Cs=n[4];const sr=$e=>$e[13].lang;for(let $e=0;$e<Cs.length;$e+=1){let We=gh(n,Cs,$e),Dt=sr(We);L.set(Dt,P[$e]=bh(Dt,We))}let Zi=n[4];const lr=$e=>$e[13].lang;for(let $e=0;$e<Zi.length;$e+=1){let We=mh(n,Zi,$e),Dt=lr(We);Y.set(Dt,G[$e]=yh(Dt,We))}ge=new sn({props:{content:`
|
||||
// DESC by created and ASC by id
|
||||
?sort=-created,id
|
||||
`}}),dt=new sn({props:{content:`
|
||||
?filter=(id='abc' && created>'2022-01-01')
|
||||
`}}),Pt=new gO({}),Ze=new sn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let $s=n[5];const rr=$e=>$e[8].code;for(let $e=0;$e<$s.length;$e+=1){let We=hh(n,$s,$e),Dt=rr(We);wt.set(Dt,xe[$e]=vh(Dt,We))}let xi=n[5];const or=$e=>$e[8].code;for(let $e=0;$e<xi.length;$e+=1){let We=ph(n,xi,$e),Dt=or(We);gi.set(Dt,Zt[$e]=kh(Dt,We))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records"),c=O(),Qt&&Qt.c(),d=O(),h=_("div"),g=_("p"),y=H("Fetch a paginated "),b=_("strong"),C=H(v),S=H(" records list."),$=O(),M=_("div"),M.textContent="Client SDKs example",T=O(),E=_("div"),D=_("div");for(let $e=0;$e<P.length;$e+=1)P[$e].c();R=O(),j=_("div");for(let $e=0;$e<G.length;$e+=1)G[$e].c();q=O(),Z=_("div"),Z.textContent="Query parameters",J=O(),K=_("table"),ne=_("thead"),ne.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,ce=O(),be=_("tbody"),se=_("tr"),se.innerHTML=`<td>page</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,x=O(),Te=_("tr"),Te.innerHTML=`<td>perPage</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>Specify the max returned records per page (default to 30).</td>`,te=O(),_e=_("tr"),fe=_("td"),fe.textContent="sort",ie=O(),ye=_("td"),ye.innerHTML='<span class="label">String</span>',He=O(),Le=_("td"),Re=H("Specify the records order attribute(s). "),ae=_("br"),re=H(`
|
||||
Add `),ve=_("code"),ve.textContent="-",qe=H(" / "),Ve=_("code"),Ve.textContent="+",Je=H(` (default) in front of the attribute for DESC / ASC order.
|
||||
Ex.:
|
||||
`),B(ge.$$.fragment),Ae=O(),X=_("tr"),ue=_("td"),ue.textContent="filter",Ue=O(),bt=_("td"),bt.innerHTML='<span class="label">String</span>',it=O(),yt=_("td"),ut=H(`Filter the returned records. Ex.:
|
||||
`),B(dt.$$.fragment),Tt=O(),B(Pt.$$.fragment),Jt=O(),he=_("tr"),we=_("td"),we.textContent="expand",Ge=O(),et=_("td"),et.innerHTML='<span class="label">String</span>',Et=O(),de=_("td"),Se=H(`Auto expand nested record relations. Ex.:
|
||||
`),B(Ze.$$.fragment),Gt=H(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Vt=_("br"),ii=H(`
|
||||
The expanded relations will be appended to each individual record under the
|
||||
`),ot=_("code"),ot.textContent="@expand",N=H(" property (eg. "),I=_("code"),I.textContent='"@expand": {"rel1": {...}, ...}',U=H(`). Only the
|
||||
relations that the user has permissions to `),le=_("strong"),le.textContent="view",Ne=H(" will be expanded."),Be=O(),tt=_("div"),tt.textContent="Responses",Ke=O(),nt=_("div"),Ye=_("div");for(let $e=0;$e<xe.length;$e+=1)xe[$e].c();Sn=O(),Yt=_("div");for(let $e=0;$e<Zt.length;$e+=1)Zt[$e].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(D,"class","tabs-header compact left"),p(j,"class","tabs-content"),p(E,"class","tabs m-b-lg"),p(Z,"class","section-title"),p(K,"class","table-compact table-border m-b-lg"),p(tt,"class","section-title"),p(Ye,"class","tabs-header compact left"),p(Yt,"class","tabs-content"),p(nt,"class","tabs")},m($e,We){w($e,e,We),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(e,c),Qt&&Qt.m(e,null),w($e,d,We),w($e,h,We),m(h,g),m(g,y),m(g,b),m(b,C),m(g,S),w($e,$,We),w($e,M,We),w($e,T,We),w($e,E,We),m(E,D);for(let Dt=0;Dt<P.length;Dt+=1)P[Dt].m(D,null);m(E,R),m(E,j);for(let Dt=0;Dt<G.length;Dt+=1)G[Dt].m(j,null);w($e,q,We),w($e,Z,We),w($e,J,We),w($e,K,We),m(K,ne),m(K,ce),m(K,be),m(be,se),m(be,x),m(be,Te),m(be,te),m(be,_e),m(_e,fe),m(_e,ie),m(_e,ye),m(_e,He),m(_e,Le),m(Le,Re),m(Le,ae),m(Le,re),m(Le,ve),m(Le,qe),m(Le,Ve),m(Le,Je),V(ge,Le,null),m(be,Ae),m(be,X),m(X,ue),m(X,Ue),m(X,bt),m(X,it),m(X,yt),m(yt,ut),V(dt,yt,null),m(yt,Tt),V(Pt,yt,null),m(be,Jt),m(be,he),m(he,we),m(he,Ge),m(he,et),m(he,Et),m(he,de),m(de,Se),V(Ze,de,null),m(de,Gt),m(de,Vt),m(de,ii),m(de,ot),m(de,N),m(de,I),m(de,U),m(de,le),m(de,Ne),w($e,Be,We),w($e,tt,We),w($e,Ke,We),w($e,nt,We),m(nt,Ye);for(let Dt=0;Dt<xe.length;Dt+=1)xe[Dt].m(Ye,null);m(nt,Sn),m(nt,Yt);for(let Dt=0;Dt<Zt.length;Dt+=1)Zt[Dt].m(Yt,null);Ei=!0},p($e,[We]){(!Ei||We&1)&&a!==(a=$e[0].name+"")&&me(u,a),$e[1]?Qt||(Qt=_h(),Qt.c(),Qt.m(e,null)):Qt&&(Qt.d(1),Qt=null),(!Ei||We&1)&&v!==(v=$e[0].name+"")&&me(C,v),We&24&&(Cs=$e[4],P=rt(P,We,sr,1,$e,Cs,L,D,fn,bh,null,gh)),We&24&&(Zi=$e[4],Me(),G=rt(G,We,lr,1,$e,Zi,Y,j,Ft,yh,null,mh),Oe()),We&36&&($s=$e[5],xe=rt(xe,We,rr,1,$e,$s,wt,Ye,fn,vh,null,hh)),We&36&&(xi=$e[5],Me(),Zt=rt(Zt,We,or,1,$e,xi,gi,Yt,Ft,kh,null,ph),Oe())},i($e){if(!Ei){for(let We=0;We<Zi.length;We+=1)A(G[We]);A(ge.$$.fragment,$e),A(dt.$$.fragment,$e),A(Pt.$$.fragment,$e),A(Ze.$$.fragment,$e);for(let We=0;We<xi.length;We+=1)A(Zt[We]);Ei=!0}},o($e){for(let We=0;We<G.length;We+=1)F(G[We]);F(ge.$$.fragment,$e),F(dt.$$.fragment,$e),F(Pt.$$.fragment,$e),F(Ze.$$.fragment,$e);for(let We=0;We<Zt.length;We+=1)F(Zt[We]);Ei=!1},d($e){$e&&k(e),Qt&&Qt.d(),$e&&k(d),$e&&k(h),$e&&k($),$e&&k(M),$e&&k(T),$e&&k(E);for(let We=0;We<P.length;We+=1)P[We].d();for(let We=0;We<G.length;We+=1)G[We].d();$e&&k(q),$e&&k(Z),$e&&k(J),$e&&k(K),z(ge),z(dt),z(Pt),z(Ze),$e&&k(Be),$e&&k(tt),$e&&k(Ke),$e&&k(nt);for(let We=0;We<xe.length;We+=1)xe[We].d();for(let We=0;We<Zt.length;We+=1)Zt[We].d()}}}function bO(n,e,t){let i,{collection:s=new Fn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(s),W.dummyCollectionRecord(s)]},null,2)}),o.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&o.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),o.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
client.Records.getList("${s==null?void 0:s.name}", { page: 2 })
|
||||
.then(function (list) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
client.Records.getFullList("${s==null?void 0:s.name}", 200 /* batch size */)
|
||||
.then(function (records) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,r,a,o,u,f]}class yO extends Pe{constructor(e){super(),Ee(this,e,bO,_O,De,{collection:0})}}function wh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Sh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ch(n,e,t){const i=n.slice();return i[13]=e[t],i}function $h(n,e,t){const i=n.slice();return i[13]=e[t],i}function Mh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Oh(n,e){let t,i=e[13].lang+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function Th(n,e){let t,i,s,l;return i=new sn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&ee(t,"active",e[3]===e[13].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function Dh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Ah(n,e){let t,i,s,l;return i=new sn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&ee(t,"active",e[2]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function vO(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,C=n[0].name+"",S,$,M,T,E,D,P,L=[],R=new Map,j,G,Y=[],q=new Map,Z,J,K,ne,ce,be,se,x,Te,te,_e,fe,ie,ye,He,Le,Re,ae,re,ve,qe,Ve,Je,ge,Ae,X,ue,Ue,bt,it,yt,ut,dt,Tt=[],Pt=new Map,Jt,he,we=[],Ge=new Map,et,Et=n[1]&&Mh(),de=n[4];const Se=I=>I[13].lang;for(let I=0;I<de.length;I+=1){let U=$h(n,de,I),le=Se(U);R.set(le,L[I]=Oh(le,U))}let Ze=n[4];const Gt=I=>I[13].lang;for(let I=0;I<Ze.length;I+=1){let U=Ch(n,Ze,I),le=Gt(U);q.set(le,Y[I]=Th(le,U))}re=new sn({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let Vt=n[5];const ii=I=>I[8].code;for(let I=0;I<Vt.length;I+=1){let U=Sh(n,Vt,I),le=ii(U);Pt.set(le,Tt[I]=Dh(le,U))}let ot=n[5];const N=I=>I[8].code;for(let I=0;I<ot.length;I+=1){let U=wh(n,ot,I),le=N(U);Ge.set(le,we[I]=Ah(le,U))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),Et&&Et.c(),h=O(),g=_("div"),y=_("p"),b=H("Fetch a single "),v=_("strong"),S=H(C),$=H(" record."),M=O(),T=_("div"),T.textContent="Client SDKs example",E=O(),D=_("div"),P=_("div");for(let I=0;I<L.length;I+=1)L[I].c();j=O(),G=_("div");for(let I=0;I<Y.length;I+=1)Y[I].c();Z=O(),J=_("div"),J.textContent="Path Parameters",K=O(),ne=_("table"),ne.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to view.</td></tr></tbody>`,ce=O(),be=_("div"),be.textContent="Query parameters",se=O(),x=_("table"),Te=_("thead"),Te.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,te=O(),_e=_("tbody"),fe=_("tr"),ie=_("td"),ie.textContent="expand",ye=O(),He=_("td"),He.innerHTML='<span class="label">String</span>',Le=O(),Re=_("td"),ae=H(`Auto expand nested record relations. Ex.:
|
||||
`),B(re.$$.fragment),ve=H(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),qe=_("br"),Ve=H(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),Je=_("code"),Je.textContent="@expand",ge=H(" property (eg. "),Ae=_("code"),Ae.textContent='"@expand": {"rel1": {...}, ...}',X=H(`). Only the
|
||||
relations that the user has permissions to `),ue=_("strong"),ue.textContent="view",Ue=H(" will be expanded."),bt=O(),it=_("div"),it.textContent="Responses",yt=O(),ut=_("div"),dt=_("div");for(let I=0;I<Tt.length;I+=1)Tt[I].c();Jt=O(),he=_("div");for(let I=0;I<we.length;I+=1)we[I].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(J,"class","section-title"),p(ne,"class","table-compact table-border m-b-lg"),p(be,"class","section-title"),p(x,"class","table-compact table-border m-b-lg"),p(it,"class","section-title"),p(dt,"class","tabs-header compact left"),p(he,"class","tabs-content"),p(ut,"class","tabs")},m(I,U){w(I,e,U),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),Et&&Et.m(e,null),w(I,h,U),w(I,g,U),m(g,y),m(y,b),m(y,v),m(v,S),m(y,$),w(I,M,U),w(I,T,U),w(I,E,U),w(I,D,U),m(D,P);for(let le=0;le<L.length;le+=1)L[le].m(P,null);m(D,j),m(D,G);for(let le=0;le<Y.length;le+=1)Y[le].m(G,null);w(I,Z,U),w(I,J,U),w(I,K,U),w(I,ne,U),w(I,ce,U),w(I,be,U),w(I,se,U),w(I,x,U),m(x,Te),m(x,te),m(x,_e),m(_e,fe),m(fe,ie),m(fe,ye),m(fe,He),m(fe,Le),m(fe,Re),m(Re,ae),V(re,Re,null),m(Re,ve),m(Re,qe),m(Re,Ve),m(Re,Je),m(Re,ge),m(Re,Ae),m(Re,X),m(Re,ue),m(Re,Ue),w(I,bt,U),w(I,it,U),w(I,yt,U),w(I,ut,U),m(ut,dt);for(let le=0;le<Tt.length;le+=1)Tt[le].m(dt,null);m(ut,Jt),m(ut,he);for(let le=0;le<we.length;le+=1)we[le].m(he,null);et=!0},p(I,[U]){(!et||U&1)&&a!==(a=I[0].name+"")&&me(u,a),I[1]?Et||(Et=Mh(),Et.c(),Et.m(e,null)):Et&&(Et.d(1),Et=null),(!et||U&1)&&C!==(C=I[0].name+"")&&me(S,C),U&24&&(de=I[4],L=rt(L,U,Se,1,I,de,R,P,fn,Oh,null,$h)),U&24&&(Ze=I[4],Me(),Y=rt(Y,U,Gt,1,I,Ze,q,G,Ft,Th,null,Ch),Oe()),U&36&&(Vt=I[5],Tt=rt(Tt,U,ii,1,I,Vt,Pt,dt,fn,Dh,null,Sh)),U&36&&(ot=I[5],Me(),we=rt(we,U,N,1,I,ot,Ge,he,Ft,Ah,null,wh),Oe())},i(I){if(!et){for(let U=0;U<Ze.length;U+=1)A(Y[U]);A(re.$$.fragment,I);for(let U=0;U<ot.length;U+=1)A(we[U]);et=!0}},o(I){for(let U=0;U<Y.length;U+=1)F(Y[U]);F(re.$$.fragment,I);for(let U=0;U<we.length;U+=1)F(we[U]);et=!1},d(I){I&&k(e),Et&&Et.d(),I&&k(h),I&&k(g),I&&k(M),I&&k(T),I&&k(E),I&&k(D);for(let U=0;U<L.length;U+=1)L[U].d();for(let U=0;U<Y.length;U+=1)Y[U].d();I&&k(Z),I&&k(J),I&&k(K),I&&k(ne),I&&k(ce),I&&k(be),I&&k(se),I&&k(x),z(re),I&&k(bt),I&&k(it),I&&k(yt),I&&k(ut);for(let U=0;U<Tt.length;U+=1)Tt[U].d();for(let U=0;U<we.length;U+=1)we[U].d()}}}function kO(n,e,t){let i,{collection:s=new Fn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)}),i&&o.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),o.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
client.Records.getOne("${s==null?void 0:s.name}", "RECORD_ID")
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,r,a,o,u,f]}class wO extends Pe{constructor(e){super(),Ee(this,e,kO,vO,De,{collection:0})}}function Eh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Ph(n,e,t){const i=n.slice();return i[8]=e[t],i}function Lh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Fh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Ih(n,e,t){const i=n.slice();return i[16]=e[t],i}function Nh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Rh(n,e){let t,i=e[16].lang+"",s,l,r,o;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&me(s,i),f&20&&ee(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),r=!1,o()}}}function jh(n,e){let t,i,s,l;return i=new sn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[16].code),i.$set(a),o&20&&ee(t,"active",e[2]===e[16].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function SO(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function CO(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $O(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("User "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function MO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("Relation record "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function OO(n){let e,t,i,s,l;return{c(){e=H("FormData object."),t=_("br"),i=H(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=H(" to delete already uploaded file(s).")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),w(r,s,o),w(r,l,o)},p:oe,d(r){r&&k(e),r&&k(t),r&&k(i),r&&k(s),r&&k(l)}}}function TO(n){let e;return{c(){e=H("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function DO(n){let e;return{c(){e=H("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function AO(n){let e;return{c(){e=H("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function EO(n){let e;return{c(){e=H("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function PO(n){let e;return{c(){e=H("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Hh(n,e){let t,i,s,l,r,o=e[13].name+"",a,u,f,c,d=W.getFieldValueType(e[13])+"",h,g,y,b;function v(E,D){return E[13].required?CO:SO}let C=v(e),S=C(e);function $(E,D){if(E[13].type==="text")return PO;if(E[13].type==="number")return EO;if(E[13].type==="json")return AO;if(E[13].type==="email")return DO;if(E[13].type==="url")return TO;if(E[13].type==="file")return OO;if(E[13].type==="relation")return MO;if(E[13].type==="user")return $O}let M=$(e),T=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=O(),r=_("span"),a=H(o),u=O(),f=_("td"),c=_("span"),h=H(d),g=O(),y=_("td"),T&&T.c(),b=O(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,D){w(E,t,D),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,r),m(r,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,y),T&&T.m(y,null),m(t,b)},p(E,D){e=E,C!==(C=v(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),D&1&&o!==(o=e[13].name+"")&&me(a,o),D&1&&d!==(d=W.getFieldValueType(e[13])+"")&&me(h,d),M===(M=$(e))&&T?T.p(e,D):(T&&T.d(1),T=M&&M(e),T&&(T.c(),T.m(y,null)))},d(E){E&&k(t),S.d(),T&&T.d()}}}function qh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&me(s,i),f&10&&ee(t,"active",e[1]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Vh(n,e){let t,i,s,l;return i=new sn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&8&&(a.content=e[8].body),i.$set(a),o&10&&ee(t,"active",e[1]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function LO(n){var Jt;let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v=n[0].name+"",C,S,$,M,T,E,D,P,L,R,j,G=[],Y=new Map,q,Z,J=[],K=new Map,ne,ce,be,se,x,Te,te,_e=[],fe=new Map,ie,ye,He,Le,Re,ae=[],re=new Map,ve,qe,Ve=[],Je=new Map,ge,Ae=n[5]&&Nh(),X=n[4];const ue=he=>he[16].lang;for(let he=0;he<X.length;he+=1){let we=Ih(n,X,he),Ge=ue(we);Y.set(Ge,G[he]=Rh(Ge,we))}let Ue=n[4];const bt=he=>he[16].lang;for(let he=0;he<Ue.length;he+=1){let we=Fh(n,Ue,he),Ge=bt(we);K.set(Ge,J[he]=jh(Ge,we))}let it=(Jt=n[0])==null?void 0:Jt.schema;const yt=he=>he[13].name;for(let he=0;he<it.length;he+=1){let we=Lh(n,it,he),Ge=yt(we);fe.set(Ge,_e[he]=Hh(Ge,we))}let ut=n[3];const dt=he=>he[8].code;for(let he=0;he<ut.length;he+=1){let we=Ph(n,ut,he),Ge=dt(we);re.set(Ge,ae[he]=qh(Ge,we))}let Tt=n[3];const Pt=he=>he[8].code;for(let he=0;he<Tt.length;he+=1){let we=Eh(n,Tt,he),Ge=Pt(we);Je.set(Ge,Ve[he]=Vh(Ge,we))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records"),c=O(),Ae&&Ae.c(),d=O(),h=_("div"),g=_("p"),y=H("Create a new "),b=_("strong"),C=H(v),S=H(" record."),$=O(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,T=O(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",D=O(),P=_("div"),P.textContent="Client SDKs example",L=O(),R=_("div"),j=_("div");for(let he=0;he<G.length;he+=1)G[he].c();q=O(),Z=_("div");for(let he=0;he<J.length;he+=1)J[he].c();ne=O(),ce=_("div"),ce.textContent="Body Parameters",be=O(),se=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,Te=O(),te=_("tbody");for(let he=0;he<_e.length;he+=1)_e[he].c();ie=O(),ye=_("div"),ye.textContent="Responses",He=O(),Le=_("div"),Re=_("div");for(let he=0;he<ae.length;he+=1)ae[he].c();ve=O(),qe=_("div");for(let he=0;he<Ve.length;he+=1)Ve[he].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(P,"class","section-title"),p(j,"class","tabs-header compact left"),p(Z,"class","tabs-content"),p(R,"class","tabs m-b-lg"),p(ce,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(ye,"class","section-title"),p(Re,"class","tabs-header compact left"),p(qe,"class","tabs-content"),p(Le,"class","tabs")},m(he,we){w(he,e,we),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(e,c),Ae&&Ae.m(e,null),w(he,d,we),w(he,h,we),m(h,g),m(g,y),m(g,b),m(b,C),m(g,S),m(h,$),m(h,M),m(h,T),m(h,E),w(he,D,we),w(he,P,we),w(he,L,we),w(he,R,we),m(R,j);for(let Ge=0;Ge<G.length;Ge+=1)G[Ge].m(j,null);m(R,q),m(R,Z);for(let Ge=0;Ge<J.length;Ge+=1)J[Ge].m(Z,null);w(he,ne,we),w(he,ce,we),w(he,be,we),w(he,se,we),m(se,x),m(se,Te),m(se,te);for(let Ge=0;Ge<_e.length;Ge+=1)_e[Ge].m(te,null);w(he,ie,we),w(he,ye,we),w(he,He,we),w(he,Le,we),m(Le,Re);for(let Ge=0;Ge<ae.length;Ge+=1)ae[Ge].m(Re,null);m(Le,ve),m(Le,qe);for(let Ge=0;Ge<Ve.length;Ge+=1)Ve[Ge].m(qe,null);ge=!0},p(he,[we]){var Ge;(!ge||we&1)&&a!==(a=he[0].name+"")&&me(u,a),he[5]?Ae||(Ae=Nh(),Ae.c(),Ae.m(e,null)):Ae&&(Ae.d(1),Ae=null),(!ge||we&1)&&v!==(v=he[0].name+"")&&me(C,v),we&20&&(X=he[4],G=rt(G,we,ue,1,he,X,Y,j,fn,Rh,null,Ih)),we&20&&(Ue=he[4],Me(),J=rt(J,we,bt,1,he,Ue,K,Z,Ft,jh,null,Fh),Oe()),we&1&&(it=(Ge=he[0])==null?void 0:Ge.schema,_e=rt(_e,we,yt,1,he,it,fe,te,fn,Hh,null,Lh)),we&10&&(ut=he[3],ae=rt(ae,we,dt,1,he,ut,re,Re,fn,qh,null,Ph)),we&10&&(Tt=he[3],Me(),Ve=rt(Ve,we,Pt,1,he,Tt,Je,qe,Ft,Vh,null,Eh),Oe())},i(he){if(!ge){for(let we=0;we<Ue.length;we+=1)A(J[we]);for(let we=0;we<Tt.length;we+=1)A(Ve[we]);ge=!0}},o(he){for(let we=0;we<J.length;we+=1)F(J[we]);for(let we=0;we<Ve.length;we+=1)F(Ve[we]);ge=!1},d(he){he&&k(e),Ae&&Ae.d(),he&&k(d),he&&k(h),he&&k(D),he&&k(P),he&&k(L),he&&k(R);for(let we=0;we<G.length;we+=1)G[we].d();for(let we=0;we<J.length;we+=1)J[we].d();he&&k(ne),he&&k(ce),he&&k(be),he&&k(se);for(let we=0;we<_e.length;we+=1)_e[we].d();he&&k(ie),he&&k(ye),he&&k(He),he&&k(Le);for(let we=0;we<ae.length;we+=1)ae[we].d();for(let we=0;we<Ve.length;we+=1)Ve[we].d()}}}function FO(n,e,t){let i,{collection:s=new Fn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(2,r=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,o=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to create record.",
|
||||
"data": {
|
||||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.create("${s==null?void 0:s.name}", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,l,r,o,a,i,u,f]}class IO extends Pe{constructor(e){super(),Ee(this,e,FO,LO,De,{collection:0})}}function zh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Bh(n,e,t){const i=n.slice();return i[8]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[13]=e[t],i}function Wh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Yh(n,e,t){const i=n.slice();return i[16]=e[t],i}function Kh(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Jh(n,e){let t,i=e[16].lang+"",s,l,r,o;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&me(s,i),f&20&&ee(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),r=!1,o()}}}function Gh(n,e){let t,i,s,l;return i=new sn({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[16].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[16].code),i.$set(a),o&20&&ee(t,"active",e[2]===e[16].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function NO(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function RO(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("User "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function HO(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=H("Relation record "),i=H(t),s=H(".")},m(r,o){w(r,e,o),w(r,i,o),w(r,s,o)},p(r,o){var a;o&1&&t!==(t=((a=r[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&me(i,t)},d(r){r&&k(e),r&&k(i),r&&k(s)}}}function qO(n){let e,t,i,s,l;return{c(){e=H("FormData object."),t=_("br"),i=H(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=H(" to delete already uploaded file(s).")},m(r,o){w(r,e,o),w(r,t,o),w(r,i,o),w(r,s,o),w(r,l,o)},p:oe,d(r){r&&k(e),r&&k(t),r&&k(i),r&&k(s),r&&k(l)}}}function VO(n){let e;return{c(){e=H("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function zO(n){let e;return{c(){e=H("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function BO(n){let e;return{c(){e=H("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function UO(n){let e;return{c(){e=H("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function WO(n){let e;return{c(){e=H("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Zh(n,e){let t,i,s,l,r,o=e[13].name+"",a,u,f,c,d=W.getFieldValueType(e[13])+"",h,g,y,b;function v(E,D){return E[13].required?RO:NO}let C=v(e),S=C(e);function $(E,D){if(E[13].type==="text")return WO;if(E[13].type==="number")return UO;if(E[13].type==="json")return BO;if(E[13].type==="email")return zO;if(E[13].type==="url")return VO;if(E[13].type==="file")return qO;if(E[13].type==="relation")return HO;if(E[13].type==="user")return jO}let M=$(e),T=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=O(),r=_("span"),a=H(o),u=O(),f=_("td"),c=_("span"),h=H(d),g=O(),y=_("td"),T&&T.c(),b=O(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,D){w(E,t,D),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,r),m(r,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,y),T&&T.m(y,null),m(t,b)},p(E,D){e=E,C!==(C=v(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),D&1&&o!==(o=e[13].name+"")&&me(a,o),D&1&&d!==(d=W.getFieldValueType(e[13])+"")&&me(h,d),M===(M=$(e))&&T?T.p(e,D):(T&&T.d(1),T=M&&M(e),T&&(T.c(),T.m(y,null)))},d(E){E&&k(t),S.d(),T&&T.d()}}}function xh(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&me(s,i),f&10&&ee(t,"active",e[1]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function Xh(n,e){let t,i,s,l;return i=new sn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[1]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&8&&(a.content=e[8].body),i.$set(a),o&10&&ee(t,"active",e[1]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function YO(n){var Et;let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,C=n[0].name+"",S,$,M,T,E,D,P,L,R,j,G,Y=[],q=new Map,Z,J,K=[],ne=new Map,ce,be,se,x,Te,te,_e,fe,ie,ye,He,Le=[],Re=new Map,ae,re,ve,qe,Ve,Je=[],ge=new Map,Ae,X,ue=[],Ue=new Map,bt,it=n[5]&&Kh(),yt=n[4];const ut=de=>de[16].lang;for(let de=0;de<yt.length;de+=1){let Se=Yh(n,yt,de),Ze=ut(Se);q.set(Ze,Y[de]=Jh(Ze,Se))}let dt=n[4];const Tt=de=>de[16].lang;for(let de=0;de<dt.length;de+=1){let Se=Wh(n,dt,de),Ze=Tt(Se);ne.set(Ze,K[de]=Gh(Ze,Se))}let Pt=(Et=n[0])==null?void 0:Et.schema;const Jt=de=>de[13].name;for(let de=0;de<Pt.length;de+=1){let Se=Uh(n,Pt,de),Ze=Jt(Se);Re.set(Ze,Le[de]=Zh(Ze,Se))}let he=n[3];const we=de=>de[8].code;for(let de=0;de<he.length;de+=1){let Se=Bh(n,he,de),Ze=we(Se);ge.set(Ze,Je[de]=xh(Ze,Se))}let Ge=n[3];const et=de=>de[8].code;for(let de=0;de<Ge.length;de+=1){let Se=zh(n,Ge,de),Ze=et(Se);Ue.set(Ze,ue[de]=Xh(Ze,Se))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),it&&it.c(),h=O(),g=_("div"),y=_("p"),b=H("Update a single "),v=_("strong"),S=H(C),$=H(" record."),M=O(),T=_("p"),T.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,E=O(),D=_("p"),D.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",P=O(),L=_("div"),L.textContent="Client SDKs example",R=O(),j=_("div"),G=_("div");for(let de=0;de<Y.length;de+=1)Y[de].c();Z=O(),J=_("div");for(let de=0;de<K.length;de+=1)K[de].c();ce=O(),be=_("div"),be.textContent="Path parameters",se=O(),x=_("table"),x.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to update.</td></tr></tbody>`,Te=O(),te=_("div"),te.textContent="Body Parameters",_e=O(),fe=_("table"),ie=_("thead"),ie.innerHTML=`<tr><th>Param</th>
|
||||
<th width="60%">Type</th>
|
||||
<th width="50%">Description</th></tr>`,ye=O(),He=_("tbody");for(let de=0;de<Le.length;de+=1)Le[de].c();ae=O(),re=_("div"),re.textContent="Responses",ve=O(),qe=_("div"),Ve=_("div");for(let de=0;de<Je.length;de+=1)Je[de].c();Ae=O(),X=_("div");for(let de=0;de<ue.length;de+=1)ue[de].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(L,"class","section-title"),p(G,"class","tabs-header compact left"),p(J,"class","tabs-content"),p(j,"class","tabs m-b-lg"),p(be,"class","section-title"),p(x,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(fe,"class","table-compact table-border m-b-lg"),p(re,"class","section-title"),p(Ve,"class","tabs-header compact left"),p(X,"class","tabs-content"),p(qe,"class","tabs")},m(de,Se){w(de,e,Se),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),it&&it.m(e,null),w(de,h,Se),w(de,g,Se),m(g,y),m(y,b),m(y,v),m(v,S),m(y,$),m(g,M),m(g,T),m(g,E),m(g,D),w(de,P,Se),w(de,L,Se),w(de,R,Se),w(de,j,Se),m(j,G);for(let Ze=0;Ze<Y.length;Ze+=1)Y[Ze].m(G,null);m(j,Z),m(j,J);for(let Ze=0;Ze<K.length;Ze+=1)K[Ze].m(J,null);w(de,ce,Se),w(de,be,Se),w(de,se,Se),w(de,x,Se),w(de,Te,Se),w(de,te,Se),w(de,_e,Se),w(de,fe,Se),m(fe,ie),m(fe,ye),m(fe,He);for(let Ze=0;Ze<Le.length;Ze+=1)Le[Ze].m(He,null);w(de,ae,Se),w(de,re,Se),w(de,ve,Se),w(de,qe,Se),m(qe,Ve);for(let Ze=0;Ze<Je.length;Ze+=1)Je[Ze].m(Ve,null);m(qe,Ae),m(qe,X);for(let Ze=0;Ze<ue.length;Ze+=1)ue[Ze].m(X,null);bt=!0},p(de,[Se]){var Ze;(!bt||Se&1)&&a!==(a=de[0].name+"")&&me(u,a),de[5]?it||(it=Kh(),it.c(),it.m(e,null)):it&&(it.d(1),it=null),(!bt||Se&1)&&C!==(C=de[0].name+"")&&me(S,C),Se&20&&(yt=de[4],Y=rt(Y,Se,ut,1,de,yt,q,G,fn,Jh,null,Yh)),Se&20&&(dt=de[4],Me(),K=rt(K,Se,Tt,1,de,dt,ne,J,Ft,Gh,null,Wh),Oe()),Se&1&&(Pt=(Ze=de[0])==null?void 0:Ze.schema,Le=rt(Le,Se,Jt,1,de,Pt,Re,He,fn,Zh,null,Uh)),Se&10&&(he=de[3],Je=rt(Je,Se,we,1,de,he,ge,Ve,fn,xh,null,Bh)),Se&10&&(Ge=de[3],Me(),ue=rt(ue,Se,et,1,de,Ge,Ue,X,Ft,Xh,null,zh),Oe())},i(de){if(!bt){for(let Se=0;Se<dt.length;Se+=1)A(K[Se]);for(let Se=0;Se<Ge.length;Se+=1)A(ue[Se]);bt=!0}},o(de){for(let Se=0;Se<K.length;Se+=1)F(K[Se]);for(let Se=0;Se<ue.length;Se+=1)F(ue[Se]);bt=!1},d(de){de&&k(e),it&&it.d(),de&&k(h),de&&k(g),de&&k(P),de&&k(L),de&&k(R),de&&k(j);for(let Se=0;Se<Y.length;Se+=1)Y[Se].d();for(let Se=0;Se<K.length;Se+=1)K[Se].d();de&&k(ce),de&&k(be),de&&k(se),de&&k(x),de&&k(Te),de&&k(te),de&&k(_e),de&&k(fe);for(let Se=0;Se<Le.length;Se+=1)Le[Se].d();de&&k(ae),de&&k(re),de&&k(ve),de&&k(qe);for(let Se=0;Se<Je.length;Se+=1)Je[Se].d();for(let Se=0;Se<ue.length;Se+=1)ue[Se].d()}}}function KO(n,e,t){let i,{collection:s=new Fn}=e,l=200,r="JavaScript",o=[],a=[];const u=c=>t(2,r=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,o=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to update record.",
|
||||
"data": {
|
||||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`},{code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.update("${s==null?void 0:s.name}", "RECORD_ID", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,l,r,o,a,i,u,f]}class JO extends Pe{constructor(e){super(),Ee(this,e,KO,YO,De,{collection:0})}}function Qh(n,e,t){const i=n.slice();return i[8]=e[t],i}function em(n,e,t){const i=n.slice();return i[8]=e[t],i}function tm(n,e,t){const i=n.slice();return i[13]=e[t],i}function nm(n,e,t){const i=n.slice();return i[13]=e[t],i}function im(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function sm(n,e){let t,i=e[13].lang+"",s,l,r,o;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&me(s,i),f&24&&ee(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),r=!1,o()}}}function lm(n,e){let t,i,s,l;return i=new sn({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[3]===e[13].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&16&&(a.content=e[13].code),i.$set(a),o&24&&ee(t,"active",e[3]===e[13].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function rm(n,e){let t,i=e[8].code+"",s,l,r,o;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&36&&ee(t,"active",e[2]===e[8].code)},d(u){u&&k(t),r=!1,o()}}}function om(n,e){let t,i,s,l;return i=new sn({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[2]===e[8].code),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r,o&36&&ee(t,"active",e[2]===e[8].code)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function GO(n){let e,t,i,s,l,r,o,a=n[0].name+"",u,f,c,d,h,g,y,b,v,C=n[0].name+"",S,$,M,T,E,D,P,L=[],R=new Map,j,G,Y=[],q=new Map,Z,J,K,ne,ce,be,se,x,Te,te=[],_e=new Map,fe,ie,ye=[],He=new Map,Le,Re=n[1]&&im(),ae=n[4];const re=X=>X[13].lang;for(let X=0;X<ae.length;X+=1){let ue=nm(n,ae,X),Ue=re(ue);R.set(Ue,L[X]=sm(Ue,ue))}let ve=n[4];const qe=X=>X[13].lang;for(let X=0;X<ve.length;X+=1){let ue=tm(n,ve,X),Ue=qe(ue);q.set(Ue,Y[X]=lm(Ue,ue))}let Ve=n[5];const Je=X=>X[8].code;for(let X=0;X<Ve.length;X+=1){let ue=em(n,Ve,X),Ue=Je(ue);_e.set(Ue,te[X]=rm(Ue,ue))}let ge=n[5];const Ae=X=>X[8].code;for(let X=0;X<ge.length;X+=1){let ue=Qh(n,ge,X),Ue=Ae(ue);He.set(Ue,ye[X]=om(Ue,ue))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=O(),s=_("div"),l=_("p"),r=H("/api/collections/"),o=_("strong"),u=H(a),f=H("/records/"),c=_("strong"),c.textContent=":id",d=O(),Re&&Re.c(),h=O(),g=_("div"),y=_("p"),b=H("Delete a single "),v=_("strong"),S=H(C),$=H(" record."),M=O(),T=_("div"),T.textContent="Client SDKs example",E=O(),D=_("div"),P=_("div");for(let X=0;X<L.length;X+=1)L[X].c();j=O(),G=_("div");for(let X=0;X<Y.length;X+=1)Y[X].c();Z=O(),J=_("div"),J.textContent="Path parameters",K=O(),ne=_("table"),ne.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to delete.</td></tr></tbody>`,ce=O(),be=_("div"),be.textContent="Responses",se=O(),x=_("div"),Te=_("div");for(let X=0;X<te.length;X+=1)te[X].c();fe=O(),ie=_("div");for(let X=0;X<ye.length;X+=1)ye[X].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(T,"class","section-title"),p(P,"class","tabs-header compact left"),p(G,"class","tabs-content"),p(D,"class","tabs m-b-lg"),p(J,"class","section-title"),p(ne,"class","table-compact table-border m-b-lg"),p(be,"class","section-title"),p(Te,"class","tabs-header compact left"),p(ie,"class","tabs-content"),p(x,"class","tabs")},m(X,ue){w(X,e,ue),m(e,t),m(e,i),m(e,s),m(s,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(e,d),Re&&Re.m(e,null),w(X,h,ue),w(X,g,ue),m(g,y),m(y,b),m(y,v),m(v,S),m(y,$),w(X,M,ue),w(X,T,ue),w(X,E,ue),w(X,D,ue),m(D,P);for(let Ue=0;Ue<L.length;Ue+=1)L[Ue].m(P,null);m(D,j),m(D,G);for(let Ue=0;Ue<Y.length;Ue+=1)Y[Ue].m(G,null);w(X,Z,ue),w(X,J,ue),w(X,K,ue),w(X,ne,ue),w(X,ce,ue),w(X,be,ue),w(X,se,ue),w(X,x,ue),m(x,Te);for(let Ue=0;Ue<te.length;Ue+=1)te[Ue].m(Te,null);m(x,fe),m(x,ie);for(let Ue=0;Ue<ye.length;Ue+=1)ye[Ue].m(ie,null);Le=!0},p(X,[ue]){(!Le||ue&1)&&a!==(a=X[0].name+"")&&me(u,a),X[1]?Re||(Re=im(),Re.c(),Re.m(e,null)):Re&&(Re.d(1),Re=null),(!Le||ue&1)&&C!==(C=X[0].name+"")&&me(S,C),ue&24&&(ae=X[4],L=rt(L,ue,re,1,X,ae,R,P,fn,sm,null,nm)),ue&24&&(ve=X[4],Me(),Y=rt(Y,ue,qe,1,X,ve,q,G,Ft,lm,null,tm),Oe()),ue&36&&(Ve=X[5],te=rt(te,ue,Je,1,X,Ve,_e,Te,fn,rm,null,em)),ue&36&&(ge=X[5],Me(),ye=rt(ye,ue,Ae,1,X,ge,He,ie,Ft,om,null,Qh),Oe())},i(X){if(!Le){for(let ue=0;ue<ve.length;ue+=1)A(Y[ue]);for(let ue=0;ue<ge.length;ue+=1)A(ye[ue]);Le=!0}},o(X){for(let ue=0;ue<Y.length;ue+=1)F(Y[ue]);for(let ue=0;ue<ye.length;ue+=1)F(ye[ue]);Le=!1},d(X){X&&k(e),Re&&Re.d(),X&&k(h),X&&k(g),X&&k(M),X&&k(T),X&&k(E),X&&k(D);for(let ue=0;ue<L.length;ue+=1)L[ue].d();for(let ue=0;ue<Y.length;ue+=1)Y[ue].d();X&&k(Z),X&&k(J),X&&k(K),X&&k(ne),X&&k(ce),X&&k(be),X&&k(se),X&&k(x);for(let ue=0;ue<te.length;ue+=1)te[ue].d();for(let ue=0;ue<ye.length;ue+=1)ye[ue].d()}}}function ZO(n,e,t){let i,{collection:s=new Fn}=e,l=204,r="JavaScript",o=[],a=[];const u=c=>t(3,r=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(o.push({code:204,body:`
|
||||
null
|
||||
`}),o.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&o.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),o.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
client.Records.delete("${s==null?void 0:s.name}", "RECORD_ID")
|
||||
.then(function () {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,r,a,o,u,f]}class xO extends Pe{constructor(e){super(),Ee(this,e,ZO,GO,De,{collection:0})}}function am(n,e,t){const i=n.slice();return i[4]=e[t],i}function um(n,e,t){const i=n.slice();return i[4]=e[t],i}function fm(n,e){let t,i=e[4].lang+"",s,l,r,o;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=H(i),l=O(),p(t,"class","tab-item"),ee(t,"active",e[1]===e[4].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),r||(o=Q(t,"click",a),r=!0)},p(u,f){e=u,f&4&&i!==(i=e[4].lang+"")&&me(s,i),f&6&&ee(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),r=!1,o()}}}function cm(n,e){let t,i,s,l;return i=new sn({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),B(i.$$.fragment),s=O(),p(t,"class","tab-item"),ee(t,"active",e[1]===e[4].lang),this.first=t},m(r,o){w(r,t,o),V(i,t,null),m(t,s),l=!0},p(r,o){e=r;const a={};o&4&&(a.content=e[4].code),i.$set(a),o&6&&ee(t,"active",e[1]===e[4].lang)},i(r){l||(A(i.$$.fragment,r),l=!0)},o(r){F(i.$$.fragment,r),l=!1},d(r){r&&k(t),z(i)}}}function XO(n){let e,t,i,s,l,r,o,a,u=[],f=new Map,c,d,h=[],g=new Map,y,b,v,C,S,$=n[2];const M=D=>D[4].lang;for(let D=0;D<$.length;D+=1){let P=um(n,$,D),L=M(P);f.set(L,u[D]=fm(L,P))}let T=n[2];const E=D=>D[4].lang;for(let D=0;D<T.length;D+=1){let P=am(n,T,D),L=E(P);g.set(L,h[D]=cm(L,P))}return C=new sn({props:{content:JSON.stringify({action:"create",record:W.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||||
<div class="content"><p>/api/realtime</p></div>`,t=O(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>Events are send for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||||
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||||
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||||
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p>
|
||||
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p></div></div>`,s=O(),l=_("div"),l.textContent="Client SDKs example",r=O(),o=_("div"),a=_("div");for(let D=0;D<u.length;D+=1)u[D].c();c=O(),d=_("div");for(let D=0;D<h.length;D+=1)h[D].c();y=O(),b=_("div"),b.textContent="Event data format",v=O(),B(C.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(a,"class","tabs-header compact left"),p(d,"class","tabs-content"),p(o,"class","tabs m-b-base"),p(b,"class","section-title")},m(D,P){w(D,e,P),w(D,t,P),w(D,i,P),w(D,s,P),w(D,l,P),w(D,r,P),w(D,o,P),m(o,a);for(let L=0;L<u.length;L+=1)u[L].m(a,null);m(o,c),m(o,d);for(let L=0;L<h.length;L+=1)h[L].m(d,null);w(D,y,P),w(D,b,P),w(D,v,P),V(C,D,P),S=!0},p(D,[P]){P&6&&($=D[2],u=rt(u,P,M,1,D,$,f,a,fn,fm,null,um)),P&6&&(T=D[2],Me(),h=rt(h,P,E,1,D,T,g,d,Ft,cm,null,am),Oe());const L={};P&1&&(L.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(D[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),C.$set(L)},i(D){if(!S){for(let P=0;P<T.length;P+=1)A(h[P]);A(C.$$.fragment,D),S=!0}},o(D){for(let P=0;P<h.length;P+=1)F(h[P]);F(C.$$.fragment,D),S=!1},d(D){D&&k(e),D&&k(t),D&&k(i),D&&k(s),D&&k(l),D&&k(r),D&&k(o);for(let P=0;P<u.length;P+=1)u[P].d();for(let P=0;P<h.length;P+=1)h[P].d();D&&k(y),D&&k(b),D&&k(v),z(C,D)}}}function QO(n,e,t){let{collection:i=new Fn}=e,s="JavaScript",l=[];const r=o=>t(1,s=o.lang);return n.$$set=o=>{"collection"in o&&t(0,i=o.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.Users.authViaEmail("test@example.com", "123456");
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.Realtime.unsubscribe() // remove all subscriptions
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
|
||||
`}])},[i,s,l,r]}class eT extends Pe{constructor(e){super(),Ee(this,e,QO,XO,De,{collection:0})}}function dm(n,e,t){const i=n.slice();return i[14]=e[t],i}function pm(n,e,t){const i=n.slice();return i[14]=e[t],i}function hm(n){let e,t,i,s;var l=n[14].component;function r(o){return{props:{collection:o[3]}}}return l&&(t=new l(r(n))),{c(){e=_("div"),t&&B(t.$$.fragment),i=O(),p(e,"class","tab-item active")},m(o,a){w(o,e,a),t&&V(t,e,null),m(e,i),s=!0},p(o,a){const u={};if(a&8&&(u.collection=o[3]),l!==(l=o[14].component)){if(t){Me();const f=t;F(f.$$.fragment,1,0,()=>{z(f,1)}),Oe()}l?(t=new l(r(o)),B(t.$$.fragment),A(t.$$.fragment,1),V(t,e,i)):t=null}else l&&t.$set(u)},i(o){s||(t&&A(t.$$.fragment,o),s=!0)},o(o){t&&F(t.$$.fragment,o),s=!1},d(o){o&&k(e),t&&z(t)}}}function mm(n,e){let t,i,s,l=e[4]===e[14].id&&hm(e);return{key:n,first:null,c(){t=st(),l&&l.c(),i=st(),this.first=t},m(r,o){w(r,t,o),l&&l.m(r,o),w(r,i,o),s=!0},p(r,o){e=r,e[4]===e[14].id?l?(l.p(e,o),o&16&&A(l,1)):(l=hm(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Me(),F(l,1,1,()=>{l=null}),Oe())},i(r){s||(A(l),s=!0)},o(r){F(l),s=!1},d(r){r&&k(t),l&&l.d(r),r&&k(i)}}}function tT(n){let e,t=[],i=new Map,s,l=n[5];const r=o=>o[14].id;for(let o=0;o<l.length;o+=1){let a=dm(n,l,o),u=r(a);i.set(u,t[o]=mm(u,a))}return{c(){e=_("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","tabs-content")},m(o,a){w(o,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(o,a){a&56&&(l=o[5],Me(),t=rt(t,a,r,1,o,l,i,e,Ft,mm,null,dm),Oe())},i(o){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(o){for(let a=0;a<t.length;a+=1)F(t[a]);s=!1},d(o){o&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function gm(n,e){let t,i,s=e[14].label+"",l,r,o,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=H(s),r=O(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ee(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,r),o||(a=[Q(t,"click",u),Q(t,"keydown",Kg(f))],o=!0)},p(c,d){e=c,d&48&&ee(t,"active",e[4]===e[14].id)},d(c){c&&k(t),o=!1,lt(a)}}}function nT(n){let e,t,i=n[3].name+"",s,l,r,o,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=pm(n,f,d),g=c(h);u.set(g,a[d]=gm(g,h))}return{c(){e=_("h4"),t=_("strong"),s=H(i),l=H(" records API"),r=O(),o=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(o,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,r,h),w(d,o,h);for(let g=0;g<a.length;g+=1)a[g].m(o,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&me(s,i),h&114&&(f=d[5],a=rt(a,h,c,1,d,f,u,o,fn,gm,null,pm))},d(d){d&&k(e),d&&k(r),d&&k(o);for(let h=0;h<a.length;h+=1)a[h].d()}}}function iT(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function sT(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[iT],header:[nT],default:[tT]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const r={};l&524312&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[11](null),z(e,s)}}}function lT(n,e,t){const i=[{id:"list",label:"List",component:yO},{id:"view",label:"View",component:wO},{id:"create",label:"Create",component:IO},{id:"update",label:"Update",component:JO},{id:"delete",label:"Delete",component:xO},{id:"realtime",label:"Realtime",component:eT}];let s,l=new Fn,r=i[0].id;function o(v){return t(3,l=v),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(v){t(4,r=v)}function f(v,C){(v.code==="Enter"||v.code==="Space")&&(v.preventDefault(),u(C))}const c=()=>a(),d=v=>u(v.id),h=(v,C)=>f(C,v.id);function g(v){pe[v?"unshift":"push"](()=>{s=v,t(2,s)})}function y(v){ft.call(this,n,v)}function b(v){ft.call(this,n,v)}return[a,u,s,l,r,i,f,o,c,d,h,g,y,b]}class rT extends Pe{constructor(e){super(),Ee(this,e,lT,sT,De,{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 oT(n){let e,t,i,s=[n[3]],l={};for(let r=0;r<s.length;r+=1)l=ct(l,s[r]);return{c(){e=_("textarea"),ci(e,l),ee(e,"svelte-1x1pbts",!0)},m(r,o){w(r,e,o),e.autofocus&&e.focus(),n[5](e),Ce(e,n[0]),t||(i=[Q(e,"input",n[6]),Q(e,"keydown",n[2])],t=!0)},p(r,[o]){ci(e,l=bn(s,[o&8&&r[3]])),o&1&&Ce(e,r[0]),ee(e,"svelte-1x1pbts",!0)},i:oe,o:oe,d(r){r&&k(e),n[5](null),t=!1,lt(i)}}}function aT(n,e,t){const i=["value","maxHeight"];let s=Ut(e,i),{value:l=""}=e,{maxHeight:r=200}=e,o,a;function u(){clearTimeout(a),a=setTimeout(()=>{o&&(t(1,o.style.height="",o),t(1,o.style.height=Math.min(o.scrollHeight+2,r)+"px",o))},0)}function f(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const g=o.closest("form");g
Line truncated
|
||||
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(o,a){w(o,e,a),m(e,t),n[18](t),m(e,i),m(e,s),l||(r=[Q(t,"change",n[19]),Q(s,"click",n[20])],l=!0)},p(o,a){a&32&&(t.multiple=o[5])},d(o){o&&k(e),n[18](null),l=!1,lt(r)}}}function sD(n){let e,t,i,s,l,r=n[3].name+"",o,a,u,f,c=[],d=new Map,h,g,y,b=n[4];const v=T=>T[28];for(let T=0;T<b.length;T+=1){let E=ym(n,b,T),D=v(E);d.set(D,c[T]=vm(D,E))}let C=n[0],S=[];for(let T=0;T<C.length;T+=1)S[T]=km(bm(n,C,T));const $=T=>F(S[T],1,1,()=>{S[T]=null});let M=!n[9]&&wm(n);return{c(){e=_("label"),t=_("i"),s=O(),l=_("span"),o=H(r),u=O(),f=_("div");for(let T=0;T<c.length;T+=1)c[T].c();h=O();for(let T=0;T<S.length;T+=1)S[T].c();g=O(),M&&M.c(),p(t,"class",i=W.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[24]),p(f,"class","files-list")},m(T,E){w(T,e,E),m(e,t),m(e,s),m(e,l),m(l,o),w(T,u,E),w(T,f,E);for(let D=0;D<c.length;D+=1)c[D].m(f,null);m(f,h);for(let D=0;D<S.length;D+=1)S[D].m(f,null);m(f,g),M&&M.m(f,null),n[21](f),y=!0},p(T,E){if((!y||E&8&&i!==(i=W.getFieldTypeIcon(T[3].type)))&&p(t,"class",i),(!y||E&8)&&r!==(r=T[3].name+"")&&me(o,r),(!y||E&16777216&&a!==(a=T[24]))&&p(e,"for",a),E&3222&&(b=T[4],Me(),c=rt(c,E,v,1,T,b,d,f,Ft,vm,h,ym),Oe()),E&4097){C=T[0];let D;for(D=0;D<C.length;D+=1){const P=bm(T,C,D);S[D]?(S[D].p(P,E),A(S[D],1)):(S[D]=km(P),S[D].c(),A(S[D],1),S[D].m(f,g))}for(Me(),D=C.length;D<S.length;D+=1)$(D);Oe()}T[9]?M&&(M.d(1),M=null):M?M.p(T,E):(M=wm(T),M.c(),M.m(f,null))},i(T){if(!y){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<C.length;E+=1)A(S[E]);y=!0}},o(T){for(let E=0;E<c.length;E+=1)F(c[E]);S=S.filter(Boolean);for(let E=0;E<S.length;E+=1)F(S[E]);y=!1},d(T){T&&k(e),T&&k(u),T&&k(f);for(let E=0;E<c.length;E+=1)c[E].d();Bn(S,T),M&&M.d(),n[21](null)}}}function lD(n){let e,t,i,s;e=new Fe({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[sD,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}});let l={};return i=new xT({props:l}),n[22](i),{c(){B(e.$$.fragment),t=O(),B(i.$$.fragment)},m(r,o){V(e,r,o),w(r,t,o),V(i,r,o),s=!0},p(r,[o]){const a={};o&8&&(a.class="form-field form-field-file "+(r[3].required?"required":"")),o&8&&(a.name=r[3].name),o&1090520063&&(a.$$scope={dirty:o,ctx:r}),e.$set(a);const u={};i.$set(u)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){F(e.$$.fragment,r),F(i.$$.fragment,r),s=!1},d(r){z(e,r),r&&k(t),n[22](null),z(i,r)}}}function rD(n,e,t){let i,s,l,{record:r}=e,{value:o=null}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new wn}=e,c,d,h;function g(R){W.removeByValue(u,R),t(1,u)}function y(R){W.pushUnique(u,R),t(1,u)}function b(R){W.isEmpty(a[R])||a.splice(R,1),t(0,a)}function v(){h==null||h.dispatchEvent(new CustomEvent("change",{detail:{value:o,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const C=R=>W.hasImageExtension(R)?d==null?void 0:d.show(ke.Records.getFileUrl(r,R)):!1,S=R=>g(R),$=R=>y(R),M=R=>b(R);function T(R){pe[R?"unshift":"push"](()=>{c=R,t(6,c)})}const E=()=>{for(let R of c.files)a.push(R);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function P(R){pe[R?"unshift":"push"](()=>{h=R,t(8,h)})}function L(R){pe[R?"unshift":"push"](()=>{d=R,t(7,d)})}return n.$$set=R=>{"record"in R&&t(2,r=R.record),"value"in R&&t(13,o=R.value),"uploadedFiles"in R&&t(0,a=R.uploadedFiles),"deletedFileIndexes"in R&&t(1,u=R.deletedFileIndexes),"field"in R&&t(3,f=R.field)},n.$$.update=()=>{var R,j;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((R=f.options)==null?void 0:R.maxSelect)>1),n.$$.dirty&8224&&(typeof o=="undefined"||o===null)&&t(13,o=i?[]:null),n.$$.dirty&8192&&t(4,s=W.toArray(o)),n.$$.dirty&27&&t(9,l=(s.length||a.length)&&((j=f.options)==null?void 0:j.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&v()},[a,u,r,f,s,i,c,d,h,l,g,y,b,o,C,S,$,M,T,E,D,P,L]}class oD extends Pe{constructor(e){super(),Ee(this,e,rD,lD,De,{record:2,value:13,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function Sm(n){let e,t;return{c(){e=_("small"),t=H(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&me(t,i[1])},d(i){i&&k(e)}}}function aD(n){let e,t,i,s,l,r=n[0].id+"",o,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&Sm(n);return{c(){e=_("i"),i=O(),s=_("div"),l=_("div"),o=H(r),a=O(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,o),m(s,a),c&&c.m(s,null),u||(f=Xe(t=St.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Jn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&r!==(r=d[0].id+"")&&me(o,r),d[1]!==""&&Line truncated
|
||||
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function AD(n){let e,t,i;function s(r){n[31](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new TD({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function ED(n){let e,t,i;function s(r){n[30](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new bD({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function PD(n){let e,t,i,s,l;function r(f){n[27](f,n[40])}function o(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new oD({props:u}),pe.push(()=>Ie(e,"value",r)),pe.push(()=>Ie(e,"uploadedFiles",o)),pe.push(()=>Ie(e,"deletedFileIndexes",a)),{c(){B(e.$$.fragment)},m(f,c){V(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],je(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],je(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],je(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){F(e.$$.fragment,f),l=!1},d(f){z(e,f)}}}function LD(n){let e,t,i;function s(r){n[26](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new VT({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function FD(n){let e,t,i;function s(r){n[25](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new RT({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function ID(n){let e,t,i;function s(r){n[24](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new LT({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function ND(n){let e,t,i;function s(r){n[23](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new DT({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function RD(n){let e,t,i;function s(r){n[22](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new $T({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function jD(n){let e,t,i;function s(r){n[21](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new kT({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function HD(n){let e,t,i;function s(r){n[20](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new _T({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;const a={};o[0]&1&&(a.field=n[40]),!t&&o[0]&5&&(t=!0,a.value=n[2][n[40].name],je(()=>t=!1)),e.$set(a)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){F(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function qD(n){let e,t,i;function s(r){n[19](r,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new pT({props:l}),pe.push(()=>Ie(e,"value",s)),{c(){B(e.$$.fragment)},m(r,o){V(e,r,o),i=!0},p(r,o){n=r;
Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function BD(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",r,o,a,u,f,c=!n[2].isNew&&n[9]&&Pm(n);return{c(){e=_("h4"),i=H(t),s=O(),r=H(l),o=H(" record"),a=O(),c&&c.c(),u=st()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,r),m(e,o),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&me(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&me(r,l),!d[2].isNew&&d[9]?c?(c.p(d,h),h[0]&516&&A(c,1)):(c=Pm(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Me(),F(c,1,1,()=>{c=null}),Oe())},i(d){f||(A(c),f=!0)},o(d){F(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function UD(n){let e,t,i,s,l,r=n[2].isNew?"Create":"Save changes",o,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=O(),s=_("button"),l=_("span"),o=H(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ee(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,o),u||(f=Q(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&r!==(r=c[2].isNew?"Create":"Save changes")&&me(o,r),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&ee(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function WD(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[UD],header:[BD],default:[VD]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&288&&(r.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[33](null),z(e,s)}}}function Lm(n){return JSON.stringify(n)}function YD(n,e,t){let i,s,l,r;const o=_n(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new no,h=!1,g=!1,y={},b={},v="";function C(fe){return $(fe),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}function $(fe){Ki({}),c=fe||{},t(2,d=fe!=null&&fe.clone?fe.clone():new no),t(3,y={}),t(4,b={}),t(15,v=Lm(d))}function M(){if(h||!s)return;t(7,h=!0);const fe=E();let ie;d.isNew?ie=ke.Records.create(u==null?void 0:u.id,fe):ie=ke.Records.update(u==null?void 0:u.id,d.id,fe),ie.then(async ye=>{mn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),o("save",ye)}).catch(ye=>{ke.errorResponseHandler(ye)}).finally(()=>{t(7,h=!1)})}function T(){!(c!=null&&c.id)||Mi("Do you really want to delete the selected record?",()=>ke.Records.delete(c["@collectionId"],c.id).then(()=>{S(),mn("Successfully deleted record."),o("delete",c)}).catch(fe=>{ke.errorResponseHandler(fe)}))}function E(){const fe=(d==null?void 0:d.export())||{},ie=new FormData,ye={};for(const He of(u==null?void 0:u.schema)||[])ye[He.name]=He;for(const He in fe)!ye[He]||(typeof fe[He]=="undefined"&&(fe[He]=null),W.addValueToFormData(ie,He,fe[He]));for(const He in y){const Le=W.toArray(y[He]);for(const Re of Le)ie.append(He,Re)}for(const He in b){const Le=W.toArray(b[He]);for(const Re of Le)ie.append(He+"."+Re,"")}return ie}const D=()=>S(),P=()=>T();function L(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function R(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function j(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function G(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function Y(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function q(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function Z(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function J(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function K(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function ne(fe,ie){n.$$.not_equal(y[ie.name],fe)&&(y[ie.name]=fe,t(3,y))}function ce(fe,ie){n.$$.not_equal(b[ie.name],fe)&&(b[ie.name]=fe,t(4,b))}function be(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}function se(fe,ie){n.$$.not_equal(d[ie.name],fe)&&(d[ie.name]=fe,t(2,d))}const x=()=>s&&g?(Mi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),S()}),!1):!0;function Te(fe){pe[fe?"unshift":"push"](()=>{f=fe,t(6,f)})}function te(fe){ft.call(this,n,fe)}function _e(fe){ft.call(this,n,fe)}return n.$$set=fe=>{"collection"in fe&&t(0,u=fe.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=W.hasNonEmptyProps(y)||W.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||v!=Lm(d)),n.$$.dirty[0]&36&&t(10,l=d.isNew||s),n.$$.dirty[0]&1&&t(9,r=(u==null?void 0:u.name)!=="profiles")},[u,S,d,y,b,s,f,h,g,r,l,a,M,T,C,v,i,D,P,L,R,j,G,Y,q,Z,J,K,ne,ce,be,se,x,Te,te,_e]}class qb extends Pe{constructor(e){super(),Ee(this,e,YD,WD,De,{collLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Wm(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Ym(n,e){let t,i,s;return i=new Vb({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=st(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r[0]&8&&(o.record=e[35]),r[0]&2048&&(o.field=e[38]),i.$set(o)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function Km(n,e){let t,i,s,l,r,o,a,u,f,c,d,h,g,y=[],b=new Map,v,C,S,$,M,T,E,D,P,L,R,j;function G(){return e[25](e[35])}h=new jo({props:{id:e[35].id}});let Y=e[11];const q=K=>K[38].name;for(let K=0;K<Y.length;K+=1){let ne=Vm(e,Y,K),ce=q(ne);b.set(ce,y[K]=Ym(ce,ne))}S=new $i({props:{date:e[35].created}}),T=new $i({props:{date:e[35].updated}});function Z(){return e[26](e[35])}function J(...K){return e[27](e[35],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=O(),u=_("label"),c=O(),d=_("td"),B(h.$$.fragment),g=O();for(let K=0;K<y.length;K+=1)y[K].c();v=O(),C=_("td"),B(S.$$.fragment),$=O(),M=_("td"),B(T.$$.fragment),E=O(),D=_("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',P=O(),p(l,"type","checkbox"),p(l,"id",r="checkbox_"+e[35].id),l.checked=o=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(K,ne){w(K,t,ne),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),V(h,d,null),m(t,g);for(let ce=0;ce<y.length;ce+=1)y[ce].m(t,null);m(t,v),m(t,C),V(S,C,null),m(t,$),m(t,M),V(T,M,null),m(t,E),m(t,D),m(t,P),L=!0,R||(j=[Q(l,"change",G),Q(s,"click",Un(e[19])),Q(t,"click",Z),Q(t,"keydown",J)],R=!0)},p(K,ne){e=K,(!L||ne[0]&8&&r!==(r="checkbox_"+e[35].id))&&p(l,"id",r),(!L||ne[0]&40&&o!==(o=e[5][e[35].id]))&&(l.checked=o),(!L||ne[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const ce={};ne[0]&8&&(ce.id=e[35].id),h.$set(ce),ne[0]&2056&&(Y=e[11],Me(),y=rt(y,ne,q,1,e,Y,b,t,Ft,Ym,v,Vm),Oe());const be={};ne[0]&8&&(be.date=e[35].created),S.$set(be);const se={};ne[0]&8&&(se.date=e[35].updated),T.$set(se)},i(K){if(!L){A(h.$$.fragment,K);for(let ne=0;ne<Y.length;ne+=1)A(y[ne]);A(S.$$.fragment,K),A(T.$$.fragment,K),L=!0}},o(K){F(h.$$.fragment,K);for(let ne=0;ne<y.length;ne+=1)F(y[ne]);F(S.$$.fragment,K),F(T.$$.fragment,K),L=!1},d(K){K&&k(t),z(h);for(let ne=0;ne<y.length;ne+=1)y[ne].d();z(S),z(T),R=!1,lt(j)}}}function Jm(n){let e,t,i=n[3].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a[0]&8&&i!==(i=o[3].length+"")&&me(s,i),a[0]&16&&me(r,o[4])},d(o){o&&k(e)}}}function Gm(n){let e,t,i,s,l=n[4]-n[3].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[8]),ee(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=Q(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&me(r,l),c[0]&256&&ee(t,"btn-loading",f[8]),c[0]&256&&ee(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Zm(n){let e,t,i,s,l,r,o=n[6]===1?"record":"records",a,u,f,c,d,h,g,y,b,v,C;return{c(){e=_("div"),t=_("div"),i=H("Selected "),s=_("strong"),l=H(n[6]),r=O(),a=H(o),u=O(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=O(),d=_("div"),h=O(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ee(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),ee(g,"btn-loading",n[9]),ee(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(S,$){w(S,e,$),m(e,t),m(t,i),m(t,s),m(s,l),m(t,r),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,h),m(e,g),b=!0,v||(C=[Q(f,"click",n[30]),Q(g,"click",n[31])],v=!0)},p(S,$){(!b||$[0]&64)&&me(l,S[6]),(!b||$[0]&64)&&o!==(o=S[6]===1?"record":"records")&&me(a,o),$[0]&512&&ee(f,"btn-disabled",S[9]),$[0]&512&&ee(g,"btn-loading",S[9]),$[0]&512&&ee(g,"btn-disabled",S[9])},i(S){b||(S&&Mt(()=>{y||(y=at(e,ni,{duration:150,y:5},!0)),y.run(1)}),b=!0)},o(S){S&&(y||(y=at(e,ni,{duration:150,y:5},!1)),y.run(0)),b=!1},d(S){S&&k(e),S&&y&&y.end(),v=!1,lt(C)}}}function hA(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y=[],b=new Map,v,C,S,$,M,T,E,D,P,L,R=[],j=new Map,G,Y,q,Z,J,K,ne;function ce(re){n[21](re)}let be={class:"col-type-text col-field-
Line truncated
|
||||
<span class="txt">API Preview</span>`,b=O(),v=_("button"),v.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New record</span>`,C=O(),B(S.$$.fragment),$=O(),B(M.$$.fragment),p(r,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(l,"class","breadcrumbs"),p(d,"type","button"),p(d,"class","btn btn-secondary btn-circle"),p(y,"type","button"),p(y,"class","btn btn-outline"),p(v,"type","button"),p(v,"class","btn btn-expanded"),p(g,"class","btns-group"),p(s,"class","page-header"),p(i,"class","page-wrapper")},m(Y,q){V(e,Y,q),w(Y,t,q),w(Y,i,q),m(i,s),m(s,l),m(l,r),m(l,o),m(l,a),m(a,f),m(s,c),m(s,d),m(s,h),m(s,g),m(g,y),m(g,b),m(g,v),m(i,C),V(S,i,null),m(i,$),V(M,i,null),D=!0,P||(L=[Xe(St.call(null,d,{text:"Edit collection",position:"right"})),Q(d,"click",n[12]),Q(y,"click",n[13]),Q(v,"click",n[14])],P=!0)},p(Y,q){(!D||q&4)&&u!==(u=Y[2].name+"")&&me(f,u);const Z={};q&1&&(Z.value=Y[0]),q&4&&(Z.autocompleteCollection=Y[2]),S.$set(Z);const J={};q&4&&(J.collection=Y[2]),!T&&q&1&&(T=!0,J.filter=Y[0],je(()=>T=!1)),!E&&q&2&&(E=!0,J.sort=Y[1],je(()=>E=!1)),M.$set(J)},i(Y){D||(A(e.$$.fragment,Y),A(S.$$.fragment,Y),A(M.$$.fragment,Y),D=!0)},o(Y){F(e.$$.fragment,Y),F(S.$$.fragment,Y),F(M.$$.fragment,Y),D=!1},d(Y){z(e,Y),Y&&k(t),Y&&k(i),z(S),n[16](null),z(M),P=!1,lt(L)}}}function bA(n){let e,t,i,s,l,r,o,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=O(),s=_("h1"),s.textContent="Create your first collection to add records!",l=O(),r=_("button"),r.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">Create new collection</span>`,p(t,"class","icon"),p(s,"class","m-b-10"),p(r,"type","button"),p(r,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,r),o||(a=Q(r,"click",n[11]),o=!0)},p:oe,i:oe,o:oe,d(u){u&&k(e),o=!1,a()}}}function yA(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function vA(n){let e,t,i,s,l,r,o,a,u;const f=[yA,bA,_A],c=[];function d(b,v){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new gf({props:h}),n[20](s);let g={};r=new rT({props:g}),n[21](r);let y={collection:n[2]};return a=new qb({props:y}),n[22](a),a.$on("save",n[23]),a.$on("delete",n[24]),{c(){t.c(),i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment)},m(b,v){c[e].m(b,v),w(b,i,v),V(s,b,v),w(b,l,v),V(r,b,v),w(b,o,v),V(a,b,v),u=!0},p(b,[v]){let C=e;e=d(b),e===C?c[e].p(b,v):(Me(),F(c[C],1,1,()=>{c[C]=null}),Oe(),t=c[e],t?t.p(b,v):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const $={};r.$set($);const M={};v&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(r.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){F(t),F(s.$$.fragment,b),F(r.$$.fragment,b),F(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[20](null),z(s,b),b&&k(l),n[21](null),z(r,b),b&&k(o),n[22](null),z(a,b)}}}function kA(n,e,t){var G;let i,s,l,r;hn(n,fi,Y=>t(2,s=Y)),hn(n,Gs,Y=>t(10,l=Y)),hn(n,mu,Y=>t(8,r=Y));const o=W.getQueryParams((G=window.location)==null?void 0:G.href);let a,u,f,c,d=o.filter||"",h=o.sort||"-created",g=o.collectionId;W.setDocumentTitle("Collections"),N$(g);const y=()=>a==null?void 0:a.show(),b=()=>a==null?void 0:a.show(s),v=()=>u==null?void 0:u.show(s),C=()=>f==null?void 0:f.show(),S=Y=>t(0,d=Y.detail);function $(Y){pe[Y?"unshift":"push"](()=>{c=Y,t(6,c)})}function M(Y){d=Y,t(0,d),t(2,s),t(9,g)}function T(Y){h=Y,t(1,h),t(2,s),t(9,g)}const E=Y=>f==null?void 0:f.show(Y==null?void 0:Y.detail);function D(Y){pe[Y?"unshift":"push"](()=>{a=Y,t(3,a)})}function P(Y){pe[Y?"unshift":"push"](()=>{u=Y,t(4,u)})}function L(Y){pe[Y?"unshift":"push"](()=>{f=Y,t(5,f)})}const R=()=>c==null?void 0:c.load(),j=()=>c==null?void 0:c.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&g!=s.id&&(t(9,g=s.id),t(1,h="-created"),t(0,d="")),n.$$.dirty&7&&(h||d||(s==null?void 0:s.id))&&W.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:d,sort:h})},[d,h,s,a,u,f,c,i,r,g,l,y,b,v,C,S,$,M,T,E,D,P,L,R,j]}class wA extends Pe{constructor(e){super(),Ee(this,e,kA,vA,De,{})}}function xm(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[SA,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function SA(n){let e,t,i,s,l,r,o,a,u;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="ID",r=O(),o=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(o,"type","text"),p(o,"id",a=n[31]),o.value=u=n[1].id,o.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,r,c),w(f,o,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(o,"id",a),c[0]&2&&u!==(u=f[1].id)&&o.value!==u&&(o.value=u)},d(f){f&&k(e),f&&k(r),f&&k(o)}}}function Xm(n){let e,t,i,s;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(l,r){w(l,e,r),i||(s=Xe(t=St.call(null,e,"Verified")),i=!0)},d(l){l&&k(e),i=!1,s()}}}function CA(n){let e,t,i,s,l,r,o,a,u,f,c,d=n[1].verified&&Xm();return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="Email",r=O(),d&&d.c(),o=O(),a=_("input"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,r,g),d&&d.m(h,g),w(h,o,g),w(h,a,g),Ce(a,n[2]),f||(c=Q(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Xm(),d.c(),d.m(o.parentNode,o)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=h[31])&&p(a,"id",u),g[0]&4&&a.value!==h[2]&&Ce(a,h[2])},d(h){h&&k(e),h&&k(r),d&&d.d(h),h&&k(o),h&&k(a),f=!1,c()}}}function Qm(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[$A,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function $A(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(s,"for",r=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),o||(a=Q(e,"change",n[20]),o=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&r!==(r=u[31])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function eg(n){let e,t,i,s,l,r,o,a,u;return s=new Fe({props:{class:"form-field required",name:"pasLine truncated
|
||||
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function EA(n){let e,t,i,s,l=!n[1].verified&&ig(n);return{c(){l&&l.c(),e=O(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(r,o){l&&l.m(r,o),w(r,e,o),w(r,t,o),i||(s=Q(t,"click",n[17]),i=!0)},p(r,o){r[1].verified?l&&(l.d(1),l=null):l?l.p(r,o):(l=ig(r),l.c(),l.m(e.parentNode,e))},d(r){l&&l.d(r),r&&k(e),r&&k(t),i=!1,s()}}}function PA(n){let e,t,i,s,l,r,o=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&ng(n);return{c(){h&&h.c(),e=O(),t=_("button"),i=_("span"),i.textContent="Cancel",s=O(),l=_("button"),r=_("span"),a=H(o),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ee(l,"btn-loading",n[5])},m(g,y){h&&h.m(g,y),w(g,e,y),w(g,t,y),m(t,i),w(g,s,y),w(g,l,y),m(l,r),m(r,a),f=!0,c||(d=Q(t,"click",n[18]),c=!0)},p(g,y){g[1].isNew?h&&(Me(),F(h,1,1,()=>{h=null}),Oe()):h?(h.p(g,y),y[0]&2&&A(h,1)):(h=ng(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||y[0]&32)&&(t.disabled=g[5]),(!f||y[0]&2)&&o!==(o=g[1].isNew?"Create":"Save changes")&&me(a,o),(!f||y[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),y[0]&32&&ee(l,"btn-loading",g[5])},i(g){f||(A(h),f=!0)},o(g){F(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function LA(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[PA],header:[AA],default:[DA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&1088&&(r.beforeHide=s[24]),l[0]&1966|l[1]&2&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[25](null),z(e,s)}}}function FA(n,e,t){let i;const s=_n(),l="user_"+W.randomString(5);let r,o=new io,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function y(K){return v(K),t(6,u=!0),r==null?void 0:r.show()}function b(){return r==null?void 0:r.hide()}function v(K){Ki({}),t(1,o=K!=null&&K.clone?K.clone():new io),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(o==null?void 0:o.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const K={email:f};(o.isNew||h)&&(K.password=c,K.passwordConfirm=d);let ne;o.isNew?ne=ke.Users.create(K):ne=ke.Users.update(o.id,K),ne.then(async ce=>{g&&M(!1),t(6,u=!1),b(),mn(o.isNew?"Successfully created user.":"Successfully updated user."),s("save",ce)}).catch(ce=>{ke.errorResponseHandler(ce)}).finally(()=>{t(5,a=!1)})}function $(){!(o!=null&&o.id)||Mi("Do you really want to delete the selected user?",()=>ke.Users.delete(o.id).then(()=>{t(6,u=!1),b(),mn("Successfully deleted user."),s("delete",o)}).catch(K=>{ke.errorResponseHandler(K)}))}function M(K=!0){return ke.Users.requestVerification(o.isNew?f:o.email).then(()=>{t(6,u=!1),b(),K&&mn(`Successfully sent verification email to ${o.email}.`)}).catch(ne=>{ke.errorResponseHandler(ne)})}const T=()=>M(),E=()=>$(),D=()=>b();function P(){f=this.value,t(2,f)}function L(){h=this.checked,t(3,h)}function R(){c=this.value,t(7,c)}function j(){d=this.value,t(8,d)}function G(){g=this.checked,t(9,g)}const Y=()=>i&&u?(Mi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function q(K){pe[K?"unshift":"push"](()=>{r=K,t(4,r)})}function Z(K){ft.call(this,n,K)}function J(K){ft.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=o.isNew&&f!=""||h||f!==o.email)},[b,o,f,h,r,a,u,c,d,g,i,l,S,$,M,y,T,E,D,P,L,R,j,G,Y,q,Z,J]}class IA extends Pe{constructor(e){super(),Ee(this,e,FA,LA,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function sg(n,e,t){const i=n.slice();return i[37]=e[t],i}function lg(n,e,t){const i=n.slice();return i[40]=e[t],i}function rg(n,e,t){const i=n.slice();return i[40]=e[t],i}function NA(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S,$,M,T,E=[],D=new Map,P,L,R,j,G,Y,q,Z,J,K,ne=[],ce=new Map,be,se,x,Te,te;c=new Po({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),c.$on("submit",n[17]);function _e(X){n[18](X)}let fe={class:"col-type-text col-field-id",name:"id",$$slots:{default:[jA]},$$scope:{ctx:n}};n[4]!==void 0&&(fe.sort=n[4]),v=new nn({props:fe}),pe.push(()=>Ie(v,"sort",_e));function ie(X){n[19](X)}let ye={class:"col-type-email col-field-email",name:"email",$$slots:{default:[HA]},$$scope:{ctx:n}};n[4]!==void 0&&(ye.sort=n[4]),$=new nn({props:ye}),pe.push(()=>Ie($,"sort",ie));let He=n[12];const Le=X=>X[40].name;for(let X=0;X<He.length;X+=1){let ue=rg(n,He,X),Ue=Le(ue);D.set(Ue,E[X]=og(Ue,ue))}function Re(X){n[20](X)}let ae={class:"col-type-date col-field-created",name:"created",$$slots:{default:[qA]},$$scope:{ctx:n}};n[4]!==void 0&&(ae.sort=n[4]),L=new nn({props:ae}),pe.push(()=>Ie(L,"sort",Re));function re(X){n[21](X)}let ve={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[VA]},$$scope:{ctx:n}};n[4]!==void 0&&(ve.sort=n[4]),G=new nn({props:ve}),pe.push(()=>Ie(G,"sort",rLine truncated
|
||||
<span class="txt">New user</span>`,f=O(),B(c.$$.fragment),d=O(),h=_("div"),g=_("table"),y=_("thead"),b=_("tr"),B(v.$$.fragment),S=O(),B($.$$.fragment),T=O();for(let X=0;X<E.length;X+=1)E[X].c();P=O(),B(L.$$.fragment),j=O(),B(G.$$.fragment),q=O(),Z=_("th"),J=O(),K=_("tbody");for(let X=0;X<ne.length;X+=1)ne[X].c();Je&&Je.c(),be=O(),ge&&ge.c(),se=O(),Ae&&Ae.c(),p(i,"class","breadcrumbs"),p(l,"type","button"),p(l,"class","btn btn-secondary btn-circle"),p(o,"class","flex-fill"),p(u,"type","button"),p(u,"class","btn btn-expanded"),p(t,"class","page-header"),p(Z,"class","col-type-action min-width"),p(g,"class","table"),ee(g,"table-loading",n[10]),p(h,"class","table-wrapper"),p(e,"class","page-wrapper")},m(X,ue){w(X,e,ue),m(e,t),m(t,i),m(t,s),m(t,l),m(t,r),m(t,o),m(t,a),m(t,u),m(e,f),V(c,e,null),m(e,d),m(e,h),m(h,g),m(g,y),m(y,b),V(v,b,null),m(b,S),V($,b,null),m(b,T);for(let Ue=0;Ue<E.length;Ue+=1)E[Ue].m(b,null);m(b,P),V(L,b,null),m(b,j),V(G,b,null),m(b,q),m(b,Z),m(g,J),m(g,K);for(let Ue=0;Ue<ne.length;Ue+=1)ne[Ue].m(K,null);Je&&Je.m(K,null),m(e,be),ge&&ge.m(e,null),m(e,se),Ae&&Ae.m(e,null),x=!0,Te||(te=[Xe(St.call(null,l,{text:"Edit profile collection",position:"right"})),Q(l,"click",n[15]),Q(u,"click",n[16])],Te=!0)},p(X,ue){const Ue={};ue[0]&8&&(Ue.value=X[3]),c.$set(Ue);const bt={};ue[1]&16384&&(bt.$$scope={dirty:ue,ctx:X}),!C&&ue[0]&16&&(C=!0,bt.sort=X[4],je(()=>C=!1)),v.$set(bt);const it={};ue[1]&16384&&(it.$$scope={dirty:ue,ctx:X}),!M&&ue[0]&16&&(M=!0,it.sort=X[4],je(()=>M=!1)),$.$set(it),ue[0]&4096&&(He=X[12],E=rt(E,ue,Le,1,X,He,D,b,fn,og,P,rg));const yt={};ue[1]&16384&&(yt.$$scope={dirty:ue,ctx:X}),!R&&ue[0]&16&&(R=!0,yt.sort=X[4],je(()=>R=!1)),L.$set(yt);const ut={};ue[1]&16384&&(ut.$$scope={dirty:ue,ctx:X}),!Y&&ue[0]&16&&(Y=!0,ut.sort=X[4],je(()=>Y=!1)),G.$set(ut),ue[0]&5450&&(qe=X[1],Me(),ne=rt(ne,ue,Ve,1,X,qe,ce,K,Ft,cg,null,sg),Oe(),!qe.length&&Je?Je.p(X,ue):qe.length?Je&&(Je.d(1),Je=null):(Je=ag(X),Je.c(),Je.m(K,null))),ue[0]&1024&&ee(g,"table-loading",X[10]),X[1].length?ge?ge.p(X,ue):(ge=dg(X),ge.c(),ge.m(e,se)):ge&&(ge.d(1),ge=null),X[1].length&&X[13]?Ae?Ae.p(X,ue):(Ae=pg(X),Ae.c(),Ae.m(e,null)):Ae&&(Ae.d(1),Ae=null)},i(X){if(!x){A(c.$$.fragment,X),A(v.$$.fragment,X),A($.$$.fragment,X),A(L.$$.fragment,X),A(G.$$.fragment,X);for(let ue=0;ue<qe.length;ue+=1)A(ne[ue]);x=!0}},o(X){F(c.$$.fragment,X),F(v.$$.fragment,X),F($.$$.fragment,X),F(L.$$.fragment,X),F(G.$$.fragment,X);for(let ue=0;ue<ne.length;ue+=1)F(ne[ue]);x=!1},d(X){X&&k(e),z(c),z(v),z($);for(let ue=0;ue<E.length;ue+=1)E[ue].d();z(L),z(G);for(let ue=0;ue<ne.length;ue+=1)ne[ue].d();Je&&Je.d(),ge&&ge.d(),Ae&&Ae.d(),Te=!1,lt(te)}}}function RA(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function jA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function HA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function og(n,e){let t,i,s,l,r,o,a,u=e[40].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),r=O(),o=_("span"),a=H("profile."),f=H(u),p(s,"class",l=W.getFieldTypeIcon(e[40].type)),p(o,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[40].type+" col-field-"+e[40].name),p(t,"name",d=e[40].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,r),m(i,o),m(o,a),m(o,f)},p(h,g){e=h,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[40].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[40].name+"")&&me(f,u),g[0]&4096&&c!==(c="col-type-"+e[40].type+" col-field-"+e[40].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[40].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function qA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function VA(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ag(n){let e;function t(l,r){return l[10]?BA:zA}let i=t(n),s=i(n);return{c(){s.c(),e=st()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function zA(n){var o;let e,t,i,s,l,r=((o=n[3])==null?void 0:o.length)&&ug(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),r&&r.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?r?r.p(a,u):(r=ug(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&k(e),r&&r.d()}}}function BA(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function ug(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[24]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function fg(n,e){let t,i,s;return i=new Vb({props:{field:e[40],record:e[37].profile||{}}}),{key:n,first:null,c(){t=st(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r[0]&4096&&(o.field=e[40]),r[0]&2&&(o.record=e[37].profile||{}),i.$set(o)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function cg(n,e){let t,i,s,l,r,o,a,u=e[37].email+"",f,c,d,h,g=e[37].verified?"Verified":"Unverified",y,b,v=[],C=new Map,S,$,M,T,E,D,P,L,R,j,G,Y,q,Z,J;s=new jo({props:{id:e[37].id}});let K=e[12];const ne=se=>se[40].name;for(let se=0;se<K.length;se+=1){let x=lg(e,K,se),Te=ne(x);C.set(Te,v[se]=fg(Te,x))}M=new $i({props:{date:e[37].created}}),D=new $i({props:{date:e[37].updated}});function ce(){return e[22](e[37])}function be(){return e[23](e[37])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),B(s.$$.fragment),l=O(),r=_("td"),o=_("div"),a=_("span"),f=H(u),d=O(),h=_("span"),y=H(g),b=O();for(let se=0;se<v.length;se+=1)v[se].c();S=O(),$=_("td"),B(M.$$.fragment),T=O(),E=_("td"),B(D.$$.fragment),P=O(),L=_("td"),R=_("button"),R.innerHTML=`<i class="ri-user-settings-line"></i>
|
||||
<span class="txt">Edit user</span>`,j=O(),G=_("button"),G.innerHTML=`<i class="ri-profile-line"></i>
|
||||
<span class="txt">Edit profile</span>`,Y=O(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[37].email),p(h,"class","label"),ee(h,"label-success",e[37].verified),ee(h,"label-warning",!e[37].verified),p(o,"class","inline-flex"),p(r,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(E,"class","col-type-date col-field-updated"),p(R,"type","button"),p(R,"class","btn btn-sm btn-outline"),p(G,"type","button"),p(G,"class","btn btn-sm m-l-10"),p(L,"class","col-type-action min-width"),this.first=t},m(se,x){w(se,t,x),m(t,i),V(s,i,null),m(t,l),m(t,r),m(r,o),m(o,a),m(a,f),m(o,d),m(o,h),m(h,y),m(t,b);for(let Te=0;Te<v.length;Te+=1)v[Te].m(t,null);m(t,S),m(t,$),V(M,$,null),m(t,T),m(t,E),V(D,E,null),m(t,P),m(t,L),m(L,R),m(L,j),m(L,G),m(t,Y),q=!0,Z||(J=[Q(R,"click",Un(ce)),Q(G,"click",Un(be))],Z=!0)},p(se,x){e=se;const Te={};x[0]&2&&(Te.id=e[37].id),s.$set(Te),(!q||x[0]&2)&&u!==(u=e[37].email+"")&&me(f,u),(!q||x[0]&2&&c!==(c=e[37].email))&&p(a,"title",c),(!q||x[0]&2)&&g!==(g=e[37].verified?"Verified":"Unverified")&&me(y,g),x[0]&2&&ee(h,"label-success",e[37].verified),x[0]&2&&ee(h,"label-warning",!e[37].verified),x[0]&4098&&(K=e[12],Me(),v=rt(v,x,ne,1,e,K,C,t,Ft,fg,S,lg),Oe());const te={};x[0]&2&&(te.date=e[37].created),M.$set(te);const _e={};x[0]&2&&(_e.date=e[37].updated),D.$set(_e)},i(se){if(!q){A(s.$$.fragment,se);for(let x=0;x<K.length;x+=1)A(v[x]);A(M.$$.fragment,se),A(D.$$.fragment,se),q=!0}},o(se){F(s.$$.fragment,se);for(let x=0;x<v.length;x+=1)F(v[x]);F(M.$$.fragment,se),F(D.$$.fragment,se),q=!1},d(se){se&&k(t),z(s);for(let x=0;x<v.length;x+=1)v[x].d();z(M),z(D),Z=!1,lt(J)}}}function dg(n){let e,t,i=n[1].length+"",s,l,r;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),r=H(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(o,a){w(o,e,a),m(e,t),m(e,s),m(e,l),m(e,r)},p(o,a){a[0]&2&&i!==(i=o[1].length+"")&&me(s,i),a[0]&4&&me(r,o[2])},d(o){o&&k(e)}}}function pg(n){let e,t,i,s,l=n[2]-n[1].length+"",r,o,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=H("Load more ("),r=H(l),o=H(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ee(t,"btn-loading",n[10]),ee(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,r),m(i,o),a||(u=Q(t,"click",n[25]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&me(r,l),c[0]&1024&&ee(t,"btn-loading",f[10]),c[0]&1024&&ee(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function UA(n){let e,t,i,s,l,r,o,a,u;const f=[RA,NA],c=[];function d(b,v){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let h={};s=new IA({props:h}),n[26](s),s.$on("save",n[27]),s.$on("delete",n[28]);let g={};r=new gf({props:g}),n[29](r),r.$on("save",n[30]);let y={collection:n[5]};return a=new qb({props:y}),n[31](a),a.$on("save",n[32]),{c(){t.c(),i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment)},m(b,v){c[e].m(b,v),w(b,i,v),V(s,b,v),w(b,l,v),V(r,b,v),w(b,o,v),V(a,b,v),u=!0},p(b,v){let C=e;e=d(b),e===C?c[e].p(b,v):(Me(),F(c[C],1,1,()=>{c[C]=null}),Oe(),t=c[e],t?t.p(b,v):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const $={};r.$set($);const M={};v[0]&32&&(M.collection=b[5]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(r.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){F(t),F(s.$$.fragment,b),F(r.$$.fragment,b),F(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[26](null),z(s,b),b&&k(l),n[29](null),z(r,b),b&&k(o),n[31](null),z(a,b)}}}function WA(n,e,t){var Te;let i,s;const l=W.getQueryParams((Te=window.location)==null?void 0:Te.href),r=["id","userId","created","updated"];let o,a,u,f=[],c=1,d=0,h=!1,g=l.filter||"",y=l.sort||"-created",b=new Fn,v=!1;W.setDocumentTitle("Users"),M();async function C(te=1){return t(10,h=!0),ke.Users.getList(te,50,{sort:y||"-created",filter:g}).then(_e=>{te<=1&&S(),t(10,h=!1),t(1,f=f.concat(_e.items)),t(9,c=_e.page),t(2,d=_e.totalItems)}).catch(_e=>{_e!==null&&(t(10,h=!1),console.warn(_e),S(),ke.errorResponseHandler(_e,!1))})}function S(){t(1,f=[]),t(9,c=1),t(2,d=0)}function $(te){const _e=f.find(fe=>fe.id===(te==null?void 0:te.userId));_e&&(_e.profile=te),t(1,f)}async function M(){t(11,v=!0);try{t(5,b=await ke.Collections.getOne("profiles"))}catch(te){ke.errorResponseHandler(te)}t(11,v=!1)}const T=()=>a==null?void 0:a.show(b),E=()=>o==null?void 0:o.show(),D=te=>t(3,g=te.detail);function P(te){y=te,t(4,y)}function L(te){y=te,t(4,y)}function R(te){y=te,t(4,y)}function j(te){y=te,t(4,y)}const G=te=>o==null?void 0:o.show(te),Y=te=>u==null?void 0:u.show(te.profile),q=()=>t(3,g=""),Z=()=>C(c+1);function J(te){pe[te?"unshift":"push"](()=>{o=te,t(6,o)})}const K=()=>C(),ne=()=>C();function ce(te){pe[te?"unshift":"push"](()=>{a=te,t(7,a)})}const be=te=>t(5,b=te.detail);function se(te){pe[te?"unshift":"push"](()=>{u=te,t(8,u)})}const x=te=>$(te.detail);return n.$$.update=()=>{var te;n.$$.dirty[0]&24&&y!==-1&&g!==-1&&(W.replaceClientQueryParams({filter:g,soLine truncated
|
||||
<span class="txt">Application</span>`,r=O(),o=_("a"),o.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||||
<span class="txt">Mail settings</span>`,a=O(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||||
<span class="txt">Files storage</span>`,f=O(),c=_("div"),c.textContent="Authentication",d=O(),h=_("a"),h.innerHTML=`<i class="ri-lock-password-line"></i>
|
||||
<span class="txt">Auth providers</span>`,g=O(),y=_("a"),y.innerHTML=`<i class="ri-key-line"></i>
|
||||
<span class="txt">Token options</span>`,b=O(),v=_("a"),v.innerHTML=`<i class="ri-shield-user-line"></i>
|
||||
<span class="txt">Admins</span>`,p(i,"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(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/auth-providers"),p(h,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(v,"href","/settings/admins"),p(v,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(t,r),m(t,o),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,h),m(t,g),m(t,y),m(t,b),m(t,v),C||(S=[Xe(oi.call(null,l,{path:"/settings"})),Xe(On.call(null,l)),Xe(oi.call(null,o,{path:"/settings/mail/?.*"})),Xe(On.call(null,o)),Xe(oi.call(null,u,{path:"/settings/storage/?.*"})),Xe(On.call(null,u)),Xe(oi.call(null,h,{path:"/settings/auth-providers/?.*"})),Xe(On.call(null,h)),Xe(oi.call(null,y,{path:"/settings/tokens/?.*"})),Xe(On.call(null,y)),Xe(oi.call(null,v,{path:"/settings/admins/?.*"})),Xe(On.call(null,v))],C=!0)},p:oe,i:oe,o:oe,d($){$&&k(e),C=!1,lt(S)}}}class nl extends Pe{constructor(e){super(),Ee(this,e,null,KA,De,{})}}function hg(n,e,t){const i=n.slice();return i[31]=e[t],i}function mg(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[JA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(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){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function JA(n){let e,t,i,s,l,r,o,a,u;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="ID",r=O(),o=_("input"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(o,"type","text"),p(o,"id",a=n[30]),o.value=u=n[1].id,o.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,r,c),w(f,o,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(o,"id",a),c[0]&2&&u!==(u=f[1].id)&&o.value!==u&&(o.value=u)},d(f){f&&k(e),f&&k(r),f&&k(o)}}}function gg(n){let e,t,i,s,l,r,o,a;function u(){return n[17](n[31])}function f(...c){return n[18](n[31],...c)}return{c(){e=_("figure"),t=_("img"),l=O(),ei(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt",s="Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",r="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(c,d){w(c,e,d),m(e,t),m(e,l),o||(a=[Q(e,"click",u),Q(e,"keydown",f)],o=!0)},p(c,d){n=c,d[0]&4&&r!==(r="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",r)},d(c){c&&k(e),o=!1,lt(a)}}}function GA(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=_("i"),i=O(),s=_("span"),s.textContent="Email",r=O(),o=_("input"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(o,"type","email"),p(o,"autocomplete","off"),p(o,"id",a=n[30]),o.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,r,d),w(c,o,d),Ce(o,n[3]),u||(f=Q(o,"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(o,"id",a),d[0]&8&&o.value!==c[3]&&Ce(o,c[3])},d(c){c&&k(e),c&&k(r),c&&k(o),u=!1,f()}}}function _g(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[ZA,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(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){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function ZA(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",r=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),o||(a=Q(e,"change",n[20]),o=!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&&r!==(r=u[30])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function bg(n){let e,t,i,s,l,r,o,a,u;return s=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[xA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[XA,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),B(s.$$.fragment),l=O(),r=_("div"),B(o.$$.fragment),p(i,"class","col-sm-6"),p(r,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),V(s,i,null),m(t,l),m(t,r),V(o,r,null),u=!0},p(f,c){const d={};c[0]&1073742080|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const h={};c[0]&1073742336|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),o.$set(h)},i(f){u||(A(s.$$.fragment,f),A(o.$$.fragment,f),Mt(()=>{a||(a=at(t,Xt,{duration:150},!0)),a.Line truncated
|
||||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function nE(n){let e,t,i,s,l,r,o=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&yg(n);return{c(){h&&h.c(),e=O(),t=_("button"),i=_("span"),i.textContent="Cancel",s=O(),l=_("button"),r=_("span"),a=H(o),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ee(l,"btn-loading",n[6])},m(g,y){h&&h.m(g,y),w(g,e,y),w(g,t,y),m(t,i),w(g,s,y),w(g,l,y),m(l,r),m(r,a),f=!0,c||(d=Q(t,"click",n[16]),c=!0)},p(g,y){g[1].isNew?h&&(Me(),F(h,1,1,()=>{h=null}),Oe()):h?(h.p(g,y),y[0]&2&&A(h,1)):(h=yg(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||y[0]&64)&&(t.disabled=g[6]),(!f||y[0]&2)&&o!==(o=g[1].isNew?"Create":"Save changes")&&me(a,o),(!f||y[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),y[0]&64&&ee(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){F(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function iE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[nE],header:[eE],default:[QA]},$$scope:{ctx:n}};return e=new Ai({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const r={};l[0]&1152&&(r.beforeHide=s[23]),l[0]&1886|l[1]&8&&(r.$$scope={dirty:l,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){F(e.$$.fragment,s),t=!1},d(s){n[24](null),z(e,s)}}}function sE(n,e,t){let i;const s=_n(),l="admin_"+W.randomString(5);let r,o=new Ws,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function y(J){return v(J),t(7,u=!0),r==null?void 0:r.show()}function b(){return r==null?void 0:r.hide()}function v(J){Ki({}),t(1,o=J!=null&&J.clone?J.clone():new Ws),C()}function C(){t(4,g=!1),t(3,c=(o==null?void 0:o.email)||""),t(2,f=(o==null?void 0:o.avatar)||0),t(8,d=""),t(9,h="")}function S(){if(a||!i)return;t(6,a=!0);const J={email:c,avatar:f};(o.isNew||g)&&(J.password=d,J.passwordConfirm=h);let K;o.isNew?K=ke.Admins.create(J):K=ke.Admins.update(o.id,J),K.then(async ne=>{var ce;t(7,u=!1),b(),mn(o.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((ce=ke.AuthStore.model)==null?void 0:ce.id)===ne.id&&ke.AuthStore.save(ke.AuthStore.token,ne)}).catch(ne=>{ke.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function $(){!(o!=null&&o.id)||Mi("Do you really want to delete the selected admin?",()=>ke.Admins.delete(o.id).then(()=>{t(7,u=!1),b(),mn("Successfully deleted admin."),s("delete",o)}).catch(J=>{ke.errorResponseHandler(J)}))}const M=()=>$(),T=()=>b(),E=J=>t(2,f=J),D=(J,K)=>{(K.code==="Enter"||K.code==="Space")&&(K.preventDefault(),t(2,f=J))};function P(){c=this.value,t(3,c)}function L(){g=this.checked,t(4,g)}function R(){d=this.value,t(8,d)}function j(){h=this.value,t(9,h)}const G=()=>i&&u?(Mi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function Y(J){pe[J?"unshift":"push"](()=>{r=J,t(5,r)})}function q(J){ft.call(this,n,J)}function Z(J){ft.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=o.isNew&&c!=""||g||c!==o.email||f!==o.avatar)},[b,o,f,c,g,r,a,u,d,h,i,l,S,$,y,M,T,E,D,P,L,R,j,G,Y,q,Z]}class lE extends Pe{constructor(e){super(),Ee(this,e,sE,iE,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function vg(n,e,t){const i=n.slice();return i[21]=e[t],i}function rE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function oE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function aE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function uE(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=O(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,r){w(l,e,r),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function kg(n){let e;function t(l,r){return l[5]?cE:fE}let i=t(n),s=i(n);return{c(){s.c(),e=st()},m(l,r){s.m(l,r),w(l,e,r)},p(l,r){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function fE(n){var o;let e,t,i,s,l,r=((o=n[1])==null?void 0:o.length)&&wg(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=O(),r&&r.c(),l=O(),p(t,"colspan","99"),p(t,"class","txt-cenLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function wg(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Q(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Sg(n){let e;return{c(){e=_("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 Cg(n,e){let t,i,s,l,r,o,a,u,f,c,d,h,g=e[21].email+"",y,b,v,C,S,$,M,T,E,D,P,L,R,j;u=new jo({props:{id:e[21].id}});let G=e[21].id===e[6].id&&Sg();S=new $i({props:{date:e[21].created}}),T=new $i({props:{date:e[21].updated}});function Y(){return e[13](e[21])}function q(...Z){return e[14](e[21],...Z)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),o=O(),a=_("td"),B(u.$$.fragment),f=O(),G&&G.c(),c=O(),d=_("td"),h=_("span"),y=H(g),v=O(),C=_("td"),B(S.$$.fragment),$=O(),M=_("td"),B(T.$$.fragment),E=O(),D=_("td"),D.innerHTML='<i class="ri-arrow-right-line"></i>',P=O(),ei(l.src,r="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg")||p(l,"src",r),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[21].email),p(d,"class","col-type-email col-field-email"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(D,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,J){w(Z,t,J),m(t,i),m(i,s),m(s,l),m(t,o),m(t,a),V(u,a,null),m(a,f),G&&G.m(a,null),m(t,c),m(t,d),m(d,h),m(h,y),m(t,v),m(t,C),V(S,C,null),m(t,$),m(t,M),V(T,M,null),m(t,E),m(t,D),m(t,P),L=!0,R||(j=[Q(t,"click",Y),Q(t,"keydown",q)],R=!0)},p(Z,J){e=Z,(!L||J&16&&!ei(l.src,r="/_/images/avatars/avatar"+(e[21].avatar||0)+".svg"))&&p(l,"src",r);const K={};J&16&&(K.id=e[21].id),u.$set(K),e[21].id===e[6].id?G||(G=Sg(),G.c(),G.m(a,null)):G&&(G.d(1),G=null),(!L||J&16)&&g!==(g=e[21].email+"")&&me(y,g),(!L||J&16&&b!==(b=e[21].email))&&p(h,"title",b);const ne={};J&16&&(ne.date=e[21].created),S.$set(ne);const ce={};J&16&&(ce.date=e[21].updated),T.$set(ce)},i(Z){L||(A(u.$$.fragment,Z),A(S.$$.fragment,Z),A(T.$$.fragment,Z),L=!0)},o(Z){F(u.$$.fragment,Z),F(S.$$.fragment,Z),F(T.$$.fragment,Z),L=!1},d(Z){Z&&k(t),z(u),G&&G.d(),z(S),z(T),R=!1,lt(j)}}}function $g(n){let e,t,i=n[4].length+"",s,l,r=n[4].length+"",o;return{c(){e=_("small"),t=H("Showing "),s=H(i),l=H(" of "),o=H(r),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,o)},p(a,u){u&16&&i!==(i=a[4].length+"")&&me(s,i),u&16&&r!==(r=a[4].length+"")&&me(o,r)},d(a){a&&k(e)}}}function dE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S,$,M,T,E,D,P,L,R,j,G,Y,q,Z,J,K=[],ne=new Map,ce,be,se,x,Te,te;e=new nl({}),c=new Po({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),c.$on("submit",n[8]);function _e(ge){n[9](ge)}let fe={class:"col-type-text",name:"id",$$slots:{default:[rE]},$$scope:{ctx:n}};n[2]!==void 0&&(fe.sort=n[2]),S=new nn({props:fe}),pe.push(()=>Ie(S,"sort",_e));function ie(ge){n[10](ge)}let ye={class:"col-type-email col-field-email",name:"email",$$slots:{default:[oE]},$$scope:{ctx:n}};n[2]!==void 0&&(ye.sort=n[2]),T=new nn({props:ye}),pe.push(()=>Ie(T,"sort",ie));function He(ge){n[11](ge)}let Le={class:"col-type-date col-field-created",name:"created",$$slots:{default:[aE]},$$scope:{ctx:n}};n[2]!==void 0&&(Le.sort=n[2]),P=new nn({props:Le}),pe.push(()=>Ie(P,"sort",He));function Re(ge){n[12](ge)}let ae={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[uE]},$$scope:{ctx:n}};n[2]!==void 0&&(ae.sort=n[2]),j=new nn({props:ae}),pe.push(()=>Ie(j,"sort",Re));let re=n[4];const ve=ge=>ge[21].id;for(let ge=0;ge<re.length;ge+=1){let Ae=vg(n,re,ge),X=ve(Ae);ne.set(X,K[ge]=Cg(X,Ae))}let qe=null;re.length||(qe=kg(n));let Ve=n[4].length&&$g(n),Je={};return se=new lE({props:Je}),n[16](se),se.$on("save",n[17]),se.$on("delete",n[18]),{c(){B(e.$$.fragment),t=O(),i=_("main"),s=_("header"),l=_("nav"),l.innerHTML=`<div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Admins</div>`,r=O(),o=_("div"),a=O(),u=_("button"),u.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New admin</span>`,f=O(),B(c.$$.fragment),d=O(),h=_("div"),g=_("table"),y=_("thead"),b=_("tr"),v=_("th"),C=O(),B(S.$$.fragment),M=O(),B(T.$$.fragment),D=O(),B(P.$$.fragment),R=O(),B(j.$$.fragment),Y=O(),q=_("th"),Z=O(),J=_("tbody");for(let ge=0;ge<K.length;ge+=1)K[ge].c();qe&&qe.c(),ce=O(),Ve&&Ve.c(),be=O(),B(se.$$.fragment),p(l,"class","breadcrumbs"),p(o,"class","flex-fill"),p(u,"type","button"),p(u,"class","btn btn-expanded"),p(s,"class","page-header"),p(v,"class","min-width"),p(q,"class","col-type-action min-width"),p(g,"class","table"),ee(g,"table-loading",n[5]),p(h,"class","table-wrapper"),p(i,"class","page-wrapper")},m(ge,Ae){V(e,ge,Ae),w(ge,t,Ae),w(ge,i,Ae),m(i,s),m(s,l),m(s,r),m(s,o),m(s,a),m(s,u),m(i,f),V(c,i,null),m(i,d),m(i,h),m(h,g),m(g,y),m(y,b),m(b,v),m(b,C),V(S,b,null),m(b,M),V(T,b,null),m(b,D),V(P,b,null),m(b,R),V(j,b,null),m(b,Y),m(b,q),m(g,Z),m(g,J);for(let X=0;X<K.length;X+=1)K[X].m(J,null);qe&&qe.m(J,null),m(i,ce),Ve&&Ve.m(i,null),w(ge,be,Ae),V(se,ge,Ae),x=!0,Te||(te=Q(u,"click",n[7]),Te=!0)},p(ge,[Ae]){const X={};Ae&2&&(X.value=ge[1]),c.$set(X);const ue={};Ae&16777216&&(ue.$$scope={dirty:Ae,ctx:ge}),!$&&Ae&4&&($=!0,ue.sort=ge[2],je(()=>$=!1)),S.$set(ue);const Ue={};Ae&16777216&&(Ue.$$scope={dirty:Ae,ctx:ge}),!E&&Ae&4&&(E=!0,Ue.sort=ge[2],je(()=>E=!1)),T.$set(Ue);const bt={};Ae&16777216&&(bt.$$scope={dirty:Ae,ctx:ge}),!L&&Ae&4&&(L=!0,bt.sort=ge[2],je(()=>L=!1)),P.$set(bt);const it={};Ae&16777216&&(it.$$scope={dirty:Ae,ctx:ge}),!G&&Ae&4&&(G=!0,it.sort=ge[2],je(()=>G=!1)),j.$set(it),Ae&122&&(re=ge[4],Me(),K=rt(K,Ae,ve,1,ge,re,ne,J,Ft,Cg,null,vg),Oe(),!re.length&&qe?qe.p(ge,Ae):re.length?qe&&(qe.d(1),qe=null):(qe=kg(ge),qe.c(),qe.m(J,null))),Ae&32&&ee(g,"table-loading",ge[5]),ge[4].length?Ve?Ve.p(ge,Ae):(Ve=$g(ge),Ve.c(),Ve.m(i,null)):Ve&&(Ve.d(1),Ve=null);const yt={};se.$set(yt)},i(ge){if(!x){A(e.$$.fragment,ge),A(c.$$.fragment,ge),A(S.$$.fragment,ge),A(T.$$.fragment,ge),A(P.$$.fragment,ge),A(j.$$.fragment,ge);for(let Ae=0;Ae<re.length;Ae+=1)A(K[Ae]);A(se.$$.fragment,ge),x=!0}},o(ge){F(e.$$.fragment,ge),F(c.$$.fragment,ge),F(S.$$.fragment,ge),F(T.$$.fragment,ge),F(P.$$.fragment,ge),F(j.$$.fragment,ge);for(let Ae=0;Ae<K.length;Ae+=1)F(K[Ae]);F(se.$$.fragment,ge),x=!1},d(ge){z(e,ge),ge&&k(t),ge&&k(i),z(c),z(S),z(T),z(P),z(j);for(let Ae=0;Ae<K.length;Ae+=1)K[Ae].d();qe&&qe.d(),Ve&&Ve.d(),ge&&k(be),n[16](null),z(se,ge),Te=!1,te()}}}function pE(n,e,t){var D;let i;hn(n,Bu,P=>t(6,i=P));const s=W.getQueryParams((D=window.location)==null?void 0:D.href);let l,r=[],o=!1,a=s.filter||"",u=s.sort||"-created";W.setDocumentTitle("Admins");function f(){return t(5,o=!0),t(4,r=[]),ke.Admins.getFullList(100,{sort:u||"-created",filter:a}).then(P=>{t(4,r=P),t(5,o=!1)}).catch(P=>{P!==null&&(t(5,o=!1),console.warn(P),c(),ke.errorResponseHandler(P,!1))})}function c(){t(4,r=[])}const d=()=>l==null?void 0:l.show(),h=P=>t(1,a=P.detail);function g(P){u=P,t(2,u)}function y(P){u=P,t(2,u)}function b(P){u=P,t(2,u)}function v(P){u=P,t(2,u)}const C=P=>l==null?void 0:l.show(P),S=(P,L)=>{(L.code==="Enter"||L.code==="Space")&&(L.preventDefault(),l==null||l.show(P))},$=()=>t(1,a="");function M(P){pe[P?"unshift":"push"](()=>{l=P,t(3,l)})}const T=()=>f(),E=()=>f();return n.$$.update=()=>{n.$$.dirty&6&&u!==-1&&a!==-1&&(W.replaceClientQueryParams({filter:a,sort:u}),f())},[f,a,u,l,r,o,i,d,h,g,y,b,v,C,S,$,M,T,E]}class hE extends Pe{constructor(e){super(),Ee(this,e,pE,dE,De,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function mE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Email"),s=O(),l=_("input"),p(e,"for",i=n[7]),p(l,"type","email"),p(l,"id",r=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),o||(a=Q(l,"input",n[4]),o=!0)},p(u,f){f&128&&i!==(i=u[7])&&p(e,"for",i),f&128&&r!==(r=u[7])&&p(l,"id",r),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function gE(n){let e,t,i,s,l,r,o,a,u,f,c;return{c(){e=_("label"),t=H("Password"),s=O(),l=_("input"),o=O(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",p(e,"for",i=n[7]),p(l,"type","password"),p(l,"id",r=n[7]),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),m(e,t),w(d,s,h),w(d,l,h),Ce(l,n[1]),w(d,o,h),w(d,a,h),m(a,u),f||(c=[Q(l,"input",n[5]),Xe(On.call(null,u))],f=!0)},p(d,h){h&128&&i!==(i=d[7])&&p(e,"for",i),h&128&&r!==(r=d[7])&&p(l,"id",r),h&2&&l.value!==d[1]&&Ce(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(o),d&&k(a),f=!1,lt(c)}}}function _E(n){let e,t,i,s,l,r,o,a,u,f,c;return s=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[mE,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[gE,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign in</h4>",i=O(),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),a=_("bLine truncated
|
||||
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ee(a,"btn-disabled",n[2]),ee(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),V(s,e,null),m(e,l),V(r,e,null),m(e,o),m(e,a),u=!0,f||(c=Q(e,"submit",Wt(n[3])),f=!0)},p(d,h){const g={};h&385&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const y={};h&386&&(y.$$scope={dirty:h,ctx:d}),r.$set(y),h&4&&ee(a,"btn-disabled",d[2]),h&4&&ee(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(r.$$.fragment,d),u=!0)},o(d){F(s.$$.fragment,d),F(r.$$.fragment,d),u=!1},d(d){d&&k(e),z(s),z(r),f=!1,c()}}}function bE(n){let e,t;return e=new I0({props:{$$slots:{default:[_E]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){F(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function yE(n,e,t){var f;const i=W.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",r=!1;function o(){if(!r)return t(2,r=!0),ke.Admins.authViaEmail(s,l).then(()=>{Zs("/")}).catch(()=>{A0("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,r,o,a,u]}class vE extends Pe{constructor(e){super(),Ee(this,e,yE,bE,De,{})}}function kE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C;return i=new Fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[SE,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[CE,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[$E,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),B(a.$$.fragment),u=O(),f=_("div"),c=_("div"),d=O(),h=_("button"),g=_("span"),g.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(g,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=y=!n[3]||n[2],ee(h,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(S,$){w(S,e,$),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),V(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,h),m(h,g),b=!0,v||(C=Q(h,"click",n[9]),v=!0)},p(S,$){const M={};$&12289&&(M.$$scope={dirty:$,ctx:S}),i.$set(M);const T={};$&12289&&(T.$$scope={dirty:$,ctx:S}),r.$set(T);const E={};$&12289&&(E.$$scope={dirty:$,ctx:S}),a.$set(E),(!b||$&12&&y!==(y=!S[3]||S[2]))&&(h.disabled=y),$&4&&ee(h,"btn-loading",S[2])},i(S){b||(A(i.$$.fragment,S),A(r.$$.fragment,S),A(a.$$.fragment,S),b=!0)},o(S){F(i.$$.fragment,S),F(r.$$.fragment,S),F(a.$$.fragment,S),b=!1},d(S){S&&k(e),z(i),z(r),z(a),v=!1,C()}}}function wE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function SE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Application name"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appName),o||(a=Q(l,"input",n[6]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&l.value!==u[0].meta.appName&&Ce(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function CE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Application url"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","text"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appUrl),o||(a=Q(l,"input",n[7]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&l.value!==u[0].meta.appUrl&&Ce(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function $E(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Logs max days retention"),s=O(),l=_("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",r=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].logs.maxDays),o||(a=Q(l,"input",n[8]),o=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&r!==(r=u[12])&&p(l,"id",r),f&1&&Ot(l.value)!==u[0].logs.maxDays&&Ce(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function ME(n){let e,t,i,s,l,r,o,a,u,f,c,d;e=new nl({});const h=[wE,kE],g=[];function y(b,v){return b[1]?0:1}return a=y(n),u=g[a]=h[a](n),{c(){B(e.$$.fragment),t=O(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Application</div></nav>`,l=O(),r=_("div"),o=_("form"),u.c(),p(s,"class","page-header"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(b,v){V(e,b,v),w(b,t,v),w(b,i,v),m(i,s),m(i,l),m(i,r),m(r,o),g[a].m(o,null),f=!0,c||(d=Q(o,"submit",Wt(n[4])),c=!0)},p(b,[v]){let C=a;a=y(b),a===C?g[a].p(b,v):(Me(),F(g[C],1,1,()=>{g[C]=null}),Oe(),u=g[a],u?u.p(b,v):(u=g[a]=h[a](b),u.c()),A(u,1),u.m(o,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){F(e.$$.fragment,b),F(u),f=!1},d(b){z(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function OE(n,e,t){let i,s={},l=!1,r=!1,o="";W.setDocumentTitle("Application settings"),a();async function a(){t(1,l=!0);try{const y=await ke.Settings.getAll()||{};f(y)}catch(y){ke.errorResponseHandler(y)}t(1,l=!1)}async function u(){if(!(r||!i)){t(2,r=!0);try{const y=await ke.Settings.update(W.filterRedactedProps(s));f(y),mn("Successfully saved application settings.")}catch(y){ke.errorResponseHandler(y)}t(2,r=!1)}}function f(y={}){t(0,s={meta:(y==null?void 0:y.meta)||{},logs:(y==null?void 0:y.logs)||{}}),t(5,o=JSON.stringify(s))}function c(){s.meta.appName=this.value,t(0,s)}function d(){s.meta.appUrl=this.value,t(0,s)}function h(){s.logs.maxDays=Ot(this.value),t(0,s)}const g=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=o!=JSON.stringify(s))},[s,l,r,i,u,o,c,d,h,g]}class TE extends Pe{constructor(e){super(),Ee(this,e,OE,ME,De,{})}}function DE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let r=0;r<s.length;r+=1)l=ct(l,s[r]);return{c(){e=_("input"),ci(e,l)},m(r,o){w(r,e,o),e.autofocus&&e.focus(),n[7](e),Ce(e,n[0]),t||(i=Q(e,"input",n[8]),t=!0)},p(r,o){ci(e,l=bn(s,[{type:"password"},{autocomplete:"new-password"},o&32&&r[5]])),o&1&&e.value!==r[0]&&Ce(e,r[0])},d(r){r&&k(e),n[7](null),t=!1,i()}}}function AE(n){let e,t,i,s,l,r,o=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<o.length;u+=1)a=ct(a,o[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=O(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),ci(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(r=[Xe(St.call(null,t,{position:"left",text:"Set new value"})),Q(t,"click",n[6])],l=!0)},p(u,f){ci(s,a=bn(o,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,lt(r)}}}function EE(n){let e;function t(l,r){return l[3]?AE:DE}let i=t(n),s=i(n);return{c(){s.c(),e=st()},m(l,r){s.m(l,r),w(l,e,r)},p(l,[r]){i===(i=t(l))&&s?s.p(l,r):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function PE(n,e,t){const i=["value","mask"];let s=Ut(e,i),{value:l=""}=e,{mask:r="******"}=e,o,a=!1;async function u(){t(0,l=""),t(3,a=!1),await Oi(),o==null||o.focus()}const f=()=>u();function c(h){pe[h?"unshift":"push"](()=>{o=h,t(2,o)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=ct(ct({},e),di(h)),t(5,s=Ut(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,r=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===r&&t(3,a=!0)},[l,r,o,a,u,s,f,c,d]}class _f extends Pe{constructor(e){super(),Ee(this,e,PE,EE,De,{value:0,mask:1})}}function LE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S,$,M,T,E,D,P,L,R,j,G;i=new Fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[IE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[NE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[RE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),f=new Fe({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[jE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:{default:[HE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}}),C=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[qE,({uniqueId:q})=>({22:q}),({uniqueId:q})=>q?4194304:0]},$$scope:{ctx:n}}});let Y=n[0].smtp.enabled&&Mg(n);return{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),B(a.$$.fragment),u=O(),B(f.$$.fragment),c=O(),B(d.$$.fragment),h=O(),g=_("hr"),y=O(),b=_("div"),b.innerHTML=`<p>By default PocketBase uses the OS <code>sendmail</code> command for sending emails.
|
||||
<br/>
|
||||
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||||
below.</strong></p>`,v=O(),B(C.$$.fragment),S=O(),Y&&Y.c(),$=O(),M=_("div"),T=_("div"),E=O(),D=_("button"),P=_("span"),P.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid"),p(b,"class","content m-b-sm"),p(T,"class","flex-fill"),p(P,"class","txt"),p(D,"type","submit"),p(D,"class","btn btn-expanded"),D.disabled=L=!n[3]||n[2],ee(D,"btn-loading",n[2]),p(M,"class","flex")},m(q,Z){w(q,e,Z),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),V(a,e,null),m(e,u),V(f,e,null),m(e,c),V(d,e,null),w(q,h,Z),w(q,g,Z),w(q,y,Z),w(q,b,Z),w(q,v,Z),V(C,q,Z),w(q,S,Z),Y&&Y.m(q,Z),w(q,$,Z),w(q,M,Z),m(M,T),m(M,E),m(M,D),m(D,P),R=!0,j||(G=Q(D,"click",n[18]),j=!0)},p(q,Z){const J={};Z&12582913&&(J.$$scope={dirty:Z,ctx:q}),i.$set(J);const K={};Z&12582913&&(K.$$scope={dirty:Z,ctx:q}),r.$set(K);const ne={};Z&12582913&&(ne.$$scope={dirty:Z,ctx:q}),a.$set(ne);const ce={};Z&12582913&&(ce.$$scope={dirty:Z,ctx:q}),f.$set(ce);const be={};Z&12582913&&(be.$$scope={dirty:Z,ctx:q}),d.$set(be);const se={};Z&12582913&&(se.$$scope={dirty:Z,ctx:q}),C.$set(se),q[0].smtp.enabled?Y?(Y.p(q,Z),Z&1&&A(Y,1)):(Y=Mg(q),Y.c(),A(Y,1),Y.m($.parentNode,$)):Y&&(Me(),F(Y,1,1,()=>{Y=null}),Oe()),(!R||Z&12&&L!==(L=!q[3]||q[2]))&&(D.disabled=L),Z&4&&ee(D,"btn-loading",q[2])},i(q){R||(A(i.$$.fragment,q),A(r.$$.fragment,q),A(a.$$.fragment,q),A(f.$$.fragment,q),A(d.$$.fragment,q),A(C.$$.fragment,q),A(Y),R=!0)},o(q){F(i.$$.fragment,q),F(r.$$.fragment,q),F(a.$$.fragment,q),F(f.$$.fragment,q),F(d.$$.fragment,q),F(C.$$.fragment,q),F(Y),R=!1},d(q){q&&k(e),z(i),z(r),z(a),z(f),z(d),q&&k(h),q&&k(g),q&&k(y),q&&k(b),q&&k(v),z(C,q),q&&k(S),Y&&Y.d(q),q&&k($),q&&k(M),j=!1,G()}}}function FE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function IE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Sender name"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderName),o||(a=Q(l,"input",n[7]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].meta.senderName&&Ce(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function NE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Sender address"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","email"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderAddress),o||(a=Q(l,"input",n[8]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].meta.senderAddress&&Ce(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function RE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User verification page url"),s=O(),l=_("input"),o=O(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userVerificationUrl),w(c,o,d),w(c,a,d),u||(f=Q(l,"input",n[9]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userVerificationUrl&&Ce(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function jE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User reset password page url"),s=O(),l=_("input"),o=O(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userResetPasswordUrl),w(c,o,d),w(c,a,d),u||(f=Q(l,"input",n[10]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&Ce(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function HE(n){let e,t,i,s,l,r,o,a,u,f;return{c(){e=_("label"),t=H("User confirm email change page url"),s=O(),l=_("input"),o=O(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
|
||||
parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userConfirmEmailChangeUrl),w(c,o,d),w(c,a,d),u||(f=Q(l,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&r!==(r=c[22])&&p(l,"id",r),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&Ce(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(o),c&&k(a),u=!1,f()}}}function qE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[22]),e.required=!0,p(s,"for",r=n[22])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=Q(e,"change",n[12]),o=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&4194304&&r!==(r=u[22])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Mg(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S;return i=new Fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[VE,({uniqueId:$})=>({22:$}),({uniqueId:$})=>$?4194304:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[zE,({uniqueId:$})=>({22:$}),({uniqueId:$})=>$?4194304:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[BE,({uniqueId:$})=>({22:$}),({uniqueId:$})=>$?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[UE,({uniqueId:$})=>({22:$}),({uniqueId:$})=>$?4194304:0]},$$scope:{ctx:n}}}),y=new Fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[WE,({uniqueId:$})=>({22:$}),({uniqueId:$})=>$?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(d.$$.fragment),h=O(),g=_("div"),B(y.$$.fragment),b=O(),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(g,"class","col-lg-6"),p(v,"class","col-lg-12"),p(e,"class","grid")},m($,M){w($,e,M),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),m(e,f),m(e,c),V(d,c,null),m(e,h),m(e,g),V(y,g,null),m(e,b),m(e,v),S=!0},p($,M){const T={};M&12582913&&(T.$$scope={dirty:M,ctx:$}),i.$set(T);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:$}),r.$set(E);const D={};M&12582913&&(D.$$scope={dirty:M,ctx:$}),u.$set(D);const P={};M&12582913&&(P.$$scope={dirty:M,ctx:$}),d.$set(P);const L={};M&12582913&&(L.$$scope={dirty:M,ctx:$}),y.$set(L)},i($){S||(A(i.$$.fragment,$),A(r.$$.fragment,$),A(u.$$.fragment,$),A(d.$$.fragment,$),A(y.$$.fragment,$),$&&Mt(()=>{C||(C=at(e,Xt,{duration:150},!0)),C.run(1)}),S=!0)},o($){F(i.$$.fragment,$),F(r.$$.fragment,$),F(u.$$.fragment,$),F(d.$$.fragment,$),F(y.$$.fragment,$),$&&(C||(C=at(e,Xt,{duration:150},!1)),C.run(0)),S=!1},d($){$&&k(e),z(i),z(r),z(u),z(d),z(y),$&&C&&C.end()}}}function VE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("SMTP server host"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.host),o||(a=Q(l,"input",n[13]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].smtp.host&&Ce(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function zE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Port"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.port),o||(a=Q(l,"input",n[14]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&Ot(l.value)!==u[0].smtp.port&&Ce(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function BE(n){let e,t,i,s,l,r,o;function a(f){n[15](f)}let u={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new ws({props:u}),pe.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=H("TLS Encryption"),s=O(),B(l.$$.fragment),p(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),V(l,f,c),o=!0},p(f,c){(!o||c&4194304&&i!==(i=f[22]))&&p(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!r&&c&1&&(r=!0,d.keyOfSelected=f[0].smtp.tls,je(()=>r=!1)),l.$set(d)},i(f){o||(A(l.$$.fragment,f),o=!0)},o(f){F(l.$$.fragment,f),o=!1},d(f){f&&k(e),f&&k(s),z(l,f)}}}function UE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Username"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.username),o||(a=Q(l,"input",n[16]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].smtp.username&&Ce(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function WE(n){let e,t,i,s,l,r,o;function a(f){n[17](f)}let u={id:Line truncated
|
||||
<div class="breadcrumb-item">Mail settings</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(C,S){V(e,C,S),w(C,t,S),w(C,i,S),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=Q(o,"submit",Wt(n[19])),h=!0)},p(C,[S]){let $=f;f=v(C),f===$?b[f].p(C,S):(Me(),F(b[$],1,1,()=>{b[$]=null}),Oe(),c=b[f],c?c.p(C,S):(c=b[f]=y[f](C),c.c()),A(c,1),c.m(o,null))},i(C){d||(A(e.$$.fragment,C),A(c),d=!0)},o(C){F(e.$$.fragment,C),F(c),d=!1},d(C){z(e,C),C&&k(t),C&&k(i),b[f].d(),h=!1,g()}}}function KE(n,e,t){let i;const s=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let l={},r=!1,o=!1,a="";W.setDocumentTitle("Mail settings"),u();async function u(){t(1,r=!0);try{const P=await ke.Settings.getAll()||{};c(P)}catch(P){ke.errorResponseHandler(P)}t(1,r=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const P=await ke.Settings.update(W.filterRedactedProps(l));c(P),mn("Successfully saved mail settings.")}catch(P){ke.errorResponseHandler(P)}t(2,o=!1)}}function c(P={}){t(0,l={meta:(P==null?void 0:P.meta)||{},smtp:(P==null?void 0:P.smtp)||{}}),t(6,a=JSON.stringify(l))}function d(){l.meta.senderName=this.value,t(0,l)}function h(){l.meta.senderAddress=this.value,t(0,l)}function g(){l.meta.userVerificationUrl=this.value,t(0,l)}function y(){l.meta.userResetPasswordUrl=this.value,t(0,l)}function b(){l.meta.userConfirmEmailChangeUrl=this.value,t(0,l)}function v(){l.smtp.enabled=this.checked,t(0,l)}function C(){l.smtp.host=this.value,t(0,l)}function S(){l.smtp.port=Ot(this.value),t(0,l)}function $(P){n.$$.not_equal(l.smtp.tls,P)&&(l.smtp.tls=P,t(0,l))}function M(){l.smtp.username=this.value,t(0,l)}function T(P){n.$$.not_equal(l.smtp.password,P)&&(l.smtp.password=P,t(0,l))}const E=()=>f(),D=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,r,o,i,s,f,a,d,h,g,y,b,v,C,S,$,M,T,E,D]}class JE extends Pe{constructor(e){super(),Ee(this,e,KE,YE,De,{})}}function GE(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[xE,({uniqueId:b})=>({17:b}),({uniqueId:b})=>b?131072:0]},$$scope:{ctx:n}}});let g=n[3]!=n[0].enabled&&Og(n),y=n[0].enabled&&Tg(n);return{c(){B(e.$$.fragment),t=O(),g&&g.c(),i=O(),y&&y.c(),s=O(),l=_("div"),r=_("div"),o=O(),a=_("button"),u=_("span"),u.textContent="Save changes",p(r,"class","flex-fill"),p(u,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-expanded"),a.disabled=f=!n[4]||n[2],ee(a,"btn-loading",n[2]),p(l,"class","flex")},m(b,v){V(e,b,v),w(b,t,v),g&&g.m(b,v),w(b,i,v),y&&y.m(b,v),w(b,s,v),w(b,l,v),m(l,r),m(l,o),m(l,a),m(a,u),c=!0,d||(h=Q(a,"click",n[13]),d=!0)},p(b,v){const C={};v&393217&&(C.$$scope={dirty:v,ctx:b}),e.$set(C),b[3]!=b[0].enabled?g?(g.p(b,v),v&9&&A(g,1)):(g=Og(b),g.c(),A(g,1),g.m(i.parentNode,i)):g&&(Me(),F(g,1,1,()=>{g=null}),Oe()),b[0].enabled?y?(y.p(b,v),v&1&&A(y,1)):(y=Tg(b),y.c(),A(y,1),y.m(s.parentNode,s)):y&&(Me(),F(y,1,1,()=>{y=null}),Oe()),(!c||v&20&&f!==(f=!b[4]||b[2]))&&(a.disabled=f),v&4&&ee(a,"btn-loading",b[2])},i(b){c||(A(e.$$.fragment,b),A(g),A(y),c=!0)},o(b){F(e.$$.fragment,b),F(g),F(y),c=!1},d(b){z(e,b),b&&k(t),g&&g.d(b),b&&k(i),y&&y.d(b),b&&k(s),b&&k(l),d=!1,h()}}}function ZE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function xE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[17]),e.required=!0,p(s,"for",r=n[17])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=Q(e,"change",n[7]),o=!0)},p(u,f){f&131072&&t!==(t=u[17])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&131072&&r!==(r=u[17])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Og(n){let e,t,i,s,l,r,o,a=n[3]?"S3 storage":"local file system",u,f,c,d=n[0].enabled?"S3 storage":"local file system",h,g,y,b,v,C,S,$,M,T,E,D;return{c(){e=_("div"),t=_("div"),i=_("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=O(),l=_("div"),r=H(`If you have existing uploaded files, you'll have to migrate them manually from
|
||||
the
|
||||
`),o=_("strong"),u=H(a),f=H(`
|
||||
to the
|
||||
`),c=_("strong"),h=H(d),g=H(`.
|
||||
`),y=_("br"),b=H(`
|
||||
There are numerous command line tools that can help you, such as:
|
||||
`),v=_("a"),v.textContent=`rclone
|
||||
`,C=H(`,
|
||||
`),S=_("a"),S.textContent=`s5cmd
|
||||
`,$=H(", etc."),M=O(),T=_("div"),p(i,"class","icon"),p(v,"href","https://github.com/rclone/rclone"),p(v,"target","_blank"),p(v,"rel","noopener"),p(v,"class","txt-bold"),p(S,"href","https://github.com/peak/s5cmd"),p(S,"target","_blank"),p(S,"rel","noopener"),p(S,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(T,"class","clearfix m-t-base")},m(P,L){w(P,e,L),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(l,o),m(o,u),m(l,f),m(l,c),m(c,h),m(l,g),m(l,y),m(l,b),m(l,v),m(l,C),m(l,S),m(l,$),m(e,M),m(e,T),D=!0},p(P,L){(!D||L&8)&&a!==(a=P[3]?"S3 storage":"local file system")&&me(u,a),(!D||L&1)&&d!==(d=P[0].enabled?"S3 storage":"local file system")&&me(h,d)},i(P){D||(Mt(()=>{E||(E=at(e,Xt,{duration:150},!0)),E.run(1)}),D=!0)},o(P){E||(E=at(e,Xt,{duration:150},!1)),E.run(0),D=!1},d(P){P&&k(e),P&&E&&E.end()}}}function Tg(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g,y,b,v,C,S;return i=new Fe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[XE,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[QE,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[eP,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[tP,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),y=new Fe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[nP,({uniqueId:$})=>({17:$}),({uniqueId:$})=>$?131072:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),f=O(),c=_("div"),B(d.$$.fragment),h=O(),g=_("div"),B(y.$$.fragment),b=O(),v=_("div"),p(t,"class","col-lg-12"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(v,"class","col-lg-12"),p(e,"class","grid")},m($,M){w($,e,M),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),m(e,f),m(e,c),V(d,c,null),m(e,h),m(e,g),V(y,g,null),m(e,b),m(e,v),S=!0},p($,M){const T={};M&393217&&(T.$$scope={dirty:M,ctx:$}),i.$set(T);const E={};M&393217&&(E.$$scope={dirty:M,ctx:$}),r.$set(E);const D={};M&393217&&(D.$$scope={dirty:M,ctx:$}),u.$set(D);const P={};M&393217&&(P.$$scope={dirty:M,ctx:$}),d.$set(P);const L={};M&393217&&(L.$$scope={dirty:M,ctx:$}),y.$set(L)},i($){S||(A(i.$$.fragment,$),A(r.$$.fragment,$),A(u.$$.fragment,$),A(d.$$.fragment,$),A(y.$$.fragment,$),$&&Mt(()=>{C||(C=at(e,Xt,{duration:150},!0)),C.run(1)}),S=!0)},o($){F(i.$$.fragment,$),F(r.$$.fragment,$),F(u.$$.fragment,$),F(d.$$.fragment,$),F(y.$$.fragment,$),$&&(C||(C=at(e,Xt,{duration:150},!1)),C.run(0)),S=!1},d($){$&&k(e),z(i),z(r),z(u),z(d),z(y),$&&C&&C.end()}}}function XE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Endpoint"),s=O(),l=_("input"),p(e,"for",i=n[17]),p(l,"type","text"),p(l,"id",r=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].endpoint),o||(a=Q(l,"input",n[8]),o=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&r!==(r=u[17])&&p(l,"id",r),f&1&&l.value!==u[0].endpoint&&Ce(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function QE(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Bucket"),s=O(),l=_("input"),p(e,"for",i=n[17]),p(l,"type","text"),p(l,"id",r=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].bucket),o||(a=Q(l,"input",n[9]),o=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&r!==(r=u[17])&&p(l,"id",r),f&1&&l.value!==u[0].bucket&&Ce(l,u[0].bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function eP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Region"),s=O(),l=_("input"),p(e,"for",i=n[17]),p(l,"type","text"),p(l,"id",r=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].region),o||(a=Q(l,"input",n[10]),o=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&r!==(r=u[17])&&p(l,"id",r),f&1&&l.value!==u[0].region&&Ce(l,u[0].region)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function tP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Access key"),s=O(),l=_("input"),p(e,"for",i=n[17]),p(l,"type","text"),p(l,"id",r=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].accessKey),o||(a=Q(l,"input",n[11]),o=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&r!==(r=u[17])&&p(l,"id",r),f&1&&l.value!==u[0].accessKey&&Ce(l,u[0].accessKey)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function nP(n){let e,t,i,s,l,r,o;function a(f){n[12](f)}let u={id:n[17],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new _f({props:u}),pe.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=H("Secret"),s=O(),B(l.$$.fragment),p(e,"for",i=n[17])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),V(l,f,c),o=!0},p(f,c){(!o||c&131072&&i!==(i=f[17]))&&p(e,"for",i);const d={};c&13
Line truncated
|
||||
<div class="breadcrumb-item">Files storage</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
|
||||
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content txt-xl m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(C,S){V(e,C,S),w(C,t,S),w(C,i,S),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=Q(o,"submit",Wt(n[14])),h=!0)},p(C,[S]){let $=f;f=v(C),f===$?b[f].p(C,S):(Me(),F(b[$],1,1,()=>{b[$]=null}),Oe(),c=b[f],c?c.p(C,S):(c=b[f]=y[f](C),c.c()),A(c,1),c.m(o,null))},i(C){d||(A(e.$$.fragment,C),A(c),d=!0)},o(C){F(e.$$.fragment,C),F(c),d=!1},d(C){z(e,C),C&&k(t),C&&k(i),b[f].d(),h=!1,g()}}}function sP(n,e,t){let i,s={},l=!1,r=!1,o="",a=!1;W.setDocumentTitle("Files storage"),u();async function u(){t(1,l=!0);try{const $=await ke.Settings.getAll()||{};c($)}catch($){ke.errorResponseHandler($)}t(1,l=!1)}async function f(){if(!(r||!i)){t(2,r=!0);try{const $=await ke.Settings.update(W.filterRedactedProps({s3:s}));c($),Ki({}),mn("Successfully saved Files storage settings.")}catch($){ke.errorResponseHandler($)}t(2,r=!1)}}function c($={}){t(0,s=($==null?void 0:$.s3)||{}),t(3,a=s.enabled),t(6,o=JSON.stringify(s))}function d(){s.enabled=this.checked,t(0,s)}function h(){s.endpoint=this.value,t(0,s)}function g(){s.bucket=this.value,t(0,s)}function y(){s.region=this.value,t(0,s)}function b(){s.accessKey=this.value,t(0,s)}function v($){n.$$.not_equal(s.secret,$)&&(s.secret=$,t(0,s))}const C=()=>f(),S=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=o!=JSON.stringify(s))},[s,l,r,a,i,f,o,d,h,g,y,b,v,C,S]}class lP extends Pe{constructor(e){super(),Ee(this,e,sP,iP,De,{})}}function rP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",r=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=Q(e,"change",n[8]),o=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&r!==(r=u[16])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Dg(n){let e,t,i,s,l,r,o,a,u,f,c;return i=new Fe({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[oP,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field "+(W.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[aP,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field "+(W.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[uP,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=O(),l=_("div"),B(r.$$.fragment),o=O(),a=_("div"),B(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),V(i,t,null),m(e,s),m(e,l),V(r,l,null),m(e,o),m(e,a),V(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const y={};h&1&&(y.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(y.$$scope={dirty:h,ctx:d}),r.$set(y);const b={};h&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(r.$$.fragment,d),A(u.$$.fragment,d),d&&Mt(()=>{f||(f=at(e,Xt,{duration:150},!0)),f.run(1)}),c=!0)},o(d){F(i.$$.fragment,d),F(r.$$.fragment,d),F(u.$$.fragment,d),d&&(f||(f=at(e,Xt,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),z(i),z(r),z(u),d&&f&&f.end()}}}function oP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Minimum password length"),s=O(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",r=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].minPasswordLength),o||(a=Q(l,"input",n[9]),o=!0)},p(u,f){f&65536&&i!==(i=u[16])&&p(e,"for",i),f&65536&&r!==(r=u[16])&&p(l,"id",r),f&1&&Ot(l.value)!==u[0].minPasswordLength&&Ce(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function aP(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[10](b)}let y={id:n[16],disabled:!W.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(y.value=n[0].exceptDomains),o=new Ss({props:y}),pe.push(()=>Ie(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.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(b,v){(!c||v&65536&&l!==(l=b[16]))&&p(e,"for",l);const C={};v&65536&&(C.id=b[16]),v&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&v&1&&(a=!0,C.value=b[0].exceptDomains,je(()=>a=!1)),o.$set(C)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function uP(n){let e,t,i,s,l,r,o,a,u,f,c,d,h;function g(b){n[11](b)}let y={id:n[16]+".config.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(y.value=n[0].onlyDomains),o=new Ss({props:y}),pe.push(()=>Ie(o,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=O(),s=_("i"),r=O(),B(o.$$.fragment),u=O(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),w(b,r,v),V(o,b,v),w(b,u,v),w(b,f,v),c=!0,d||(h=Xe(St.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(b,v){(!c||v&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const C={};v&65536&&(C.id=b[16]+".config.onlyDomains"),v&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&v&1&&(a=!0,C.value=b[0].onlyDomains,je(()=>a=!1)),o.$set(C)},i(b){c||(A(o.$$.fragment,b),c=!0)},o(b){F(o.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(r),z(o,b),b&&k(u),b&&k(f),d=!1,h()}}}function fP(n){let e,t,i,s;e=new Fe({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[rP,({uniqueId:r})=>({16:r}),({uniqueId:r})=>r?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Dg(n);return{c(){B(e.$$.fragment),t=O(),l&&l.c(),i=st()},m(r,o){V(e,r,o),w(r,t,o),l&&l.m(r,o),w(r,i,o),s=!0},p(r,o){const a={};o&196609&&(a.$$scope={dirty:o,ctx:r}),e.$set(a),r[0].enabled?l?(l.p(r,o),o&1&&A(l,1)):(l=Dg(r),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Me(),F(l,1,1,()=>{l=null}),Oe())},i(r){s||(A(e.$$.fragment,r),A(l),s=!0)},o(r){F(e.$$.fragment,r),F(l),s=!1},d(r){z(e,r),r&&k(t),l&&l.d(r),r&&k(i)}}}function cP(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dP(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ag(n){let e,t,i,s,l,r;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,a){w(o,e,a),s=!0,l||(r=Xe(t=St.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){s||(Mt(()=>{i||(i=at(e,Wn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(o){i||(i=at(e,Wn,{duration:150,start:.7},!1)),i.run(0),s=!1},d(o){o&&k(e),o&&i&&i.end(),l=!1,r()}}}function pP(n){let e,t,i,s,l,r,o;function a(d,h){return d[0].enabled?dP:cP}let u=a(n),f=u(n),c=n[2]&&Ag();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||||
<span class="txt">Email/Password</span>`,t=O(),f.c(),i=O(),s=_("div"),l=O(),c&&c.c(),r=st(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,r,h),o=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=Ag(),c.c(),A(c,1),c.m(r.parentNode,r)):c&&(Me(),F(c,1,1,()=>{c=null}),Oe())},i(d){o||(A(c),o=!0)},o(d){F(c),o=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(r)}}}function hP(n){let e,t;const i=[n[3]];let s={$$slots:{header:[pP],default:[fP]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ct(s,i[l]);return e=new hf({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){B(e.$$.fragment)},m(l,r){V(e,l,r),t=!0},p(l,[r]){const o=r&8?bn(i,[hi(l[3])]):{};r&131077&&(o.$$scope={dirty:r,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){F(e.$$.fragment,l),t=!1},d(l){n[12](null),z(e,l)}}}function mP(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Ut(e,s),r;hn(n,ys,$=>t(7,r=$));let{config:o={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){o.enabled=this.checked,t(0,o)}function h(){o.minPasswordLength=Ot(this.value),t(0,o)}function g($){n.$$.not_equal(o.exceptDomains,$)&&(o.exceptDomains=$,t(0,o))}function y($){n.$$.not_equal(o.onlyDomains,$)&&(o.onlyDomains=$,t(0,o))}function b($){pe[$?"unshift":"push"](()=>{a=$,t(1,a)})}function v($){ft.call(this,n,$)}function C($){ft.call(this,n,$)}function S($){ft.call(this,n,$)}return n.$$set=$=>{e=ct(ct({},e),di($)),t(3,l=Ut(e,s)),"config"in $&&t(0,o=$.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(r==null?void 0:r.emailPassword))},[o,a,i,l,u,f,c,r,d,h,g,y,b,v,C,S]}class gP extends Pe{constructor(e){super(),Ee(this,e,mP,hP,De,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function _P(n){let e,t,i,s,l,r,o,a;return{c(){e=_("input"),i=O(),s=_("label"),l=H("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"for",r=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),o||(a=Q(e,"change",n[11]),o=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&r!==(r=u[22])&&p(s,"for",r)},d(u){u&&k(e),u&&k(i),u&&k(s),o=!1,a()}}}function Eg(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g;l=new Fe({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[bP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[yP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Fe({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[vP,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let y=n[4]&&Pg(n);return{c(){e=_("div"),t=_("div"),i=O(),s=_("div"),B(l.$$.fragment),r=O(),o=_("div"),B(a.$$.fragment),u=O(),f=_("div"),B(c.$$.fragment),d=O(),y&&y.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,v){w(b,e,v),m(e,t),m(e,i),m(e,s),V(l,s,null),m(e,r),m(e,o),V(a,o,null),m(e,u),m(e,f),V(c,f,null),m(e,d),y&&y.m(e,null),g=!0},p(b,v){const C={};v&2&&(C.name=b[1]+".clientId"),v&12582913&&(C.$$scope={dirty:v,ctx:b}),l.$set(C);const S={};v&2&&(S.name=b[1]+".clientSecret"),v&12582913&&(S.$$scope={dirty:v,ctx:b}),a.$set(S);const $={};v&2&&($.name=b[1]+".allowRegistrations"),v&12582913&&($.$$scope={dirty:v,ctx:b}),c.$set($),b[4]?y?(y.p(b,v),v&16&&A(y,1)):(y=Pg(b),y.c(),A(y,1),y.m(e,null)):y&&(Me(),F(y,1,1,()=>{y=null}),Oe())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(y),b&&Mt(()=>{h||(h=at(e,Xt,{duration:200},!0)),h.run(1)}),g=!0)},o(b){F(l.$$.fragment,b),F(a.$$.fragment,b),F(c.$$.fragment,b),F(y),b&&(h||(h=at(e,Xt,{duration:200},!1)),h.run(0)),g=!1},d(b){b&&k(e),z(l),z(a),z(c),y&&y.d(),b&&h&&h.end()}}}function bP(n){let e,t,i,s,l,r,o,a;return{c(){e=_("label"),t=H("Client ID"),s=O(),l=_("input"),p(e,"for",i=n[22]),p(l,"type","text"),p(l,"id",r=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].clientId),o||(a=Q(l,"input",n[12]),o=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&r!==(r=u[22])&&p(l,"id",r),f&1&&l.value!==u[0].clientId&&Ce(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),o=!1,a()}}}function yP(n){let e,t,i,s,l,r,o;function a(f){n[13](f)}let u={id:n[22],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new _f({props:u}),pe.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=H("Client Secret"),s=O(),B(l.$$.fragment),p(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),V(l,f,c),o=!0},p(f,c){(!o||c&4194304&&i!==(i=f[22]))&&p(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!r&&c&Line truncated
|
||||
<div class="breadcrumb-item">Auth providers</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","m-b-base"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(C,S){V(e,C,S),w(C,t,S),w(C,i,S),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=Q(o,"submit",Wt(n[5])),h=!0)},p(C,[S]){let $=f;f=v(C),f===$?b[f].p(C,S):(Me(),F(b[$],1,1,()=>{b[$]=null}),Oe(),c=b[f],c?c.p(C,S):(c=b[f]=y[f](C),c.c()),A(c,1),c.m(o,null))},i(C){d||(A(e.$$.fragment,C),A(c),d=!0)},o(C){F(e.$$.fragment,C),F(c),d=!1},d(C){z(e,C),C&&k(t),C&&k(i),b[f].d(),h=!1,g()}}}function LP(n,e,t){let i,s,l={},r=!1,o=!1,a="";W.setDocumentTitle("Auth providers"),u();async function u(){t(2,r=!0);try{const S=await ke.Settings.getAll()||{};c(S)}catch(S){ke.errorResponseHandler(S)}t(2,r=!1)}async function f(){if(!(o||!i)){t(3,o=!0);try{const S=await ke.Settings.update(W.filterRedactedProps(l));c(S),Ki({}),s==null||s.collapseSiblings(),mn("Successfully updated auth providers.")}catch(S){ke.errorResponseHandler(S)}t(3,o=!1)}}function c(S){S=S||{},t(0,l={}),t(0,l.emailAuth=Object.assign({enabled:!0},S.emailAuth),l);const $=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of $)t(0,l[M]=Object.assign({enabled:!1,allowRegistrations:!0},S[M]),l);t(6,a=JSON.stringify(l))}function d(S){pe[S?"unshift":"push"](()=>{s=S,t(1,s)})}function h(S){n.$$.not_equal(l.emailAuth,S)&&(l.emailAuth=S,t(0,l))}function g(S){n.$$.not_equal(l.googleAuth,S)&&(l.googleAuth=S,t(0,l))}function y(S){n.$$.not_equal(l.facebookAuth,S)&&(l.facebookAuth=S,t(0,l))}function b(S){n.$$.not_equal(l.githubAuth,S)&&(l.githubAuth=S,t(0,l))}function v(S){n.$$.not_equal(l.gitlabAuth,S)&&(l.gitlabAuth=S,t(0,l))}const C=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(l))},[l,s,r,o,i,f,a,d,h,g,y,b,v,C]}class FP extends Pe{constructor(e){super(),Ee(this,e,LP,PP,De,{})}}function Ig(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function IP(n){let e=[],t=new Map,i,s,l,r,o,a,u,f,c,d,h=n[4];const g=y=>y[12].key;for(let y=0;y<h.length;y+=1){let b=Ig(n,h,y),v=g(b);t.set(v,e[y]=Ng(v,b))}return{c(){for(let y=0;y<e.length;y+=1)e[y].c();i=O(),s=_("div"),l=_("div"),r=O(),o=_("button"),a=_("span"),a.textContent="Save changes",p(l,"class","flex-fill"),p(a,"class","txt"),p(o,"type","submit"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[3]||n[2],ee(o,"btn-loading",n[2]),p(s,"class","flex")},m(y,b){for(let v=0;v<e.length;v+=1)e[v].m(y,b);w(y,i,b),w(y,s,b),m(s,l),m(s,r),m(s,o),m(o,a),f=!0,c||(d=Q(o,"click",n[9]),c=!0)},p(y,b){b&32785&&(h=y[4],Me(),e=rt(e,b,g,1,y,h,t,i.parentNode,Ft,Ng,i,Ig),Oe()),(!f||b&12&&u!==(u=!y[3]||y[2]))&&(o.disabled=u),b&4&&ee(o,"btn-loading",y[2])},i(y){if(!f){for(let b=0;b<h.length;b+=1)A(e[b]);f=!0}},o(y){for(let b=0;b<e.length;b+=1)F(e[b]);f=!1},d(y){for(let b=0;b<e.length;b+=1)e[b].d(y);y&&k(i),y&&k(s),c=!1,d()}}}function NP(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function RP(n){let e,t=n[12].label+"",i,s,l,r,o,a,u,f,c,d,h;function g(){n[7].call(o,n[12])}function y(){return n[8](n[12])}return{c(){e=_("label"),i=H(t),s=H(" duration (in seconds)"),r=O(),o=_("input"),u=O(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[15]),p(o,"type","number"),p(o,"id",a=n[15]),o.required=!0,p(c,"class","link-primary"),ee(c,"txt-success",n[0][n[12].key].secret),p(f,"class","help-block")},m(b,v){w(b,e,v),m(e,i),m(e,s),w(b,r,v),w(b,o,v),Ce(o,n[0][n[12].key].duration),w(b,u,v),w(b,f,v),m(f,c),d||(h=[Q(o,"input",g),Q(c,"click",y)],d=!0)},p(b,v){n=b,v&32768&&l!==(l=n[15])&&p(e,"for",l),v&32768&&a!==(a=n[15])&&p(o,"id",a),v&17&&Ot(o.value)!==n[0][n[12].key].duration&&Ce(o,n[0][n[12].key].duration),v&17&&ee(c,"txt-success",n[0][n[12].key].secret)},d(b){b&&k(e),b&&k(r),b&&k(o),b&&k(u),b&&k(f),d=!1,lt(h)}}}function Ng(n,e){let t,i,s;return i=new Fe({props:{class:"form-field required",name:e[12].key+".duration",$$slots:{default:[RP,({uniqueId:l})=>({15:l}),({uniqueId:l})=>l?32768:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=st(),B(i.$$.fragment),this.first=t},m(l,r){w(l,t,r),V(i,l,r),s=!0},p(l,r){e=l;const o={};r&98305&&(o.$$scope={dirty:r,ctx:e}),i.$set(o)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){F(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function jP(n){let e,t,i,s,l,r,o,a,u,f,c,d,h,g;e=new nl({});const y=[NP,IP],b=[];function v(C,S){return C[1]?0:1}return f=v(n),c=b[f]=y[f](n),{c(){B(e.$$.fragment),t=O(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Token options</div></nav>`,l=O(),r=_("div"),o=_("form"),a=_("div"),a.innerHTML="<p>Adjust common token options.</p>",u=O(),c.c(),p(s,"class","page-header"),p(a,"class","content m-b-sm txt-xl"),p(o,"class","panel"),p(o,"autocomplete","off"),p(r,"class","wrapper"),p(i,"class","page-wrapper")},m(C,S){V(e,C,S),w(C,t,S),w(C,i,S),m(i,s),m(i,l),m(i,r),m(r,o),m(o,a),m(o,u),b[f].m(o,null),d=!0,h||(g=Q(o,"submit",Wt(n[5])),h=!0)},p(C,[S]){let $=f;f=v(C),f===$?b[f].p(C,S):(Me(),F(b[$],1,1,()=>{b[$]=null}),Oe(),c=b[f],c?c.p(C,S):(c=b[f]=y[f](C),c.c()),A(c,1),c.m(o,null))},i(C){d||(A(e.$$.fragment,C),A(c),d=!0)},o(C){F(e.$$.fragment,C),F(c),d=!1},d(C){z(e,C),C&&k(t),C&&k(i),b[f].d(),h=!1,g()}}}function HP(n,e,t){let i;const s=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];let l={},r=!1,o=!1,a="";W.setDocumentTitle("Token options"),u();async function u(){t(1,r=!0);try{const y=await ke.Settings.getAll()||{};c(y)}catch(y){ke.errorResponseHandler(y)}t(1,r=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const y=await ke.Settings.update(W.filterRedactedProps(l));c(y),mn("Successfully saved tokens options.")}catch(y){ke.errorResponseHandler(y)}t(2,o=!1)}}function c(y){var b;y=y||{},t(0,l={});for(const v of s)t(0,l[v.key]={duration:((b=y[v.key])==null?void 0:b.duration)||0},l);t(6,a=JSON.stringify(l))}function d(y){l[y.key].duration=Ot(this.value),t(0,l)}const h=y=>{l[y.key].secret?(delete l[y.key].secret,t(0,l)):t(0,l[y.key].secret=W.randomString(50),l)},g=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,r,o,i,s,f,a,d,h,g]}class qP extends Pe{constructor(e){super(),Ee(this,e,HP,jP,De,{})}}const dn=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Zs("/"):!0}],VP={"/login":ln({component:vE,conditions:dn.concat([n=>!ke.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":ln({asyncComponent:()=>as(()=>import("./PageAdminRequestPasswordReset.a8239219.js"),[]),conditions:dn.concat([n=>!ke.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":ln({asyncComponent:()=>as(()=>import("./PageAdminConfirmPasswordReset.f7f2a32f.js"),[]),conditions:dn.concat([n=>!ke.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":ln({component:wA,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":ln({component:L$,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users":ln({component:YA,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":ln({asyncComponent:()=>as(()=>import("./PageUserConfirmPasswordReset.32ee3e15.js"),[]),conditions:dn.concat([()=>(ke.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":ln({asyncComponent:()=>as(()=>import("./PageUserConfirmVerification.f90e9f1a.js"),[]),conditions:dn.concat([()=>(ke.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":ln({asyncComponent:()=>as(()=>import("./PageUserConfirmEmailChange.78f6ba62.js"),[]),conditions:dn.concat([()=>(ke.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/settings":ln({component:TE,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":ln({component:hE,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":ln({component:JE,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":ln({component:lP,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":ln({component:FP,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":ln({component:qP,conditions:dn.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"*":ln({component:u2,userData:{showAppSidebar:!1}})};function zP(n,{from:e,to:t},i={}){const s=getComputedStyle(n),l=s.transform==="none"?"":s.transform,[r,o]=s.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*r/t.width-(t.left+r),u=e.top+e.height*o/t.height-(t.top+o),{delay:f=0,duration:c=h=>Math.sqrt(h)*120,easing:d=Eo}=i;return{delay:f,duration:Jn(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const y=g*a,b=g*u,v=h+g*e.width/t.width,C=h+g*e.height/t.height;return`transform: ${l} translate(${y}px, ${b}px) scale(${v}, ${C});`}}}function Rg(n,e,t){const i=n.slice();return i[2]=e[t],i}function BP(n){let e;return{c(){e=_("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function UP(n){let e;return{c(){e=_("i"),p(e,"class","ri-chLine truncated
|
||||
<span class="txt">Manage admins</span>`,t=O(),i=_("hr"),s=O(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
|
||||
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"tabindex","0"),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),r||(o=[Xe(On.call(null,e)),Q(l,"click",n[4])],r=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),r=!1,lt(o)}}}function tL(n){var c;let e,t,i,s,l,r,o,a,u,f=((c=n[1])==null?void 0:c.id)&&n[0]&&Hg(n);return s=new a1({props:{routes:VP}}),s.$on("routeLoading",n[2]),s.$on("conditionsFailed",n[3]),r=new JP({}),a=new QP({}),{c(){e=_("div"),f&&f.c(),t=O(),i=_("div"),B(s.$$.fragment),l=O(),B(r.$$.fragment),o=O(),B(a.$$.fragment),p(i,"class","app-body"),p(e,"class","app-layout")},m(d,h){w(d,e,h),f&&f.m(e,null),m(e,t),m(e,i),V(s,i,null),w(d,l,h),V(r,d,h),w(d,o,h),V(a,d,h),u=!0},p(d,[h]){var g;((g=d[1])==null?void 0:g.id)&&d[0]?f?(f.p(d,h),h&3&&A(f,1)):(f=Hg(d),f.c(),A(f,1),f.m(e,t)):f&&(Me(),F(f,1,1,()=>{f=null}),Oe())},i(d){u||(A(f),A(s.$$.fragment,d),A(r.$$.fragment,d),A(a.$$.fragment,d),u=!0)},o(d){F(f),F(s.$$.fragment,d),F(r.$$.fragment,d),F(a.$$.fragment,d),u=!1},d(d){d&&k(e),f&&f.d(),z(s),d&&k(l),z(r,d),d&&k(o),z(a,d)}}}function nL(n,e,t){let i;hn(n,Bu,u=>t(1,i=u));let s,l=!1;function r(u){var f,c,d,h;((f=u==null?void 0:u.detail)==null?void 0:f.location)!==s&&(t(0,l=!!((d=(c=u==null?void 0:u.detail)==null?void 0:c.userData)!=null&&d.showAppSidebar)),s=(h=u==null?void 0:u.detail)==null?void 0:h.location,W.setDocumentTitle(""),Ki({}),Fb())}function o(){Zs("/")}function a(){ke.logout()}return[l,i,r,o,a]}class iL extends Pe{constructor(e){super(),Ee(this,e,nL,tL,De,{})}}new iL({target:document.getElementById("app")});export{lt as A,mn as B,W as C,Zs as D,st as E,I0 as F,hn as G,Gs as H,_n as I,pi as J,pe as K,Fn as P,Pe as S,F as a,O as b,B as c,z as d,_ as e,p as f,w as g,m as h,Ee as i,Xe as j,Me as k,On as l,V as m,Oe as n,k as o,ke as p,Fe as q,ee as r,De as s,A as t,Q as u,Wt as v,H as w,me as x,oe as y,Ce as z};
|
||||
Vendored
+372
@@ -0,0 +1,372 @@
|
||||
const p_=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)}};p_();function oe(){}const ml=n=>n;function ht(n,e){for(const t in e)n[t]=e[t];return n}function Np(n){return n()}function Ua(){return Object.create(null)}function ot(n){n.forEach(Np)}function En(n){return typeof n=="function"}function Oe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Al;function Zn(n,e){return Al||(Al=document.createElement("a")),Al.href=e,n===Al.href}function m_(n){return Object.keys(n).length===0}function Rp(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function cn(n,e,t){n.$$.on_destroy.push(Rp(e,t))}function $n(n,e,t,i){if(n){const s=Hp(n,e,t,i);return n[0](s)}}function Hp(n,e,t,i){return n[1]&&i?ht(t.ctx.slice(),n[1](i(e))):t.ctx}function Cn(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;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function Mn(n,e,t,i,s,l){if(s){const o=Hp(e,t,i,l);n.p(o,s)}}function Tn(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function si(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ut(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function Wa(n){return n==null?"":n}function jp(n,e,t){return n.set(t),e}function xe(n){return n&&En(n.destroy)?n.destroy:oe}const qp=typeof window<"u";let Oo=qp?()=>window.performance.now():()=>Date.now(),ta=qp?n=>requestAnimationFrame(n):oe;const ps=new Set;function Vp(n){ps.forEach(e=>{e.c(n)||(ps.delete(e),e.f())}),ps.size!==0&&ta(Vp)}function Eo(n){let e;return ps.size===0&&ta(Vp),{promise:new Promise(t=>{ps.add(e={c:n,f:t})}),abort(){ps.delete(e)}}}function m(n,e){n.appendChild(e)}function zp(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function g_(n){const e=_("style");return __(zp(n),e),e.sheet}function __(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Hn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function j(n){return document.createTextNode(n)}function T(){return j(" ")}function lt(){return j("")}function X(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Wt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function jn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Bp(n){return function(e){e.target===this&&n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ii(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?n[i]=e[i]:h(n,i,e[i])}function Dt(n){return n===""?null:+n}function b_(n){return Array.from(n.childNodes)}function _e(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function $e(n,e){n.value=e==null?"":e}function Ya(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function Q(n,e,t){n.classList[t?"add":"remove"](e)}function Up(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const oo=new Map;let ro=0;function v_(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function y_(n,e){const t={stylesheet:g_(e),rules:{}};return oo.set(n,t),t}function sl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
|
||||
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
|
||||
`}const f=u+`100% {${o(t,1-t)}}
|
||||
}`,c=`__svelte_${v_(f)}_${r}`,d=zp(n),{stylesheet:p,rules:g}=oo.get(d)||y_(d,n);g[c]||(g[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ro+=1,c}function ll(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(", "),ro-=s,ro||k_())}function k_(){ta(()=>{ro||(oo.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),oo.clear())})}function w_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=ml,start:a=Oo()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,g;function v(){c&&(g=sl(n,0,1,o,l,r,c)),l||(p=!0)}function b(){c&&ll(n,g),d=!1}return Eo(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),b()),!d)return!1;if(p){const $=y-a,S=0+1*r($/o);f(S,1-S)}return!0}),v(),f(0,1),b}function S_(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,Wp(n,s)}}function Wp(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 ol;function Ks(n){ol=n}function Ao(){if(!ol)throw new Error("Function called outside component initialization");return ol}function Bn(n){Ao().$$.on_mount.push(n)}function $_(n){Ao().$$.after_update.push(n)}function C_(n){Ao().$$.on_destroy.push(n)}function rn(){const n=Ao();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Up(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function dt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const zs=[],me=[],eo=[],wr=[],Yp=Promise.resolve();let Sr=!1;function Kp(){Sr||(Sr=!0,Yp.then(Zp))}function _i(){return Kp(),Yp}function Tt(n){eo.push(n)}function Re(n){wr.push(n)}const Yo=new Set;let Pl=0;function Zp(){const n=ol;do{for(;Pl<zs.length;){const e=zs[Pl];Pl++,Ks(e),M_(e.$$)}for(Ks(null),zs.length=0,Pl=0;me.length;)me.pop()();for(let e=0;e<eo.length;e+=1){const t=eo[e];Yo.has(t)||(Yo.add(t),t())}eo.length=0}while(zs.length);for(;wr.length;)wr.pop()();Sr=!1,Yo.clear(),Ks(n)}function M_(n){if(n.fragment!==null){n.update(),ot(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let Es;function na(){return Es||(Es=Promise.resolve(),Es.then(()=>{Es=null})),Es}function Gi(n,e,t){n.dispatchEvent(Up(`${e?"intro":"outro"}${t}`))}const to=new Set;let ei;function Te(){ei={r:0,c:[],p:ei}}function De(){ei.r||ot(ei.c),ei=ei.p}function A(n,e){n&&n.i&&(to.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(to.has(n))return;to.add(n),ei.c.push(()=>{to.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ia={duration:0};function sa(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&ll(n,l)}function u(){const{delay:c=0,duration:d=300,easing:p=ml,tick:g=oe,css:v}=i||ia;v&&(l=sl(n,0,1,d,c,p,v,r++)),g(0,1);const b=Oo()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>Gi(n,!0,"start")),o=Eo($=>{if(s){if($>=y)return g(1,0),Gi(n,!0,"end"),a(),s=!1;if($>=b){const S=p(($-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,ll(n),En(i)?(i=i(),na().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Jp(n,e,t){let i=e(n,t),s=!0,l;const o=ei;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=ml,tick:c=oe,css:d}=i||ia;d&&(l=sl(n,1,0,u,a,f,d));const p=Oo()+a,g=p+u;Tt(()=>Gi(n,!1,"start")),Eo(v=>{if(s){if(v>=g)return c(0,1),Gi(n,!1,"end"),--o.r||ot(o.c),!1;if(v>=p){const b=f((v-p)/u);c(1-b,b)}}return s})}return En(i)?na().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&ll(n,l),s=!1)}}}function ct(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&ll(n,a)}function f(d,p){const g=d.b-l;return p*=Math.abs(g),{a:l,b:d.b,d:g,duration:p,start:d.start,end:d.start+p,group:d.group}}function c(d){const{delay:p=0,duration:g=300,easing:v=ml,tick:b=oe,css:y}=s||ia,$={start:Oo()+p,b:d};d||($.group=ei,ei.r+=1),o||r?r=$:(y&&(u(),a=sl(n,l,d,g,p,v,y)),d&&b(0,1),o=f($,g),Tt(()=>Gi(n,d,"start")),Eo(S=>{if(r&&S>r.start&&(o=f(r,g),r=null,Gi(n,o.b,"start"),y&&(u(),a=sl(n,l,o.b,o.duration,0,v,s.css))),o){if(S>=o.end)b(l=o.b,1-l),Gi(n,o.b,"end"),r||(o.b?u():--o.group.r||ot(o.group.c)),o=null;else if(S>=o.start){const C=S-o.start;l=o.a+o.d*v(C/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){En(s)?na().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function ln(n,e){n.d(1),e.delete(n.key)}function Ft(n,e){L(n,1,1,()=>{e.delete(n.key)})}function T_(n,e){n.f(),Ft(n,e)}function ut(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,p=
Line truncated
|
||||
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=T(),i=_("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function W1(n){let e,t,i,s,l,o,r,a,u=!n[0]&&Su();const f=n[2].default,c=$n(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),u&&u.c(),l=T(),c&&c.c(),o=T(),r=_("div"),h(t,"class","flex-fill"),h(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),h(r,"class","flex-fill"),h(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,p){w(d,e,p),m(e,t),m(e,i),m(e,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,o),m(e,r),a=!0},p(d,[p]){d[0]?u&&(u.d(1),u=null):u||(u=Su(),u.c(),u.m(s,l)),c&&c.p&&(!a||p&2)&&Mn(c,f,d,d[1],a?Cn(f,d[1],p,null):Tn(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){L(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function Y1(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(1,s=o.$$scope)},[l,s,i]}class rg extends Ae{constructor(e){super(),Ee(this,e,Y1,W1,Oe,{nobranding:0})}}function $u(n,e,t){const i=n.slice();return i[11]=e[t],i}const K1=n=>({}),Cu=n=>({uniqueId:n[3]});function Z1(n){let e=(n[11]||po)+"",t;return{c(){t=j(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||po)+"")&&_e(t,e)},d(i){i&&k(t)}}}function J1(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||po)+"",t;return{c(){t=j(e)},m(l,o){w(l,t,o)},p(l,o){var r,a;o&4&&e!==(e=(((r=l[11])==null?void 0:r.message)||((a=l[11])==null?void 0:a.code)||po)+"")&&_e(t,e)},d(l){l&&k(t)}}}function Mu(n){let e,t;function i(o,r){return typeof o[11]=="object"?J1:Z1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),h(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function G1(n){let e,t,i,s,l;const o=n[7].default,r=$n(o,n,n[6],Cu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Mu($u(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();h(e,"class",n[0]),Q(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=X(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Mn(r,o,f,f[6],i?Cn(o,f[6],c,K1):Tn(f[6]),Cu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const p=$u(f,a,d);u[d]?u[d].p(p,c):(u[d]=Mu(p),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&h(e,"class",f[0]),c&5&&Q(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){L(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),Hn(u,f),n[9](null),s=!1,l()}}}const po="Invalid value";function X1(n,e,t){let i;cn(n,ns,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){og(r)}Bn(()=>(u.addEventListener("change",c),()=>{u.removeEventListener("change",c)}));function d(g){dt.call(this,n,g)}function p(g){me[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=U.toArray(U.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,p]}class Fe extends Ae{constructor(e){super(),Ee(this,e,X1,G1,Oe,{name:4,class:0})}}function Q1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Email"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0]),l.focus(),r||(a=X(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&$e(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function x1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=j("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[1]),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&h(e,"for",i),d&512&&o!==(o=c[9])&&h(l,"id",o),d&2&&l.value!==c[1]&&$e(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function eb(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Password confirm"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[2]),r||(a=X(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&$e(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function tb(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return s=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[Q1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Fe({props:{Line truncated
|
||||
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),q(a,e,null),m(e,u),m(e,f),c=!0,d||(p=X(e,"submit",Wt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&1540&&($.$$scope={dirty:v,ctx:g}),a.$set($),v&8&&Q(f,"btn-disabled",g[3]),v&8&&Q(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,p()}}}function nb(n,e,t){const i=rn();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ke.Admins.create({email:s,password:l,passwordConfirm:o}),await ke.Admins.authViaEmail(s,l),i("submit")}catch(d){ke.errorResponseHandler(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 ib extends Ae{constructor(e){super(),Ee(this,e,nb,tb,Oe,{})}}function Tu(n){let e,t;return e=new rg({props:{$$slots:{default:[sb]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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 sb(n){let e,t;return e=new ib({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lb(n){let e,t,i=n[0]&&Tu(n);return{c(){i&&i.c(),e=lt()},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=Tu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Te(),L(i,1,1,()=>{i=null}),De())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function ob(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ke.logout(!1),t(0,i=!0);return}ke.AuthStore.isValid?$s("/collections"):ke.logout()}return[i,async()=>{t(0,i=!1),await _i(),window.location.search=""}]}class rb extends Ae{constructor(e){super(),Ee(this,e,ob,lb,Oe,{})}}function Ro(n){const e=n-1;return e*e*e+1}function mo(n,{delay:e=0,duration:t=400,easing:i=ml}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Gn(n,{delay:e=0,duration:t=400,easing:i=Ro,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);return{delay:e,duration:t,easing:i,css:(c,d)=>`
|
||||
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
|
||||
opacity: ${a-f*d}`}}function Xt(n,{delay:e=0,duration:t=400,easing:i=Ro}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:p=>`overflow: hidden;opacity: ${Math.min(p*20,1)*l};height: ${p*o}px;padding-top: ${p*r}px;padding-bottom: ${p*a}px;margin-top: ${p*u}px;margin-bottom: ${p*f}px;border-top-width: ${p*c}px;border-bottom-width: ${p*d}px;`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Ro,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}
|
||||
`}}function ab(n){let e,t,i,s;return{c(){e=_("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),$e(e,n[7]),i||(s=X(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&$e(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function ub(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),me.push(()=>Ie(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=lt()},m(a,u){e&&q(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(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],Re(()=>t=!1)),o!==(o=a[4])){if(e){Te();const c=e;L(c.$$.fragment,1,0,()=>{V(c,1)}),De()}o?(e=new o(r(a)),me.push(()=>Ie(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&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 Du(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Ou();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',h(t,"type","button"),h(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=X(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Ou(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Te(),L(r,1,1,()=>{r=null}),De())},i(a){s||(A(r),Tt(()=>{i||(i=ct(t,Gn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){L(r),i||(i=ct(t,Gn,{duration:150,x:5},!1)),i.run(0),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Ou(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=ct(e,Gn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=ct(e,Gn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function fb(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[ub,ab],p=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=p[o]=d[o](n);let v=(n[0].length||n[7].length)&&Du(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),h(s,"class","ri-search-line"),h(i,"for",n[8]),h(i,"class","m-l-10 txt-xl"),h(t,"class","searchbar"),h(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),p[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[X(t,"submit",Wt(n[10])),X(e,"click",jn(n[11]))],f=!0)},p(b,[y]){let $=o;o=g(b),o===$?p[o].p(b,y):(Te(),L(p[$],1,1,()=>{p[$]=null}),De(),r=p[o],r?r.p(b,y):(r=p[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Du(b),v.c(),A(v,1),v.m(t,null)):v&&(Te(),L(v,1,1,()=>{v=null}),De())},i(b){u||(A(r),A(v),u=!0)},o(b){L(r),L(v),u=!1},d(b){b&&k(e),p[o].d(),v&&v.d(),f=!1,ot(c)}}}function cb(n,e,t){const i=rn(),s="search_"+U.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new On}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function p(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ki(()=>import("./FilterAutocompleteInput.65d23b87.js"),[])).default),t(5,f=!1))}Bn(()=>{v()});function b(M){dt.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function $(M){me[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const C=()=>{p(!1),g()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,p,g,b,y,$,S,C]}class Ho extends Ae{constructor(e){super(),Ee(this,e,cb,fb,Oe,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Ir,qi;const Nr="app-tooltip";function Eu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Oi(){return qi=qi||document.querySelector("."+Nr),qi||(qi=document.createElement("div"),qi.classList.add(Nr),document.body.appendChild(qi)),qi}function ag(n,e){let t=Oi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Rr();return}t.textContent=e.text,t.className=Nr+" active",e.class&&t.classList.add(e.class),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.posi
Line truncated
|
||||
<span class="txt">method</span>`,h(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function wb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",h(t,"class",U.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Sb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",h(t,"class",U.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function $b(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",h(t,"class",U.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Cb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",U.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Pu(n){let e;function t(l,o){return l[6]?Tb:Mb}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},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){s.d(l),l&&k(e)}}}function Mb(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Lu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Lu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Tb(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Lu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Fu(n){let e;return{c(){e=_("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Iu(n,e){var ae,G,Ce;let t,i,s,l=((ae=e[21].method)==null?void 0:ae.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,p,g,v,b,y,$=(e[21].referer||"N/A")+"",S,C,M,D,P,O=e[21].status+"",F,E,N,Z,ne,te,H,W,Y,K,ee=(((G=e[21].meta)==null?void 0:G.errorMessage)||((Ce=e[21].meta)==null?void 0:Ce.errorData))&&Fu();Z=new mi({props:{date:e[21].created}});function re(){return e[16](e[21])}function be(...de){return e[17](e[21],...de)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=j(l),a=T(),u=_("td"),f=_("span"),d=j(c),g=T(),ee&&ee.c(),v=T(),b=_("td"),y=_("span"),S=j($),M=T(),D=_("td"),P=_("span"),F=j(O),E=T(),N=_("td"),z(Z.$$.fragment),ne=T(),te=_("td"),te.innerHTML='<i class="ri-arrow-right-line"></i>',H=T(),h(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",p=e[21].url),h(u,"class","col-type-text col-field-url"),h(y,"class","txt txt-ellipsis"),h(y,"title",C=e[21].referer),Q(y,"txt-hint",!e[21].referer),h(b,"class","col-type-text col-field-referer"),h(P,"class","label"),Q(P,"label-danger",e[21].status>=400),h(D,"class","col-type-number col-field-status"),h(N,"class","col-type-date col-field-created"),h(te,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(de,fe){w(de,t,fe),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ee&&ee.m(u,null),m(t,v),m(t,b),m(b,y),m(y,S),m(t,M),m(t,D),m(D,P),m(P,F),m(t,E),m(t,N),q(Z,N,null),m(t,ne),m(t,te),m(t,H),W=!0,Y||(K=[X(t,"click",re),X(t,"keydown",be)],Y=!0)},p(de,fe){var x,ve,He;e=de,(!W||fe&8)&&l!==(l=((x=e[21].method)==null?void 0:x.toUpperCase())+"")&&_e(o,l),(!W||fe&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&h(s,"class",r),(!W||fe&8)&&c!==(c=e[21].url+"")&&_e(d,c),(!W||fe&8&&p!==(p=e[21].url))&&h(f,"title",p),((ve=e[21].meta)==null?void 0:ve.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?ee||(ee=Fu(),ee.c(),ee.m(u,null)):ee&&(ee.d(1),ee=null),(!W||fe&8)&&$!==($=(e[21].referer||"N/A")+"")&&_e(S,$),(!W||fe&8&&C!==(C=e[21].referer))&&h(y,"title",C),fe&8&&Q(y,"txt-hint",!e[21].referer),(!W||fe&8)&&O!==(O=e[21].status+"")&&_e(F,O),fe&8&&Q(P,"label-danger",e[21].status>=400);const se={};fe&8&&(se.date=e[21].created),Z.$set(se)},i(de){W||(A(Z.$$.fragment,de),W=!0)},o(de){L(Z.$$.fragment,de),W=!1},d(de){de&&k(t),ee&&ee.d(),V(Z),Y=!1,ot(K)}}}function Nu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=j("Showing "),s=j(i),l=j(" of "),o=j(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&_e(s,i),a&16&&_e(o,r[4])},d(r){r&&k(e)}}}function Ru(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=j("Load more ("),o=j(l),r=j(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[6]),Q(t,"btn-disabled",n[6]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&_e(o,l),c&64&&Q(t,"btn-loading",f[6]),c&64&&Q(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function Db(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S,C,M,D,P=[],O=new Map,F,E,N,Z;function ne(x){n[11](x)}let te={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[kb]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),l=new xt({props:te}),me.push(()=>Ie(l,"sort",ne));function H(x){n[12](x)}let W={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[wb]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),a=new xt({props:W}),me.push(()=>Ie(a,"sort",H));function Y(x){n[13](x)}let K={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Sb]},$$scope:{ctx:n}};n[1]!==void 0&&(K.sort=n[1]),c=new xt({props:K}),me.push(()=>Ie(c,"sort",Y));function ee(x){n[14](x)}let re={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[$b]},$$scope:{ctx:n}};n[1]!==void 0&&(re.sort=n[1]),g=new xt({props:re}),me.push(()=>Ie(g,"sort",ee));function be(x){n[15](x)}let ae={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Cb]},$$scope:{ctx:n}};n[1]!==void 0&&(ae.sort=n[1]),y=new xt({props:ae}),me.push(()=>Ie(y,"sort",be));let G=n[3];const Ce=x=>x[21].id;for(let x=0;x<G.length;x+=1){let ve=Au(n,G,x),He=Ce(ve);O.set(He,P[x]=Iu(He,ve))}let de=null;G.length||
Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/const ug=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function fg(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,ug.call(window,()=>{s=!1,n.apply(e,l)}))}}function Ab(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Pb=n=>n==="start"?"left":n==="end"?"right":"center",Hu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ai(){}const Lb=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function Lt(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 pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const qt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Ln(n,e){return qt(n)?n:e}function gt(n,e){return typeof n>"u"?e:n}const Fb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,cg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Ct(n,e,t,i){let s,l,o;if(Lt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(pt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function go(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function _o(n){if(Lt(n))return n.map(_o);if(pt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=_o(n[t[s]]);return e}return n}function dg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ib(n,e,t,i){if(!dg(n))return;const s=e[n],l=t[n];pt(s)&&pt(l)?rl(s,l,i):e[n]=_o(l)}function rl(n,e,t){const i=Lt(e)?e:[e],s=i.length;if(!pt(n))return n;t=t||{};const l=t.merger||Ib;for(let o=0;o<s;++o){if(e=i[o],!pt(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function Qs(n,e){return rl(n,e,{merger:Nb})}function Nb(n,e,t){if(!dg(n))return;const i=e[n],s=t[n];pt(i)&&pt(s)?Qs(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=_o(s))}const Rb="",Hb=".";function ju(n,e){const t=n.indexOf(Hb,e);return t===-1?n.length:t}function Ai(n,e){if(e===Rb)return n;let t=0,i=ju(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=ju(e,t);return n}function _a(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Vn=n=>typeof n<"u",Pi=n=>typeof n=="function",qu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function jb(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const jt=Math.PI,Et=2*jt,qb=Et+jt,bo=Number.POSITIVE_INFINITY,Vb=jt/180,Ht=jt/2,Is=jt/4,Vu=jt*2/3,Nn=Math.log10,ti=Math.sign;function zu(n){const e=Math.round(n);n=xs(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Nn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function zb(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function al(n){return!isNaN(parseFloat(n))&&isFinite(n)}function xs(n,e,t){return Math.abs(n-e)<t}function Bb(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function hg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Kn(n){return n*(jt/180)}function ba(n){return n*(180/jt)}function Bu(n){if(!qt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function pg(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*jt&&(l+=Et),{angle:l,distance:s}}function Hr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Ub(n,e){return(n-e+qb)%Et-jt}function kn(n){return(n%Et+Et)%Et}function ul(n,e,t,i){const s=kn(n),l=kn(e),o=kn(t),r=kn(l-s),a=kn(o-s),u=kn(s-l),f=kn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function sn(n,e,t){return Math.max(e,Math.min(t,n))}function Wb(n){return sn(n,-32768,32767)}function fl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}const Hl=n=>n===0||n===1,Uu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Et/t)),Wu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Et/t)+1,el={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*Ht)+1,easeOutSine:n=>Math.sin(n*Ht),easeInOutSine:n=>-.5*(Math.cos(jt*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(Line truncated
|
||||
* @kurkle/color v0.2.1
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2022 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/function kl(n){return n+.5|0}const Ti=(n,e,t)=>Math.max(Math.min(n,t),e);function Ws(n){return Ti(kl(n*2.55),0,255)}function Ei(n){return Ti(kl(n*255),0,255)}function ci(n){return Ti(kl(n/2.55)/100,0,1)}function Yu(n){return Ti(kl(n*100),0,100)}const Pn={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},jr=[..."0123456789ABCDEF"],Yb=n=>jr[n&15],Kb=n=>jr[(n&240)>>4]+jr[n&15],jl=n=>(n&240)>>4===(n&15),Zb=n=>jl(n.r)&&jl(n.g)&&jl(n.b)&&jl(n.a);function Jb(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Pn[n[1]]*17,g:255&Pn[n[2]]*17,b:255&Pn[n[3]]*17,a:e===5?Pn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Pn[n[1]]<<4|Pn[n[2]],g:Pn[n[3]]<<4|Pn[n[4]],b:Pn[n[5]]<<4|Pn[n[6]],a:e===9?Pn[n[7]]<<4|Pn[n[8]]:255})),t}const Gb=(n,e)=>n<255?e(n):"";function Xb(n){var e=Zb(n)?Yb:Kb;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Gb(n.a,e):void 0}const Qb=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function mg(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 xb(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 ev(n,e,t){const i=mg(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 tv(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function va(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=tv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function ya(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ei)}function ka(n,e,t){return ya(mg,n,e,t)}function nv(n,e,t){return ya(ev,n,e,t)}function iv(n,e,t){return ya(xb,n,e,t)}function gg(n){return(n%360+360)%360}function sv(n){const e=Qb.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ws(+e[5]):Ei(+e[5]));const s=gg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=nv(s,l,o):e[1]==="hsv"?i=iv(s,l,o):i=ka(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function lv(n,e){var t=va(n);t[0]=gg(t[0]+e),t=ka(t),n.r=t[0],n.g=t[1],n.b=t[2]}function ov(n){if(!n)return;const e=va(n),t=e[0],i=Yu(e[1]),s=Yu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ci(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Ku={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"},Zu={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 rv(){const n={},e=Object.keys(Zu),t=Object.keys(Ku);let i,s,l,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],s=0;s<t.length;s++)l=t[s]Line truncated
|
||||
* Chart.js v3.8.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2022 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/class cy{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=ug.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 ui=new cy;const af="transparent",dy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Gu(n||af),s=i.valid&&Gu(e||af);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class hy{constructor(e,t,i,s){const l=t[i];s=zl([e.to,s,l,e.from]);const o=zl([e.from,l,s]);this._active=!0,this._fn=e.fn||dy[e.type||typeof o],this._easing=el[e.easing]||el.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=zl([e.to,t,s,e.from]),this._from=zl([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||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?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;s<i.length;s++)i[s][t]()}}const py=["x","y","borderWidth","radius","tension"],my=["color","borderColor","backgroundColor"];_t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const gy=Object.keys(_t.animation);_t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});_t.set("animations",{colors:{type:"color",properties:my},numbers:{type:"number",properties:py}});_t.describe("animations",{_fallback:"animation"});_t.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 Lg{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!pt(s))return;const l={};for(const o of gy)l[o]=s[o];(Lt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=by(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&_y(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 hy(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 ui.add(this._chart,i),!0}}function _y(n,e){const t=[]Line truncated
|
||||
`)>-1?n.split(`
|
||||
`):n}function Fk(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 Hf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Sn(e.bodyFont),u=Sn(e.titleFont),f=Sn(e.footerFont),c=l.length,d=s.length,p=i.length,g=zn(e.padding);let v=g.height,b=0,y=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=p*C+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let $=0;const S=function(C){b=Math.max(b,t.measureText(C).width+$)};return t.save(),t.font=u.string,Ct(n.title,S),t.font=a.string,Ct(n.beforeBody.concat(n.afterBody),S),$=e.displayColors?o+2+e.boxPadding:0,Ct(i,C=>{Ct(C.before,S),Ct(C.lines,S),Ct(C.after,S)}),$=0,t.font=f.string,Ct(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function Ik(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Nk(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 Rk(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"),Nk(u,n,e,t)&&(u="center"),u}function jf(n,e,t){const i=t.yAlign||e.yAlign||Ik(n,t);return{xAlign:t.xAlign||e.xAlign||Rk(n,e,t,i),yAlign:i}}function Hk(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function jk(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function qf(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:p}=gs(o);let g=Hk(e,r);const v=jk(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,p)+s),{x:sn(g,0,i.width-e.width),y:sn(v,0,i.height-e.height)}}function Jl(n,e,t){const i=zn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Vf(n){return Qn([],fi(n))}function qk(n,e,t){return Fi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function zf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class Zr extends vi{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 Lg(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=qk(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=Qn(r,fi(s)),r=Qn(r,fi(l)),r=Qn(r,fi(o)),r}getBeforeBody(e,t){return Vf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Ct(e,l=>{const o={before:[],lines:[],after:[]},r=zf(i,l);Qn(o.before,fi(r.beforeLabel.call(this,l))),Qn(o.lines,r.label.call(this,l)),Qn(o.after,fi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return Vf(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=Qn(r,fi(s)),r=Qn(r,fi(l)),r=Qn(r,fi(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;a<u;++a)r.push(Fk(this.chart,t[a]));return e.filter&&(r=r.filter((f,c,d)=>e.filter(f,c,d,i))),e.itemSort&&(r=r.sort((f,c)=>e.itemSort(f,c,i))),Ct(r,f=>{const c=zf(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;l
Line truncated
|
||||
* chartjs-adapter-luxon v1.1.0
|
||||
* https://www.chartjs.org
|
||||
* (c) 2021 chartjs-adapter-luxon Contributors
|
||||
* Released under the MIT license
|
||||
*/const rw={datetime:tt.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:tt.TIME_WITH_SECONDS,minute:tt.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Rg._date.override({_id:"luxon",_create:function(n){return tt.fromMillis(n,this.options)},formats:function(){return rw},parse:function(n,e){const t=this.options;if(n===null||typeof n>"u")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=tt.fromFormat(n,e,t):n=tt.fromISO(n,t):n instanceof Date?n=tt.fromJSDate(n,t):i==="object"&&!(n instanceof tt)&&(n=tt.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):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 Gf(n){let e,t,i;return{c(){e=_("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=ct(e,qn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=ct(e,qn,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function aw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=j(n[1]),t=T(),s=j(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&_e(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&_e(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function uw(n){let e;return{c(){e=j("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function fw(n){let e,t,i,s,l,o,r=n[2]&&Gf();function a(c,d){return c[2]?uw:aw}let u=a(n),f=u(n);return{c(){e=_("div"),r&&r.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),f.c(),h(i,"class","chart-canvas svelte-vh4sl8"),Ya(i,"height","250px"),Ya(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),r&&r.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),o=!0},p(c,[d]){c[2]?r?d&4&&A(r,1):(r=Gf(),r.c(),A(r,1),r.m(e,t)):r&&(Te(),L(r,1,1,()=>{r=null}),De()),d&4&&Q(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){o||(A(r),o=!0)},o(c){L(r),o=!1},d(c){c&&k(e),r&&r.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function cw(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),ke.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let g of p)r.push({x:U.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),ke.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Bn(()=>(Mo.register(Ii,zo,$l,Ha,Ml,Lk,Vk),t(6,o=new Mo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,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:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){me[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.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 dw extends Ae{constructor(e){super(),Ee(this,e,cw,fw,Oe,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Xf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s_={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
||||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||||
*
|
||||
* @license MIT <https://opensource.org/licenses/MIT>
|
||||
* @author Lea Verou <https://lea.verou.me>
|
||||
* @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){return S instanceof a?new a(S.type,$(S.content),S.alias):Array.isArray(S)?S.map($):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(S,C){C=C||{};var M,D;switch(r.util.type(S)){case"Object":if(D=r.util.objId(S),C[D])return C[D];M={},C[D]=M;for(var P in S)S.hasOwnProperty(P)&&(M[P]=$(S[P],C));return M;case"Array":return D=r.util.objId(S),C[D]?C[D]:(M=[],C[D]=M,S.forEach(function(O,F){M[F]=$(O,C)}),M);default:return S}},getLanguage:function($){for(;$;){var S=s.exec($.className);if(S)return S[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,S){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if($){var S=document.getElementsByTagName("script");for(var C in S)if(S[C].src==$)return S[C]}return null}},isActive:function($,S,C){for(var M="no-"+S;$;){var D=$.classList;if(D.contains(S))return!0;if(D.contains(M))return!1;$=$.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,S){var C=r.util.clone(r.languages[$]);for(var M in S)C[M]=S[M];return C},insertBefore:function($,S,C,M){M=M||r.languages;var D=M[$],P={};for(var O in D)if(D.hasOwnProperty(O)){if(O==S)for(var F in C)C.hasOwnProperty(F)&&(P[F]=C[F]);C.hasOwnProperty(O)||(P[O]=D[O])}var E=M[$];return M[$]=P,r.languages.DFS(r.languages,function(N,Z){Z===E&&N!=$&&(this[N]=P)}),P},DFS:function $(S,C,M,D){D=D||{};var P=r.util.objId;for(var O in S)if(S.hasOwnProperty(O)){C.call(S,O,S[O],M||O);var F=S[O],E=r.util.type(F);E==="Object"&&!D[P(F)]?(D[P(F)]=!0,$(F,C,null,D)):E==="Array"&&!D[P(F)]&&(D[P(F)]=!0,$(F,C,O,D))}}},plugins:{},highlightAll:function($,S){r.highlightAllUnder(document,$,S)},highlightAllUnder:function($,S,C){var M={callback:C,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var D=0,P;P=M.elements[D++];)r.highlightElement(P,S===!0,M.callback)},highlightElement:function($,S,C){var M=r.util.getLanguage($),D=r.languages[M];r.util.setLanguage($,M);var P=$.parentElement;P&&P.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(P,M);var O=$.textContent,F={element:$,language:M,grammar:D,code:O};function E(Z){F.highlightedCode=Z,r.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,r.hooks.run("after-highlight",F),r.hooks.run("complete",F),C&&C.call(F.element)}if(r.hooks.run("before-sanity-check",F),P=F.element.parentElement,P&&P.nodeName.toLowerCase()==="pre"&&!P.hasAttribute("tabindex")&&P.setAttribute("tabindex","0"),!F.code){r.hooks.run("complete",F),C&&C.call(F.element);return}if(r.hooks.run("before-highlight",F),!F.grammar){E(r.util.encode(F.code));return}if(S&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(Z){E(Z.data)},N.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else E(r.highlight(F.code,F.grammar,F.language))},highlight:function($,S,C){var M={code:$,grammar:S,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function($,S){var C=S.rest;if(C){for(var M in C)S[M]=C[M];delete S.rest}var D=new c;return d(D,D.head,$),f($,D,S,D.head,0),g(D)},hooks:{all:{},add:function($,S){var C=r.hooks.all;C[$]=C[$]||[],C[$].push(S)},run:function($,S){var C=r.hooks.all[$];if(!(!C||!C.length))for(var M=0,D;D=C[M++];)D(S)}},Token:a};i.Prism=r;function a($,S,C,M){this.type=$,this.content=S,this.alias=C,this.length=(M||"").length|0}a.stringify=function $(S,C){if(typeof S=="string")return S;if(Array.isArray(S)){var M="";return S.forEach(function(E){M+=$(E,C)}),M}var D={type:S.type,content:$(S.content,C),tag:"span",classes:["token",S.type],attributes:{},language:C},P=S.alias;P&&(Array.isArray(P)?Array.prototype.push.apply(D.classes,P):D.classes.push(P)),r.hooks.run("wrap",D);var O="";for(var F in D.attributes)O+=" "+F+'="'+(D.attributes[F]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+O+">"+D.content+"</"+D.tag+">"};function u($,S,C,M){$.lastIndex=S;var D=$.exec(C);if(D&&M&&D[1]){var P=D[1].length;D.index+=P,D[0]=D[0].slice(P)}return D}funLine truncated
|
||||
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(F+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),$=0,S;S=y[$++];)t.highlightElement(S)}};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)}}()})(s_);const Vs=s_.exports;var hw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;r<l.length;++r)l.charCodeAt(r)==" ".charCodeAt(0)&&(o+=3);return l.length+o}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,o){o=e(this.defaults,o);for(var r in o){var a=i(r);r!=="normalize"&&a!=="setDefaults"&&o[r]&&this[a]&&(l=this[a].call(this,l,o[r]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,o){return o=o|0||4,l.replace(/\t/g,new Array(++o).join(" "))},spacesToTabs:function(l,o){return o=o|0||4,l.replace(RegExp(" {"+o+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var o=l.match(/^[^\S\n\r]*(?=\S)/gm);return!o||!o[0].length||(o.sort(function(r,a){return r.length-a.length}),!o[0].length)?l:l.replace(RegExp("^"+o[0],"gm"),"")},indent:function(l,o){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++o).join(" ")+"$&")},breakLines:function(l,o){o=o===!0?80:o|0||80;for(var r=l.split(`
|
||||
`),a=0;a<r.length;++a)if(!(s(r[a])<=o)){for(var u=r[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>o&&(u[c]=`
|
||||
`+u[c],f=d)}r[a]=u.join("")}return r.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(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var p=a[d];p==l.element?c=!0:p.nodeName==="#text"&&(c?f+=p.nodeValue:u+=p.nodeValue,r.removeChild(p),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=o.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(hw);function pw(n){let e,t;return{c(){e=_("div"),t=_("code"),h(t,"class","svelte-tv7jme"),h(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:oe,o:oe,d(i){i&&k(e)}}}function mw(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function o(r){return r=typeof r=="string"?r:"",r=Vs.plugins.NormalizeWhitespace.normalize(r,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Vs.highlight(r,Vs.languages[s]||Vs.languages.javascript,s)}return n.$$set=r=>{"content"in r&&t(1,i=r.content),"language"in r&&t(2,s=r.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof Vs<"u"&&i&&t(0,l=o(i))},[l,i,s]}class en extends Ae{constructor(e){super(),Ee(this,e,mw,pw,Oe,{content:1,language:2})}}const gw=n=>({}),Qf=n=>({}),_w=n=>({}),xf=n=>({});function ec(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S=n[4]&&!n[2]&&tc(n);const C=n[18].header,M=$n(C,n,n[17],xf);let D=n[4]&&n[2]&&nc(n);const P=n[18].default,O=$n(P,n,n[17],null),F=n[18].footer,E=$n(F,n,n[17],Qf);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),S&&S.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),E&&E.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(d,"class","overlay-panel-section panel-footer"),h(l,"class",p="overlay-panel "+n[1]+" "+n[8]),Q(l,"popup",n[2]),h(e,"class","overlay-panel-container"),Q(e,"padded",n[2]),Q(e,"active",n[0])},m(N,Z){w(N,e,Z),m(e,t),m(e,s),m(e,l),m(l,o),S&&S.m(o,null),m(o,r),M&&M.m(o,null),m(o,a),D&&D.m(o,null),m(l,u),m(l,f),O&&O.m(f,null),n[20](f),m(l,c),m(l,d),E&&E.m(d,null),b=!0,y||($=[X(t,"click",Wt(n[19])),X(f,"scroll",n[21])],y=!0)},p(N,Z){n=N,n[4]&&!n[2]?S?S.p(n,Z):(S=tc(n),S.c(),S.m(o,r)):S&&(S.d(1),S=null),M&&M.p&&(!b||Z&131072)&&Mn(M,C,n,n[17],b?Cn(C,n[17],Z,_w):Tn(n[17]),xf),n[4]&&n[2]?D?D.p(n,Z):(D=nc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||Z&131072)&&Mn(O,P,n,n[17],b?Cn(P,n[17],Z,null):Tn(n[17]),null),E&&E.p&&(!b||Z&131072)&&Mn(E,F,n,n[17],b?Cn(F,n[17],Z,gw):Tn(n[17]),Qf),(!b||Z&258&&p!==(p="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",p),Z&262&&Q(l,"popup",n[2]),Z&4&&Q(e,"padded",n[2]),Z&1&&Q(e,"active",n[0])},i(N){b||(Tt(()=>{i||(i=ct(t,mo,{duration:hs,opacity:0},!0)),i.run(1)}),A(M,N),A(O,N),A(E,N),Tt(()=>{v&&v.end(1),g=sa(l,Gn,n[2]?{duration:hs,y:-10}:{duration:hs,x:50}),g.start()}),b=!0)},o(N){i||(i=ct(t,mo,{duration:hs,opacity:0},!1)),i.run(0),L(M,N),L(O,N),L(E,N),g&&g.invalidate(),v=Jp(l,Gn,n[2]?{duration:hs,y:10}:{duration:hs,x:50}),b=!1},d(N){N&&k(e),N&&i&&i.end(),S&&S.d(),M&&M.d(N),D&&D.d(),O&&O.d(N),n[20](null),E&&E.d(N),N&&v&&v.end(),y=!1,ot($)}}}function tc(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=X(e,"click",Wt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function nc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=X(e,"click",Wt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function bw(n){let e,t,i,s,l=n[0]&&ec(n);return{c(){e=_("div"),l&&l.c(),h(e,"class","overlay-panel-wrapper")},m(o,r){w(o,e,r),l&&l.m(e,null),n[22](e),t=!0,i||(s=[X(window,"resize",n[10]),X(window,"keydown",n[9])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=ec(o),l.c(),A(l,1),l.m(e,null)):l&&(Te(),L(l,1,1,()=>{l=null}),De())},i(o){t||(A(l),t=!0)},o(o){L(l),t=!1},d(o){o&&k(e),l&&l.d(),n[22](null),i=!1,ot(s)}}}let Bi;function l_(){return Bi=Bi||document.querySelector(".overlays"),Bi||(Bi=document.createElement("div"),Bi.classList.add("overlays"),document.body.appendChild(Bi)),Bi}let hs=150;function ic(){return 1e3+l_().querySelectorAll(".overlay-panel-container.active").length}function vw(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,{beforeHid
Line truncated
|
||||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&h(e,"for",l);const $={};y&16&&($.id=b[4]),y&1&&($.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,Re(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function SS(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new os({props:v}),me.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[4]+".options.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=xe($t.call(null,s,{text:`Domains that are ONLY allowed as value.
|
||||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&h(e,"for",l);const $={};y&16&&($.id=b[4]+".options.onlyDomains"),y&1&&($.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,Re(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function $S(n){let e,t,i,s,l,o,r;return i=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[wS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[SS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(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 CS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class a_ extends Ae{constructor(e){super(),Ee(this,e,CS,$S,Oe,{key:1,options:0})}}function MS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new a_({props:r}),me.push(()=>Ie(e,"key",l)),me.push(()=>Ie(e,"options",o)),{c(){z(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],Re(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],Re(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),s=!1},d(a){V(e,a)}}}function TS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class DS extends Ae{constructor(e){super(),Ee(this,e,TS,MS,Oe,{key:0,options:1})}}var gr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],_s={_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:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},hl={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 togg
Line truncated
|
||||
<span class='flatpickr-weekday'>
|
||||
`+I.join("</span><span class='flatpickr-weekday'>")+`
|
||||
</span>
|
||||
`}}function re(){t.calendarContainer.classList.add("hasWeeks");var R=wt("div","flatpickr-weekwrapper");R.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var I=wt("div","flatpickr-weeks");return R.appendChild(I),{weekWrapper:R,weekNumbers:I}}function be(R,I){I===void 0&&(I=!0);var B=I?R:R-t.currentMonth;B<0&&t._hidePrevMonthArrow===!0||B>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=B,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,nt("onYearChange"),ne()),Z(),nt("onMonthChange"),Xe())}function ae(R,I){if(R===void 0&&(R=!0),I===void 0&&(I=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,I===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var B=yr(t.config),ie=B.hours,Ne=B.minutes,qe=B.seconds;p(ie,Ne,qe)}t.redraw(),R&&nt("onChange")}function G(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),nt("onClose")}function Ce(){t.config!==void 0&&nt("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].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 I=t.calendarContainer.parentNode;if(I.lastChild&&I.removeChild(I.lastChild),I.parentNode){for(;I.firstChild;)I.parentNode.insertBefore(I.firstChild,I);I.parentNode.removeChild(I)}}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(B){try{delete t[B]}catch{}})}function de(R){return t.calendarContainer.contains(R)}function fe(R){if(t.isOpen&&!t.config.inline){var I=vn(R),B=de(I),ie=I===t.input||I===t.altInput||t.element.contains(I)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Ne=!ie&&!B&&!de(R.relatedTarget),qe=!t.config.ignoredFocusElements.some(function(it){return it.contains(I)});Ne&&qe&&(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 se(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var I=R,B=t.currentYear!==I;t.currentYear=I||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)),B&&(t.redraw(),nt("onYearChange"),ne())}}function x(R,I){var B;I===void 0&&(I=!0);var ie=t.parseDate(R,void 0,I);if(t.config.minDate&&ie&&yn(ie,t.config.minDate,I!==void 0?I:!t.minDateHasTime)<0||t.config.maxDate&&ie&&yn(ie,t.config.maxDate,I!==void 0?I:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ie===void 0)return!1;for(var Ne=!!t.config.enable,qe=(B=t.config.enable)!==null&&B!==void 0?B:t.config.disable,it=0,Ye=void 0;it<qe.length;it++){if(Ye=qe[it],typeof Ye=="function"&&Ye(ie))return Ne;if(Ye instanceof Date&&ie!==void 0&&Ye.getTime()===ie.getTime())return Ne;if(typeof Ye=="string"){var st=t.parseDate(Ye,void 0,!0);return st&&st.getTime()===ie.getTime()?Ne:!Ne}else if(typeof Ye=="object"&&ie!==void 0&&Ye.from&&Ye.to&&ie.getTime()>=Ye.from.getTime()&&ie.getTime()<=Ye.to.getTime())return Ne}return!Ne}function ve(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function He(R){var I=R.target===t._input,B=t._input.value.trimEnd()!==Jt();I&&B&&!(R.relatedTarget&&de(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Le(R){var I
Line truncated
|
||||
`),d=_("span"),p=_("span"),p.textContent="Choose presets",g=T(),z(v.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[9]),h(p,"class","txt link-primary"),h(d,"class","inline-flex"),h(f,"class","help-block")},m(M,D){w(M,e,D),m(e,t),m(e,i),m(e,s),w(M,o,D),q(r,M,D),w(M,u,D),w(M,f,D),m(f,c),m(f,d),m(d,p),m(d,g),q(v,d,null),b=!0,y||($=xe($t.call(null,s,{text:`Allow uploading files ONLY with the listed mime types.
|
||||
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&512&&l!==(l=M[9]))&&h(e,"for",l);const P={};D&512&&(P.id=M[9]),!a&&D&1&&(a=!0,P.value=M[0].mimeTypes,Re(()=>a=!1)),r.$set(P);const O={};D&1025&&(O.$$scope={dirty:D,ctx:M}),v.$set(O)},i(M){b||(A(r.$$.fragment,M),A(v.$$.fragment,M),b=!0)},o(M){L(r.$$.fragment,M),L(v.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(o),V(r,M),M&&k(u),M&&k(f),V(v),y=!1,$()}}}function t$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[8](b)}let v={id:n[9],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),r=new os({props:v}),me.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[9]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=xe($t.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&512&&l!==(l=b[9]))&&h(e,"for",l);const $={};y&512&&($.id=b[9]),!a&&y&1&&(a=!0,$.value=b[0].thumbs,Re(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function n$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return i=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[XS,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[QS,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[e$,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[t$,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(a,"class","col-sm-12"),h(c,"class","col-sm-12"),h(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),p=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&1537&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&1537&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&2&&($.name="schema."+g[1]+".options.mimeTypes"),v&1537&&($.$$scope={dirty:v,ctx:g}),u.$set($);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&1537&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){p||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),p=!0)},o(g){L(i.$$.fragment,g),L(o.$$.fragment,g),L(u.$$.fragment,g),L(d.$$.fragment,g),p=!1},d(g){g&&k(e),V(i),V(o),V(u),V(d)}}}function i$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Dt(this.value),t(0,s)}function o(){s.maxSelect=Dt(this.value),t(0,s)}function r(d){n.$$.not_equal(s.mimeTypes,d)&&(s.mimeTypes=d,t(0,s))}const a=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},u=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},f=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function c(d){n.$$.not_equal(s.thumbs,d)&&(s.thumbs=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&U.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c]}class s$ extends Ae{constructor(e){super(),Ee(this,e,i$,n$,Oe,{key:1,options:0})}}function l$(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new ls({props:u}),me.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=j("Collection"),s=T(),z(l.$$.fragment),h(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&h(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,Re(()=>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),f&&k(s),V(l,f)}}}function o$(n){let e,t,i,s,l,o,r,a;return{c(
Line truncated
|
||||
<code>@request.query.*</code>
|
||||
<code>@request.data.*</code>
|
||||
<code>@request.user.*</code>`,S=T(),C=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",P=T(),O=_("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",F=T(),E=_("hr"),N=T(),Z=_("p"),Z.innerHTML=`Example rule:
|
||||
<br/>
|
||||
<code>@request.user.id!=null && created>"2022-01-01 00:00:00"</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(g,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h($,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(D,"class","m-b-0"),h(O,"class","inline-flex flex-gap-5"),h(E,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(Y,K){w(Y,e,K),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let ee=0;ee<W.length;ee+=1)W[ee].m(o,null);m(i,p),m(i,g),m(i,v),m(i,b),m(i,y),m(i,$),m(i,S),m(i,C),m(i,M),m(i,D),m(i,P),m(i,O),m(i,F),m(i,E),m(i,N),m(i,Z),te=!0},p(Y,K){if(K&1){H=Y[0].schema;let ee;for(ee=0;ee<H.length;ee+=1){const re=Uc(Y,H,ee);W[ee]?W[ee].p(re,K):(W[ee]=Yc(re),W[ee].c(),W[ee].m(o,null))}for(;ee<W.length;ee+=1)W[ee].d(1);W.length=H.length}},i(Y){te||(Y&&Tt(()=>{ne||(ne=ct(e,Xt,{duration:150},!0)),ne.run(1)}),te=!0)},o(Y){Y&&(ne||(ne=ct(e,Xt,{duration:150},!1)),ne.run(0)),te=!1},d(Y){Y&&k(e),Hn(W,Y),Y&&ne&&ne.end()}}}function j$(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=j(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&_e(i,t)},d(s){s&&k(e)}}}function q$(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=j(t),s=j(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&_e(i,t)},d(l){l&&k(e)}}}function Yc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?q$:j$}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},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){s.d(l),l&&k(e)}}}function V$(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[14];for(let r=0;r<l.length;r+=1){let a=Bc(n,l,r),u=o(a);t.set(u,e[r]=Kc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=lt()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&262235&&(l=Object.entries(r[6]),Te(),e=ut(e,a,o,1,r,l,t,i.parentNode,Ft,Kc,i,Bc),De())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)L(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function z$(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function B$(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[xe($t.call(null,e,"Lock and set to Admins only")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,ot(i)}}}function U$(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[xe($t.call(null,e,"Unlock and set custom rule")),X(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,ot(i)}}}function W$(n){let e;return{c(){e=j("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Y$(n){let e;return{c(){e=j("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function K$(n){let e,t=n[15]+"",i,s,l=Mi(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,p,g,v,b,y;function $(){return n[10](n[14])}const S=()=>n[11](u,f),C=()=>n[11](null,f);function M(N){n[12](N,n[14])}var D=n[4];function P(N){let Z={baseCollection:N[0],disabled:Mi(N[0][N[14]])};return N[0][N[14]]!==void 0&&(Z.value=N[0][N[14]]),{props:Z}}D&&(u=new D(P(n)),S(),me.push(()=>Ie(u,"value",M)));function O(N,Z){return Z&1&&(g=null),g==null&&(g=!!Mi(N[0][N[14]])),g?Y$:W$}let F=O(n,-1),E=F(n);return{c(){e=_("label"),i=j(t),s=j(" - "),o=j(l),a=T(),u&&z(u.$$.fragment),d=T(),p=_("div"),E.c(),h(e,"for",r=n[18]),h(p,"class","help-block")},m(N,Z){w(N,e,Z),m(e,i),m(e,s),m(e,o),w(N,a,Z),u&&q(u,N,Z),w(N,d,Z),w(N,p,Z),E.m(p,null),v=!0,b||(y=X(e,"click",$),b=!0)},p(N,Z){n=N,(!v||Z&1)&&l!==(l=Mi(n[0][n[14]])?"Admins only":"Custom rule")&&_e(o,l),(!v||Z&262144&&r!==(r=n[18]))&&h(e,"for",r),f!==n[14]&&(C(),f=n[14],S());const ne={};if(Z&1&&(ne.baseCollection=n[0]),Z&1&&(ne.disabled=Mi(n[0][n[14]])),!c&&Z&65&&(c=!0,ne.value=n[0][n[14]],Re(()=>c=!1)),D!==(D=n[4])){if(u){Te();const te=u;L(te.$$.fragment,1,0,()=>{V(te,1)}),De()}D?(u=new D(P(n)),S(),me.push(()=>Ie(u,"value",M)),z(u.$$.fragment),A(u.$$.fragment,1),q(u,d.parentNode,d)):u=null}else D&&u.$set(ne);F!==(F=O(n,Z))&&(E.d(1),E=F(n),E&&(E.c(),E.m(p,null)))},i(N){v||(u&&A(u.$$.fragment,N),v=!0)},o(N){u&&L(u.$$.fragment,N),v=!1},d(N){N&&k(e),N&&k(a),C(),u&&V(u,N),N&&k(d),N&&k(p),E.d(),b=!1,y()}}}function Kc(n,e){let t,i,s,l,o,r,a,u;function f(p,g){return g&1&&(l=null),l==null&&(l=!!Mi(p[0][p[14]])),l?U$:B$}let c=f(e,-1),d=c(e);return r=new Fe({props:{class:"form-field rule-field m-0 "+(Mi(e[0][e[14]])?"disabled":""),nameLine truncated
|
||||
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
|
||||
</a>.`,s=T(),l=_("span"),r=j(o),a=T(),b&&b.c(),u=T(),c.c(),d=lt(),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex"),h(e,"class","block m-b-base")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(C,u,M),$[f].m(C,M),w(C,d,M),p=!0,g||(v=X(l,"click",n[7]),g=!0)},p(C,[M]){(!p||M&4)&&o!==(o=C[2]?"Hide available fields":"Show available fields")&&_e(r,o),C[2]?b?(b.p(C,M),M&4&&A(b,1)):(b=Wc(C),b.c(),A(b,1),b.m(e,null)):b&&(Te(),L(b,1,1,()=>{b=null}),De());let D=f;f=S(C),f===D?$[f].p(C,M):(Te(),L($[D],1,1,()=>{$[D]=null}),De(),c=$[f],c?c.p(C,M):(c=$[f]=y[f](C),c.c()),A(c,1),c.m(d.parentNode,d))},i(C){p||(A(b),A(c),p=!0)},o(C){L(b),L(c),p=!1},d(C){C&&k(e),b&&b.d(),C&&k(u),$[f].d(C),C&&k(d),g=!1,v()}}}function Mi(n){return n===null}function J$(n,e,t){let{collection:i=new On}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Ki(()=>import("./FilterAutocompleteInput.65d23b87.js"),[])).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Bn(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var $;t(0,i[y]=s[y]||"",i),await _i(),($=o[y])==null||$.focus()},p=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},g=y=>{var $;return($=o[y])==null?void 0:$.focus()};function v(y,$){me[y?"unshift":"push"](()=>{o[$]=y,t(3,o)})}function b(y,$){n.$$.not_equal(i[$],y)&&(i[$]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,p,g,v,b]}class G$ extends Ae{constructor(e){super(),Ee(this,e,J$,Z$,Oe,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gc(n){let e;return{c(){e=_("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 Xc(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=j(`Renamed collection
|
||||
`),s=_("strong"),o=j(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=j(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&2&&l!==(l=p[1].originalName+"")&&_e(o,l),g&2&&c!==(c=p[1].name+"")&&_e(d,c)},d(p){p&&k(e)}}}function Qc(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=j(`Renamed field
|
||||
`),s=_("strong"),o=j(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=j(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&16&&l!==(l=p[14].originalName+"")&&_e(o,l),g&16&&c!==(c=p[14].name+"")&&_e(d,c)},d(p){p&&k(e)}}}function xc(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=j("Removed field "),i=_("span"),l=j(s),o=T(),h(i,"class","txt-bold"),h(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&_e(l,s)},d(r){r&&k(e)}}}function X$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[3].length&&Gc(),g=n[5]&&Xc(n),v=n[4],b=[];for(let S=0;S<v.length;S+=1)b[S]=Qc(Jc(n,v,S));let y=n[3],$=[];for(let S=0;S<y.length;S+=1)$[S]=xc(Zc(n,y,S));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=T(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
|
||||
update it manually!`,o=T(),p&&p.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let S=0;S<b.length;S+=1)b[S].c();d=T();for(let S=0;S<$.length;S+=1)$[S].c();h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning"),h(f,"class","changes-list svelte-1ghly2p")},m(S,C){w(S,e,C),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),p&&p.m(s,null),w(S,r,C),w(S,a,C),w(S,u,C),w(S,f,C),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<$.length;M+=1)$[M].m(f,null)},p(S,C){if(S[3].length?p||(p=Gc(),p.c(),p.m(s,null)):p&&(p.d(1),p=null),S[5]?g?g.p(S,C):(g=Xc(S),g.c(),g.m(f,c)):g&&(g.d(1),g=null),C&16){v=S[4];let M;for(M=0;M<v.length;M+=1){const D=Jc(S,v,M);b[M]?b[M].p(D,C):(b[M]=Qc(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if(C&8){y=S[3];let M;for(M=0;M<y.length;M+=1){const D=Zc(S,y,M);$[M]?$[M].p(D,C):($[M]=xc(D),$[M].c(),$[M].m(f,null))}for(;M<$.length;M+=1)$[M].d(1);$.length=y.length}},d(S){S&&k(e),p&&p.d(),S&&k(r),S&&k(a),S&&k(u),S&&k(f),g&&g.d(),Hn(b,S),Hn($,S)}}}function Q$(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function x$(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=T(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-secondary"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[X(e,"click",n[8]),X(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,ot(l)}}}function e3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[x$],header:[Q$],default:[X$]},$$scope:{ctx:n}};return e=new yi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(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 t3(n,e,t){let i,s,l;const o=rn();let r,a;async function u(y){t(1,a=y),await _i(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),p=()=>c();function g(y){me[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){dt.call(this,n,y)}function b(y){dt.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,p,g,v,b]}class n3 extends Ae{constructor(e){super(),Ee(this,e,t3,e3,Oe,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function ed(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new G$({props:o}),me.push(()=>Ie(t,"collection",l)),{c(){e=_("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Re(()=>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 i3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new H$({props:a}),me.push(()=>Ie(i,"collection",r));let u=n[9]===pl&&ed(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),l=T(),u&&u.c(),h(t,"class","tab-item"),Q(t,"active",n[9]===xi),h(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),q(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],Re(()=>s=!1)),i.$set(d),c[0]&512&&Q(t,"active",f[9]===xi),f[9]===pl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=ed(f),u.c(),A(u,1),u.m(e,null)):u&&(Te(),L(u,1,1,()=>{u=null}),De())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){L(i.$$.fragment,f),L(u),o=!1},d(f){f&&k(e),V(i),u&&u.d()}}}function td(n){let e,t,i,s,l,o,r;return o=new ss({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[s3]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("i"),l=T(),z(o.$$.fragment),h(e,"class","flex-fill"),h(s,"class","ri-more-line"),h(i,"type","button"),h(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(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),a&&k(t),a&&k(i),V(o)}}}function s3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function nd(n){let e;return{c(){e=_("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function l3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[2].system&&nd();return{c(){e=_("label"),t=j("Name"),s=T(),l=_("input"),u=T(),p&&p.c(),f=lt(),h(e,"for",i=n[38]),h(l,"type","text"),h(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],h(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,h(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),p&&p.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=X(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&h(e,"for",i),v[1]&128&&o!==(o=g[38])&&h(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?p||(p=nd(),p.c(),p.m(f.parentNode,f)):p&&(p.d(1),p=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),p&&p.d(g),g&&k(f),c=!1,d()}}}function id(n){let e,t,i,s,l,o;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=xe(t=$t.call(null,e,n[12])),l=!0)},p(r,a){t&&En(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=ct(e,qn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=ct(e,qn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function sd(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=xe($t.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=ct(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=ct(e,qn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function o3(n){var N,Z,ne,te,H,W;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,p,g,v=!U.isEmpty((N=n[4])==null?void 0:N.schema),b,y,$,S,C=!U.isEmpty((Z=n[4])==null?void 0:Z.listRule)||!U.isEmpty((ne=n[4])==null?void 0:ne.viewRule)||!U.isEmpty((te=n[4])==null?void 0:te.createRule)||!U.isEmpty((H=n[4])==null?void 0:H.updateRule)||!U.isEmpty((W=n[4])==null?void 0:W.deleteRule),M,D,P,O=!n[2].isNew&&!n[2].system&&td(n);r=new Fe({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[l3,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let F=v&&id(n),E=C&&sd();return{c(){e=_("h4"),i=j(t),s=T(),O&&O.c(),l=T(),o=_("form"),z(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),p=_("span"),p.textContent="Fields",g=T(),F&&F.c(),b=T(),y=_("button"),$=_("span"),$.textContent="API Rules",S=T(),E&&E.c(),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(p,"class","txt"),h(d,"type","button"),h(d,"class","tab-item"),Q(d,"active",n[9]===xi),h($,"class","txt"),h(y,"type","button"),h(y,"class","tab-item"),Q(y,"active",n[9]===pl),h(c,"class","tabs-header stretched")},m(Y,K){w(Y,e,K),m(e,i),w(Y,s,K),O&&O.m(Y,K),w(Y,l,K),w(Y,o,K),q(r,o,null),m(o,a),m(o,u),w(Y,f,K),w(Y,c,K),m(c,d),m(d,p),m(d,g),F&&F.m(d,null),m(c,b),m(c,y),m(y,$),m(y,S),E&&E.m(y,null),M=!0,D||(P=[X(o,"submit",Wt(n[22])),X(d,"click",n[23]),X(y,"click",n[24])],D=!0)},p(Y,K){var re,be,ae,G,Ce,de;(!M||K[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&_e(i,t),!Y[2].isNew&&!Y[2].system?O?(O.p(Y,K),K[0]&4&&A(O,1)):(O=td(Y),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(Te(),L(O,1,1,()=>{O=null}),De());const ee={};K[0]&2048&&(ee.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),K[0]&2052|K[1]&384&&(ee.$$scope={dirty:K,ctx:Y}),r.$set(ee),K[0]&16&&(v=!U.isEmpty((re=Y[4])==null?void 0:re.schema)),v?F?(F.p(Y,K),K[0]&16&&A(F,1)):(F=id(Y),F.c(),A(F,1),F.m(d,null)):F&&(Te(),L(F,1,1,()=>{F=null}),De()),K[0]&512&&Q(d,"active",Y[9]===xi),K[0]&16&&(C=!U.isEmpty((be=Y[4])==null?void 0:be.listRule)||!U.isEmpty((ae=Y[4])==null?void 0:ae.viewRule)||!U.isEmpty((G=Y[4])==null?void 0:G.createRule)||!U.isEmpty((Ce=Y[4])==null?void 0:Ce.updateRule)||!U.isEmpty((de=Y[4])==null?void 0:de.deleteRule)),C?E?K[0]&16&&A(E,1):(E=sd(),E.c(),A(E,1),E.m(y,null)):E&&(Te(),L(E,1,1,()=>{E=null}),De()),K[0]&512&&Q(y,"active",Y[9]===pl)},i(Y){M||(A(O),A(r.$$.fragment,Y),A(F),A(E),M=!0)},o(Y){L(O),L(r.$$.fragment,Y),L(F),L(E),M=!1},d(Y){Y&&k(e),Y&&k(s),O&&O.d(Y),Y&&k(l),Y&&k(o),V(r),Y&&k(f),Y&&k(c),F&&F.d(),E&&E.d(),D=!1,ot(P)}}}function r3(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=j(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[X(e,"click",n[18]),X(s,"click",n[1Line truncated
|
||||
<span class="txt">New collection</span>`,y=T(),z($.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),Q(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),Q(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(c,"class","sidebar-content"),h(b,"type","button"),h(b,"class","btn btn-block btn-outline"),h(v,"class","sidebar-footer"),h(e,"class","page-sidebar collection-sidebar")},m(E,N){w(E,e,N),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),$e(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let Z=0;Z<d.length;Z+=1)d[Z].m(c,null);O&&O.m(c,null),m(e,g),m(e,v),m(v,b),w(E,y,N),q($,E,N),S=!0,C||(M=[X(l,"click",n[8]),X(r,"input",n[9]),X(b,"click",n[11])],C=!0)},p(E,[N]){N&16&&Q(l,"hidden",!E[4]),N&1&&r.value!==E[0]&&$e(r,E[0]),N&16&&Q(i,"active",E[4]),N&106&&(D=E[3],d=ut(d,N,P,1,E,D,p,c,ln,ad,null,ld),!D.length&&O?O.p(E,N):D.length?O&&(O.d(1),O=null):(O=od(E),O.c(),O.m(c,null)));const Z={};$.$set(Z)},i(E){S||(A($.$$.fragment,E),S=!0)},o(E){L($.$$.fragment,E),S=!1},d(E){E&&k(e);for(let N=0;N<d.length;N+=1)d[N].d();O&&O.d(),E&&k(y),n[12](null),V($,E),C=!1,ot(M)}}}function h3(n,e,t){let i,s,l,o,r;cn(n,ni,b=>t(5,o=b)),cn(n,Ss,b=>t(7,r=b));let a,u="";function f(b){jp(ni,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const p=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){me[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,p,g,v]}class p3 extends Ae{constructor(e){super(),Ee(this,e,h3,d3,Oe,{})}}function m3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S,C,M,D,P,O,F,E,N,Z,ne,te,H,W,Y,K,ee,re,be,ae,G,Ce,de,fe,se,x,ve,He,Le,Pe,ue,ce,ye,Be;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
|
||||
<code><span class="txt-success">OPERAND</span>
|
||||
<span class="txt-danger">OPERATOR</span>
|
||||
<span class="txt-success">OPERAND</span></code>, where:`,t=T(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
|
||||
quoted), number, null, true, false`,l=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=j(` - is one of:
|
||||
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),p=_("code"),p.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),$=_("code"),$.textContent="!=",S=T(),C=_("span"),C.textContent="NOT equal",M=T(),D=_("li"),P=_("code"),P.textContent=">",O=T(),F=_("span"),F.textContent="Greater than",E=T(),N=_("li"),Z=_("code"),Z.textContent=">=",ne=T(),te=_("span"),te.textContent="Greater than or equal",H=T(),W=_("li"),Y=_("code"),Y.textContent="<",K=T(),ee=_("span"),ee.textContent="Less than or equal",re=T(),be=_("li"),ae=_("code"),ae.textContent="<=",G=T(),Ce=_("span"),Ce.textContent="Less than or equal",de=T(),fe=_("li"),se=_("code"),se.textContent="~",x=T(),ve=_("span"),ve.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||||
match)`,He=T(),Le=_("li"),Pe=_("code"),Pe.textContent="!~",ue=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||||
wildcard match)`,ye=T(),Be=_("p"),Be.innerHTML=`To group and combine several expressions you could use brackets
|
||||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,h(r,"class","txt-danger"),h(p,"class","filter-op svelte-1w7s5nw"),h(v,"class","txt-hint"),h($,"class","filter-op svelte-1w7s5nw"),h(C,"class","txt-hint"),h(P,"class","filter-op svelte-1w7s5nw"),h(F,"class","txt-hint"),h(Z,"class","filter-op svelte-1w7s5nw"),h(te,"class","txt-hint"),h(Y,"class","filter-op svelte-1w7s5nw"),h(ee,"class","txt-hint"),h(ae,"class","filter-op svelte-1w7s5nw"),h(Ce,"class","txt-hint"),h(se,"class","filter-op svelte-1w7s5nw"),h(ve,"class","txt-hint"),h(Pe,"class","filter-op svelte-1w7s5nw"),h(ce,"class","txt-hint")},m(Ke,Ue){w(Ke,e,Ue),w(Ke,t,Ue),w(Ke,i,Ue),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,p),m(d,g),m(d,v),m(c,b),m(c,y),m(y,$),m(y,S),m(y,C),m(c,M),m(c,D),m(D,P),m(D,O),m(D,F),m(c,E),m(c,N),m(N,Z),m(N,ne),m(N,te),m(c,H),m(c,W),m(W,Y),m(W,K),m(W,ee),m(c,re),m(c,be),m(be,ae),m(be,G),m(be,Ce),m(c,de),m(c,fe),m(fe,se),m(fe,x),m(fe,ve),m(c,He),m(c,Le),m(Le,Pe),m(Le,ue),m(Le,ce),w(Ke,ye,Ue),w(Ke,Be,Ue)},p:oe,i:oe,o:oe,d(Ke){Ke&&k(e),Ke&&k(t),Ke&&k(i),Ke&&k(ye),Ke&&k(Be)}}}class g3 extends Ae{constructor(e){super(),Ee(this,e,null,m3,Oe,{})}}function ud(n,e,t){const i=n.slice();return i[8]=e[t],i}function fd(n,e,t){const i=n.slice();return i[8]=e[t],i}function cd(n,e,t){const i=n.slice();return i[13]=e[t],i}function dd(n,e,t){const i=n.slice();return i[13]=e[t],i}function hd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pd(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&Q(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function md(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&Q(t,"active",e[3]===e[13].lang)},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 gd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&36&&Q(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function _d(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&Q(t,"active",e[2]===e[8].code)},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 _3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",$,S,C,M,D,P,O,F=[],E=new Map,N,Z,ne=[],te=new Map,H,W,Y,K,ee,re,be,ae,G,Ce,de,fe,se,x,ve,He,Le,Pe,ue,ce,ye,Be,Ke,Ue,Je,et,J,le,pe,Ve,Ge,bt,rt,at,yt,Pt,Zt,ge,we,Ze,nt,At,he,Se,Xe,Jt,Vt,Xn,ft,R,I,B,ie,Ne,qe,it,Ye,st,We,Qe=[],St=new Map,bn,Yt,Gt=[],ri=new Map,ki,Qt=n[1]&&hd(),rs=n[4];const Tl=Me=>Me[13].lang;for(let Me=0;Me<rs.length;Me+=1){let ze=dd(n,rs,Me),Ot=Tl(ze);E.set(Ot,F[Me]=pd(Ot,ze))}let Ni=n[4];const Dl=Me=>Me[13].lang;for(let Me=0;Me<Ni.length;Me+=1){let ze=cd(n,Ni,Me),Ot=Dl(ze);te.set(Ot,ne[Me]=md(Ot,ze))}Je=new en({props:{content:`
|
||||
// DESC by created and ASC by id
|
||||
?sort=-created,id
|
||||
`}}),at=new en({props:{content:`
|
||||
?filter=(id='abc' && created>'2022-01-01')
|
||||
`}}),Pt=new g3({}),Xe=new en({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let as=n[5];const Ol=Me=>Me[8].code;for(let Me=0;Me<as.length;Me+=1){let ze=fd(n,as,Me),Ot=Ol(ze);St.set(Ot,Qe[Me]=gd(Ot,ze))}let Ri=n[5];const El=Me=>Me[8].code;for(let Me=0;Me<Ri.length;Me+=1){let ze=ud(n,Ri,Me),Ot=El(ze);ri.set(Ot,Gt[Me]=_d(Ot,ze))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=j("/api/collections/"),r=_("strong"),u=j(a),f=j("/records"),c=T(),Qt&&Qt.c(),d=T(),p=_("div"),g=_("p"),v=j("Fetch a paginated "),b=_("strong"),$=j(y),S=j(" records list."),C=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),P=_("div"),O=_("div");for(let Me=0;Me<F.length;Me+=1)F[Me].c();N=T(),Z=_("div");for(let Me=0;Me<ne.length;Me+=1)ne[Me].c();H=T(),W=_("div"),W.textContent="Query parameters",Y=T(),K=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,re=T(),be=_("tbody"),ae=_("tr"),ae.innerHTML=`<td>page</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,G=T(),Ce=_("tr"),Ce.innerHTML=`<td>perPage</td>
|
||||
<td><span class="label">Number</span></td>
|
||||
<td>Specify the max returned records per page (default to 30).</td>`,de=T(),fe=_("tr"),se=_("td"),se.textContent="sort",x=T(),ve=_("td"),ve.innerHTML='<span class="label">String</span>',He=T(),Le=_("td"),Pe=j("Specify the records order attribute(s). "),ue=_("br"),ce=j(`
|
||||
Add `),ye=_("code"),ye.textContent="-",Be=j(" / "),Ke=_("code"),Ke.textContent="+",Ue=j(` (default) in front of the attribute for DESC / ASC order.
|
||||
Ex.:
|
||||
`),z(Je.$$.fragment),et=T(),J=_("tr"),le=_("td"),le.textContent="filter",pe=T(),Ve=_("td"),Ve.innerHTML='<span class="label">String</span>',Ge=T(),bt=_("td"),rt=j(`Filter the returned records. Ex.:
|
||||
`),z(at.$$.fragment),yt=T(),z(Pt.$$.fragment),Zt=T(),ge=_("tr"),we=_("td"),we.textContent="expand",Ze=T(),nt=_("td"),nt.innerHTML='<span class="label">String</span>',At=T(),he=_("td"),Se=j(`Auto expand nested record relations. Ex.:
|
||||
`),z(Xe.$$.fragment),Jt=j(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Vt=_("br"),Xn=j(`
|
||||
The expanded relations will be appended to each individual record under the
|
||||
`),ft=_("code"),ft.textContent="@expand",R=j(" property (eg. "),I=_("code"),I.textContent='"@expand": {"rel1": {...}, ...}',B=j(`). Only the
|
||||
relations that the user has permissions to `),ie=_("strong"),ie.textContent="view",Ne=j(" will be expanded."),qe=T(),it=_("div"),it.textContent="Responses",Ye=T(),st=_("div"),We=_("div");for(let Me=0;Me<Qe.length;Me+=1)Qe[Me].c();bn=T(),Yt=_("div");for(let Me=0;Me<Gt.length;Me+=1)Gt[Me].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(p,"class","content m-b-base"),h(M,"class","section-title"),h(O,"class","tabs-header compact left"),h(Z,"class","tabs-content"),h(P,"class","tabs m-b-lg"),h(W,"class","section-title"),h(K,"class","table-compact table-border m-b-lg"),h(it,"class","section-title"),h(We,"class","tabs-header compact left"),h(Yt,"class","tabs-content"),h(st,"class","tabs")},m(Me,ze){w(Me,e,ze),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Qt&&Qt.m(e,null),w(Me,d,ze),w(Me,p,ze),m(p,g),m(g,v),m(g,b),m(b,$),m(g,S),w(Me,C,ze),w(Me,M,ze),w(Me,D,ze),w(Me,P,ze),m(P,O);for(let Ot=0;Ot<F.length;Ot+=1)F[Ot].m(O,null);m(P,N),m(P,Z);for(let Ot=0;Ot<ne.length;Ot+=1)ne[Ot].m(Z,null);w(Me,H,ze),w(Me,W,ze),w(Me,Y,ze),w(Me,K,ze),m(K,ee),m(K,re),m(K,be),m(be,ae),m(be,G),m(be,Ce),m(be,de),m(be,fe),m(fe,se),m(fe,x),m(fe,ve),m(fe,He),m(fe,Le),m(Le,Pe),m(Le,ue),m(Le,ce),m(Le,ye),m(Le,Be),m(Le,Ke),m(Le,Ue),q(Je,Le,null),m(be,et),m(be,J),m(J,le),m(J,pe),m(J,Ve),m(J,Ge),m(J,bt),m(bt,rt),q(at,bt,null),m(bt,yt),q(Pt,bt,null),m(be,Zt),m(be,ge),m(ge,we),m(ge,Ze),m(ge,nt),m(ge,At),m(ge,he),m(he,Se),q(Xe,he,null),m(he,Jt),m(he,Vt),m(he,Xn),m(he,ft),m(he,R),m(he,I),m(he,B),m(he,ie),m(he,Ne),w(Me,qe,ze),w(Me,it,ze),w(Me,Ye,ze),w(Me,st,ze),m(st,We);for(let Ot=0;Ot<Qe.length;Ot+=1)Qe[Ot].m(We,null);m(st,bn),m(st,Yt);for(let Ot=0;Ot<Gt.length;Ot+=1)Gt[Ot].m(Yt,null);ki=!0},p(Me,[ze]){(!ki||ze&1)&&a!==(a=Me[0].name+"")&&_e(u,a),Me[1]?Qt||(Qt=hd(),Qt.c(),Qt.m(e,null)):Qt&&(Qt.d(1),Qt=null),(!ki||ze&1)&&y!==(y=Me[0].name+"")&&_e($,y),ze&24&&(rs=Me[4],F=ut(F,ze,Tl,1,Me,rs,E,O,ln,pd,null,dd)),ze&24&&(Ni=Me[4],Te(),ne=ut(ne,ze,Dl,1,Me,Ni,te,Z,Ft,md,null,cd),De()),ze&36&&(as=Me[5],Qe=ut(Qe,ze,Ol,1,Me,as,St,We,ln,gd,null,fd)),ze&36&&(Ri=Me[5],Te(),Gt=ut(Gt,ze,El,1,Me,Ri,ri,Yt,Ft,_d,null,ud),De())},i(Me){if(!ki){for(let ze=0;ze<Ni.length;ze+=1)A(ne[ze]);A(Je.$$.fragment,Me),A(at.$$.fragment,Me),A(Pt.$$.fragment,Me),A(Xe.$$.fragment,Me);for(let ze=0;ze<Ri.length;ze+=1)A(Gt[ze]);ki=!0}},o(Me){for(let ze=0;ze<ne.length;ze+=1)L(ne[ze]);L(Je.$$.fragment,Me),L(at.$$.fragment,Me),L(Pt.$$.fragment,Me),L(Xe.$$.fragment,Me);for(let ze=0;ze<Gt.length;ze+=1)L(Gt[ze]);ki=!1},d(Me){Me&&k(e),Qt&&Qt.d(),Me&&k(d),Me&&k(p),Me&&k(C),Me&&k(M),Me&&k(D),Me&&k(P);for(let ze=0;ze<F.length;ze+=1)F[ze].d();for(let ze=0;ze<ne.length;ze+=1)ne[ze].d();Me&&k(H),Me&&k(W),Me&&k(Y),Me&&k(K),V(Je),V(at),V(Pt),V(Xe),Me&&k(qe),Me&&k(it),Me&&k(Ye),Me&&k(st);for(let ze=0;ze<Qe.length;ze+=1)Qe[ze].d();for(let ze=0;ze<Gt.length;ze+=1)Gt[ze].d()}}}function b3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[U.dummyCollectionRecord(s),U.dummyCollectionRecord(s)]},null,2)}),r.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Something went wrong while processing your request. Invalid filter.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
client.Records.getList("${s==null?void 0:s.name}", { page: 2 })
|
||||
.then(function (list) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
|
||||
// alternatively you can also fetch all records at once via getFullList:
|
||||
client.Records.getFullList("${s==null?void 0:s.name}", 200 /* batch size */)
|
||||
.then(function (records) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,o,a,r,u,f]}class v3 extends Ae{constructor(e){super(),Ee(this,e,b3,_3,Oe,{collection:0})}}function bd(n,e,t){const i=n.slice();return i[8]=e[t],i}function vd(n,e,t){const i=n.slice();return i[8]=e[t],i}function yd(n,e,t){const i=n.slice();return i[13]=e[t],i}function kd(n,e,t){const i=n.slice();return i[13]=e[t],i}function wd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sd(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&Q(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function $d(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&Q(t,"active",e[3]===e[13].lang)},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 Cd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&36&&Q(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Md(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&Q(t,"active",e[2]===e[8].code)},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 y3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,$=n[0].name+"",S,C,M,D,P,O,F,E=[],N=new Map,Z,ne,te=[],H=new Map,W,Y,K,ee,re,be,ae,G,Ce,de,fe,se,x,ve,He,Le,Pe,ue,ce,ye,Be,Ke,Ue,Je,et,J,le,pe,Ve,Ge,bt,rt,at,yt=[],Pt=new Map,Zt,ge,we=[],Ze=new Map,nt,At=n[1]&&wd(),he=n[4];const Se=I=>I[13].lang;for(let I=0;I<he.length;I+=1){let B=kd(n,he,I),ie=Se(B);N.set(ie,E[I]=Sd(ie,B))}let Xe=n[4];const Jt=I=>I[13].lang;for(let I=0;I<Xe.length;I+=1){let B=yd(n,Xe,I),ie=Jt(B);H.set(ie,te[I]=$d(ie,B))}ce=new en({props:{content:`
|
||||
?expand=rel1,rel2.subrel21.subrel22
|
||||
`}});let Vt=n[5];const Xn=I=>I[8].code;for(let I=0;I<Vt.length;I+=1){let B=vd(n,Vt,I),ie=Xn(B);Pt.set(ie,yt[I]=Cd(ie,B))}let ft=n[5];const R=I=>I[8].code;for(let I=0;I<ft.length;I+=1){let B=bd(n,ft,I),ie=R(B);Ze.set(ie,we[I]=Md(ie,B))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=j("/api/collections/"),r=_("strong"),u=j(a),f=j("/records/"),c=_("strong"),c.textContent=":id",d=T(),At&&At.c(),p=T(),g=_("div"),v=_("p"),b=j("Fetch a single "),y=_("strong"),S=j($),C=j(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",P=T(),O=_("div"),F=_("div");for(let I=0;I<E.length;I+=1)E[I].c();Z=T(),ne=_("div");for(let I=0;I<te.length;I+=1)te[I].c();W=T(),Y=_("div"),Y.textContent="Path Parameters",K=T(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to view.</td></tr></tbody>`,re=T(),be=_("div"),be.textContent="Query parameters",ae=T(),G=_("table"),Ce=_("thead"),Ce.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr>`,de=T(),fe=_("tbody"),se=_("tr"),x=_("td"),x.textContent="expand",ve=T(),He=_("td"),He.innerHTML='<span class="label">String</span>',Le=T(),Pe=_("td"),ue=j(`Auto expand nested record relations. Ex.:
|
||||
`),z(ce.$$.fragment),ye=j(`
|
||||
Supports up to 6-levels depth nested relations expansion. `),Be=_("br"),Ke=j(`
|
||||
The expanded relations will be appended to the record under the
|
||||
`),Ue=_("code"),Ue.textContent="@expand",Je=j(" property (eg. "),et=_("code"),et.textContent='"@expand": {"rel1": {...}, ...}',J=j(`). Only the
|
||||
relations that the user has permissions to `),le=_("strong"),le.textContent="view",pe=j(" will be expanded."),Ve=T(),Ge=_("div"),Ge.textContent="Responses",bt=T(),rt=_("div"),at=_("div");for(let I=0;I<yt.length;I+=1)yt[I].c();Zt=T(),ge=_("div");for(let I=0;I<we.length;I+=1)we[I].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(ne,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(Y,"class","section-title"),h(ee,"class","table-compact table-border m-b-lg"),h(be,"class","section-title"),h(G,"class","table-compact table-border m-b-lg"),h(Ge,"class","section-title"),h(at,"class","tabs-header compact left"),h(ge,"class","tabs-content"),h(rt,"class","tabs")},m(I,B){w(I,e,B),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),At&&At.m(e,null),w(I,p,B),w(I,g,B),m(g,v),m(v,b),m(v,y),m(y,S),m(v,C),w(I,M,B),w(I,D,B),w(I,P,B),w(I,O,B),m(O,F);for(let ie=0;ie<E.length;ie+=1)E[ie].m(F,null);m(O,Z),m(O,ne);for(let ie=0;ie<te.length;ie+=1)te[ie].m(ne,null);w(I,W,B),w(I,Y,B),w(I,K,B),w(I,ee,B),w(I,re,B),w(I,be,B),w(I,ae,B),w(I,G,B),m(G,Ce),m(G,de),m(G,fe),m(fe,se),m(se,x),m(se,ve),m(se,He),m(se,Le),m(se,Pe),m(Pe,ue),q(ce,Pe,null),m(Pe,ye),m(Pe,Be),m(Pe,Ke),m(Pe,Ue),m(Pe,Je),m(Pe,et),m(Pe,J),m(Pe,le),m(Pe,pe),w(I,Ve,B),w(I,Ge,B),w(I,bt,B),w(I,rt,B),m(rt,at);for(let ie=0;ie<yt.length;ie+=1)yt[ie].m(at,null);m(rt,Zt),m(rt,ge);for(let ie=0;ie<we.length;ie+=1)we[ie].m(ge,null);nt=!0},p(I,[B]){(!nt||B&1)&&a!==(a=I[0].name+"")&&_e(u,a),I[1]?At||(At=wd(),At.c(),At.m(e,null)):At&&(At.d(1),At=null),(!nt||B&1)&&$!==($=I[0].name+"")&&_e(S,$),B&24&&(he=I[4],E=ut(E,B,Se,1,I,he,N,F,ln,Sd,null,kd)),B&24&&(Xe=I[4],Te(),te=ut(te,B,Jt,1,I,Xe,H,ne,Ft,$d,null,yd),De()),B&36&&(Vt=I[5],yt=ut(yt,B,Xn,1,I,Vt,Pt,at,ln,Cd,null,vd)),B&36&&(ft=I[5],Te(),we=ut(we,B,R,1,I,ft,Ze,ge,Ft,Md,null,bd),De())},i(I){if(!nt){for(let B=0;B<Xe.length;B+=1)A(te[B]);A(ce.$$.fragment,I);for(let B=0;B<ft.length;B+=1)A(we[B]);nt=!0}},o(I){for(let B=0;B<te.length;B+=1)L(te[B]);L(ce.$$.fragment,I);for(let B=0;B<we.length;B+=1)L(we[B]);nt=!1},d(I){I&&k(e),At&&At.d(),I&&k(p),I&&k(g),I&&k(M),I&&k(D),I&&k(P),I&&k(O);for(let B=0;B<E.length;B+=1)E[B].d();for(let B=0;B<te.length;B+=1)te[B].d();I&&k(W),I&&k(Y),I&&k(K),I&&k(ee),I&&k(re),I&&k(be),I&&k(ae),I&&k(G),V(ce),I&&k(Ve),I&&k(Ge),I&&k(bt),I&&k(rt);for(let B=0;B<yt.length;B+=1)yt[B].d();for(let B=0;B<we.length;B+=1)we[B].d()}}}function k3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
client.Records.getOne("${s==null?void 0:s.name}", "RECORD_ID")
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,o,a,r,u,f]}class w3 extends Ae{constructor(e){super(),Ee(this,e,k3,y3,Oe,{collection:0})}}function Td(n,e,t){const i=n.slice();return i[8]=e[t],i}function Dd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Od(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[16]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[16]=e[t],i}function Pd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ld(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&_e(s,i),f&20&&Q(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Fd(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&Q(t,"active",e[2]===e[16].lang)},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 S3(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $3(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function C3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=j("User "),i=j(t),s=j(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function M3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=j("Relation record "),i=j(t),s=j(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function T3(n){let e,t,i,s,l;return{c(){e=j("FormData object."),t=_("br"),i=j(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=j(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function D3(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function O3(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function E3(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function A3(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function P3(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Id(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=U.getFieldValueType(e[13])+"",p,g,v,b;function y(P,O){return P[13].required?$3:S3}let $=y(e),S=$(e);function C(P,O){if(P[13].type==="text")return P3;if(P[13].type==="number")return A3;if(P[13].type==="json")return E3;if(P[13].type==="email")return O3;if(P[13].type==="url")return D3;if(P[13].type==="file")return T3;if(P[13].type==="relation")return M3;if(P[13].type==="user")return C3}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=j(r),u=T(),f=_("td"),c=_("span"),p=j(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(P,O){w(P,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(P,O){e=P,$!==($=y(e))&&(S.d(1),S=$(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[13].name+"")&&_e(a,r),O&1&&d!==(d=U.getFieldValueType(e[13])+"")&&_e(p,d),M===(M=C(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(P){P&&k(t),S.d(),D&&D.d()}}}function Nd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&_e(s,i),f&10&&Q(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Rd(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&Q(t,"active",e[1]===e[8].code)},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 L3(n){var Zt;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",$,S,C,M,D,P,O,F,E,N,Z,ne=[],te=new Map,H,W,Y=[],K=new Map,ee,re,be,ae,G,Ce,de,fe=[],se=new Map,x,ve,He,Le,Pe,ue=[],ce=new Map,ye,Be,Ke=[],Ue=new Map,Je,et=n[5]&&Pd(),J=n[4];const le=ge=>ge[16].lang;for(let ge=0;ge<J.length;ge+=1){let we=Ad(n,J,ge),Ze=le(we);te.set(Ze,ne[ge]=Ld(Ze,we))}let pe=n[4];const Ve=ge=>ge[16].lang;for(let ge=0;ge<pe.length;ge+=1){let we=Ed(n,pe,ge),Ze=Ve(we);K.set(Ze,Y[ge]=Fd(Ze,we))}let Ge=(Zt=n[0])==null?void 0:Zt.schema;const bt=ge=>ge[13].name;for(let ge=0;ge<Ge.length;ge+=1){let we=Od(n,Ge,ge),Ze=bt(we);se.set(Ze,fe[ge]=Id(Ze,we))}let rt=n[3];const at=ge=>ge[8].code;for(let ge=0;ge<rt.length;ge+=1){let we=Dd(n,rt,ge),Ze=at(we);ce.set(Ze,ue[ge]=Nd(Ze,we))}let yt=n[3];const Pt=ge=>ge[8].code;for(let ge=0;ge<yt.length;ge+=1){let we=Td(n,yt,ge),Ze=Pt(we);Ue.set(Ze,Ke[ge]=Rd(Ze,we))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=j("/api/collections/"),r=_("strong"),u=j(a),f=j("/records"),c=T(),et&&et.c(),d=T(),p=_("div"),g=_("p"),v=j("Create a new "),b=_("strong"),$=j(y),S=j(" record."),C=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,D=T(),P=_("p"),P.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",O=T(),F=_("div"),F.textContent="Client SDKs example",E=T(),N=_("div"),Z=_("div");for(let ge=0;ge<ne.length;ge+=1)ne[ge].c();H=T(),W=_("div");for(let ge=0;ge<Y.length;ge+=1)Y[ge].c();ee=T(),re=_("div"),re.textContent="Body Parameters",be=T(),ae=_("table"),G=_("thead"),G.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,Ce=T(),de=_("tbody");for(let ge=0;ge<fe.length;ge+=1)fe[ge].c();x=T(),ve=_("div"),ve.textContent="Responses",He=T(),Le=_("div"),Pe=_("div");for(let ge=0;ge<ue.length;ge+=1)ue[ge].c();ye=T(),Be=_("div");for(let ge=0;ge<Ke.length;ge+=1)Ke[ge].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-success"),h(p,"class","content m-b-base"),h(F,"class","section-title"),h(Z,"class","tabs-header compact left"),h(W,"class","tabs-content"),h(N,"class","tabs m-b-lg"),h(re,"class","section-title"),h(ae,"class","table-compact table-border m-b-lg"),h(ve,"class","section-title"),h(Pe,"class","tabs-header compact left"),h(Be,"class","tabs-content"),h(Le,"class","tabs")},m(ge,we){w(ge,e,we),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),et&&et.m(e,null),w(ge,d,we),w(ge,p,we),m(p,g),m(g,v),m(g,b),m(b,$),m(g,S),m(p,C),m(p,M),m(p,D),m(p,P),w(ge,O,we),w(ge,F,we),w(ge,E,we),w(ge,N,we),m(N,Z);for(let Ze=0;Ze<ne.length;Ze+=1)ne[Ze].m(Z,null);m(N,H),m(N,W);for(let Ze=0;Ze<Y.length;Ze+=1)Y[Ze].m(W,null);w(ge,ee,we),w(ge,re,we),w(ge,be,we),w(ge,ae,we),m(ae,G),m(ae,Ce),m(ae,de);for(let Ze=0;Ze<fe.length;Ze+=1)fe[Ze].m(de,null);w(ge,x,we),w(ge,ve,we),w(ge,He,we),w(ge,Le,we),m(Le,Pe);for(let Ze=0;Ze<ue.length;Ze+=1)ue[Ze].m(Pe,null);m(Le,ye),m(Le,Be);for(let Ze=0;Ze<Ke.length;Ze+=1)Ke[Ze].m(Be,null);Je=!0},p(ge,[we]){var Ze;(!Je||we&1)&&a!==(a=ge[0].name+"")&&_e(u,a),ge[5]?et||(et=Pd(),et.c(),et.m(e,null)):et&&(et.d(1),et=null),(!Je||we&1)&&y!==(y=ge[0].name+"")&&_e($,y),we&20&&(J=ge[4],ne=ut(ne,we,le,1,ge,J,te,Z,ln,Ld,null,Ad)),we&20&&(pe=ge[4],Te(),Y=ut(Y,we,Ve,1,ge,pe,K,W,Ft,Fd,null,Ed),De()),we&1&&(Ge=(Ze=ge[0])==null?void 0:Ze.schema,fe=ut(fe,we,bt,1,ge,Ge,se,de,ln,Id,null,Od)),we&10&&(rt=ge[3],ue=ut(ue,we,at,1,ge,rt,ce,Pe,ln,Nd,null,Dd)),we&10&&(yt=ge[3],Te(),Ke=ut(Ke,we,Pt,1,ge,yt,Ue,Be,Ft,Rd,null,Td),De())},i(ge){if(!Je){for(let we=0;we<pe.length;we+=1)A(Y[we]);for(let we=0;we<yt.length;we+=1)A(Ke[we]);Je=!0}},o(ge){for(let we=0;we<Y.length;we+=1)L(Y[we]);for(let we=0;we<Ke.length;we+=1)L(Ke[we]);Je=!1},d(ge){ge&&k(e),et&&et.d(),ge&&k(d),ge&&k(p),ge&&k(O),ge&&k(F),ge&&k(E),ge&&k(N);for(let we=0;we<ne.length;we+=1)ne[we].d();for(let we=0;we<Y.length;we+=1)Y[we].d();ge&&k(ee),ge&&k(re),ge&&k(be),ge&&k(ae);for(let we=0;we<fe.length;we+=1)fe[we].d();ge&&k(x),ge&&k(ve),ge&&k(He),ge&&k(Le);for(let we=0;we<ue.length;we+=1)ue[we].d();for(let we=0;we<Ke.length;we+=1)Ke[we].d()}}}function F3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to create record.",
|
||||
"data": {
|
||||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.create("${s==null?void 0:s.name}", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,l,o,r,a,i,u,f]}class I3 extends Ae{constructor(e){super(),Ee(this,e,F3,L3,Oe,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[8]=e[t],i}function jd(n,e,t){const i=n.slice();return i[8]=e[t],i}function qd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[16]=e[t],i}function zd(n,e,t){const i=n.slice();return i[16]=e[t],i}function Bd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ud(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&_e(s,i),f&20&&Q(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Wd(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&Q(t,"active",e[2]===e[16].lang)},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 N3(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function R3(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function H3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=j("User "),i=j(t),s=j(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function j3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=j("Relation record "),i=j(t),s=j(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&_e(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function q3(n){let e,t,i,s,l;return{c(){e=j("FormData object."),t=_("br"),i=j(`
|
||||
Set to `),s=_("code"),s.textContent="null",l=j(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function V3(n){let e;return{c(){e=j("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function z3(n){let e;return{c(){e=j("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function B3(n){let e;return{c(){e=j("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function U3(n){let e;return{c(){e=j("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function W3(n){let e;return{c(){e=j("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Yd(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=U.getFieldValueType(e[13])+"",p,g,v,b;function y(P,O){return P[13].required?R3:N3}let $=y(e),S=$(e);function C(P,O){if(P[13].type==="text")return W3;if(P[13].type==="number")return U3;if(P[13].type==="json")return B3;if(P[13].type==="email")return z3;if(P[13].type==="url")return V3;if(P[13].type==="file")return q3;if(P[13].type==="relation")return j3;if(P[13].type==="user")return H3}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=j(r),u=T(),f=_("td"),c=_("span"),p=j(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(P,O){w(P,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(P,O){e=P,$!==($=y(e))&&(S.d(1),S=$(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[13].name+"")&&_e(a,r),O&1&&d!==(d=U.getFieldValueType(e[13])+"")&&_e(p,d),M===(M=C(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(P){P&&k(t),S.d(),D&&D.d()}}}function Kd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&_e(s,i),f&10&&Q(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Zd(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&Q(t,"active",e[1]===e[8].code)},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 Y3(n){var At;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,$=n[0].name+"",S,C,M,D,P,O,F,E,N,Z,ne,te=[],H=new Map,W,Y,K=[],ee=new Map,re,be,ae,G,Ce,de,fe,se,x,ve,He,Le=[],Pe=new Map,ue,ce,ye,Be,Ke,Ue=[],Je=new Map,et,J,le=[],pe=new Map,Ve,Ge=n[5]&&Bd(),bt=n[4];const rt=he=>he[16].lang;for(let he=0;he<bt.length;he+=1){let Se=zd(n,bt,he),Xe=rt(Se);H.set(Xe,te[he]=Ud(Xe,Se))}let at=n[4];const yt=he=>he[16].lang;for(let he=0;he<at.length;he+=1){let Se=Vd(n,at,he),Xe=yt(Se);ee.set(Xe,K[he]=Wd(Xe,Se))}let Pt=(At=n[0])==null?void 0:At.schema;const Zt=he=>he[13].name;for(let he=0;he<Pt.length;he+=1){let Se=qd(n,Pt,he),Xe=Zt(Se);Pe.set(Xe,Le[he]=Yd(Xe,Se))}let ge=n[3];const we=he=>he[8].code;for(let he=0;he<ge.length;he+=1){let Se=jd(n,ge,he),Xe=we(Se);Je.set(Xe,Ue[he]=Kd(Xe,Se))}let Ze=n[3];const nt=he=>he[8].code;for(let he=0;he<Ze.length;he+=1){let Se=Hd(n,Ze,he),Xe=nt(Se);pe.set(Xe,le[he]=Zd(Xe,Se))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=j("/api/collections/"),r=_("strong"),u=j(a),f=j("/records/"),c=_("strong"),c.textContent=":id",d=T(),Ge&&Ge.c(),p=T(),g=_("div"),v=_("p"),b=j("Update a single "),y=_("strong"),S=j($),C=j(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||||
<code>multipart/form-data</code>.`,P=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",F=T(),E=_("div"),E.textContent="Client SDKs example",N=T(),Z=_("div"),ne=_("div");for(let he=0;he<te.length;he+=1)te[he].c();W=T(),Y=_("div");for(let he=0;he<K.length;he+=1)K[he].c();re=T(),be=_("div"),be.textContent="Path parameters",ae=T(),G=_("table"),G.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to update.</td></tr></tbody>`,Ce=T(),de=_("div"),de.textContent="Body Parameters",fe=T(),se=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th></tr>`,ve=T(),He=_("tbody");for(let he=0;he<Le.length;he+=1)Le[he].c();ue=T(),ce=_("div"),ce.textContent="Responses",ye=T(),Be=_("div"),Ke=_("div");for(let he=0;he<Ue.length;he+=1)Ue[he].c();et=T(),J=_("div");for(let he=0;he<le.length;he+=1)le[he].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-warning"),h(g,"class","content m-b-base"),h(E,"class","section-title"),h(ne,"class","tabs-header compact left"),h(Y,"class","tabs-content"),h(Z,"class","tabs m-b-lg"),h(be,"class","section-title"),h(G,"class","table-compact table-border m-b-lg"),h(de,"class","section-title"),h(se,"class","table-compact table-border m-b-lg"),h(ce,"class","section-title"),h(Ke,"class","tabs-header compact left"),h(J,"class","tabs-content"),h(Be,"class","tabs")},m(he,Se){w(he,e,Se),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Ge&&Ge.m(e,null),w(he,p,Se),w(he,g,Se),m(g,v),m(v,b),m(v,y),m(y,S),m(v,C),m(g,M),m(g,D),m(g,P),m(g,O),w(he,F,Se),w(he,E,Se),w(he,N,Se),w(he,Z,Se),m(Z,ne);for(let Xe=0;Xe<te.length;Xe+=1)te[Xe].m(ne,null);m(Z,W),m(Z,Y);for(let Xe=0;Xe<K.length;Xe+=1)K[Xe].m(Y,null);w(he,re,Se),w(he,be,Se),w(he,ae,Se),w(he,G,Se),w(he,Ce,Se),w(he,de,Se),w(he,fe,Se),w(he,se,Se),m(se,x),m(se,ve),m(se,He);for(let Xe=0;Xe<Le.length;Xe+=1)Le[Xe].m(He,null);w(he,ue,Se),w(he,ce,Se),w(he,ye,Se),w(he,Be,Se),m(Be,Ke);for(let Xe=0;Xe<Ue.length;Xe+=1)Ue[Xe].m(Ke,null);m(Be,et),m(Be,J);for(let Xe=0;Xe<le.length;Xe+=1)le[Xe].m(J,null);Ve=!0},p(he,[Se]){var Xe;(!Ve||Se&1)&&a!==(a=he[0].name+"")&&_e(u,a),he[5]?Ge||(Ge=Bd(),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null),(!Ve||Se&1)&&$!==($=he[0].name+"")&&_e(S,$),Se&20&&(bt=he[4],te=ut(te,Se,rt,1,he,bt,H,ne,ln,Ud,null,zd)),Se&20&&(at=he[4],Te(),K=ut(K,Se,yt,1,he,at,ee,Y,Ft,Wd,null,Vd),De()),Se&1&&(Pt=(Xe=he[0])==null?void 0:Xe.schema,Le=ut(Le,Se,Zt,1,he,Pt,Pe,He,ln,Yd,null,qd)),Se&10&&(ge=he[3],Ue=ut(Ue,Se,we,1,he,ge,Je,Ke,ln,Kd,null,jd)),Se&10&&(Ze=he[3],Te(),le=ut(le,Se,nt,1,he,Ze,pe,J,Ft,Zd,null,Hd),De())},i(he){if(!Ve){for(let Se=0;Se<at.length;Se+=1)A(K[Se]);for(let Se=0;Se<Ze.length;Se+=1)A(le[Se]);Ve=!0}},o(he){for(let Se=0;Se<K.length;Se+=1)L(K[Se]);for(let Se=0;Se<le.length;Se+=1)L(le[Se]);Ve=!1},d(he){he&&k(e),Ge&&Ge.d(),he&&k(p),he&&k(g),he&&k(F),he&&k(E),he&&k(N),he&&k(Z);for(let Se=0;Se<te.length;Se+=1)te[Se].d();for(let Se=0;Se<K.length;Se+=1)K[Se].d();he&&k(re),he&&k(be),he&&k(ae),he&&k(G),he&&k(Ce),he&&k(de),he&&k(fe),he&&k(se);for(let Se=0;Se<Le.length;Se+=1)Le[Se].d();he&&k(ue),he&&k(ce),he&&k(ye),he&&k(Be);for(let Se=0;Se<Ue.length;Se+=1)Ue[Se].d();for(let Se=0;Se<le.length;Se+=1)le[Se].d()}}}function K3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(s),null,2)},{code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to update record.",
|
||||
"data": {
|
||||
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
|
||||
"code": "validation_required",
|
||||
"message": "Missing required value."
|
||||
}
|
||||
}
|
||||
}
|
||||
`},{code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "You are not allowed to perform this request.",
|
||||
"data": {}
|
||||
}
|
||||
`},{code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
const data = { ... };
|
||||
|
||||
client.Records.update("${s==null?void 0:s.name}", "RECORD_ID", data)
|
||||
.then(function (record) {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,l,o,r,a,i,u,f]}class Z3 extends Ae{constructor(e){super(),Ee(this,e,K3,Y3,Oe,{collection:0})}}function Jd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Xd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[13]=e[t],i}function xd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function eh(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&_e(s,i),f&24&&Q(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function th(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&Q(t,"active",e[3]===e[13].lang)},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 nh(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&36&&Q(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function ih(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&Q(t,"active",e[2]===e[8].code)},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 J3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,$=n[0].name+"",S,C,M,D,P,O,F,E=[],N=new Map,Z,ne,te=[],H=new Map,W,Y,K,ee,re,be,ae,G,Ce,de=[],fe=new Map,se,x,ve=[],He=new Map,Le,Pe=n[1]&&xd(),ue=n[4];const ce=J=>J[13].lang;for(let J=0;J<ue.length;J+=1){let le=Qd(n,ue,J),pe=ce(le);N.set(pe,E[J]=eh(pe,le))}let ye=n[4];const Be=J=>J[13].lang;for(let J=0;J<ye.length;J+=1){let le=Xd(n,ye,J),pe=Be(le);H.set(pe,te[J]=th(pe,le))}let Ke=n[5];const Ue=J=>J[8].code;for(let J=0;J<Ke.length;J+=1){let le=Gd(n,Ke,J),pe=Ue(le);fe.set(pe,de[J]=nh(pe,le))}let Je=n[5];const et=J=>J[8].code;for(let J=0;J<Je.length;J+=1){let le=Jd(n,Je,J),pe=et(le);He.set(pe,ve[J]=ih(pe,le))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=j("/api/collections/"),r=_("strong"),u=j(a),f=j("/records/"),c=_("strong"),c.textContent=":id",d=T(),Pe&&Pe.c(),p=T(),g=_("div"),v=_("p"),b=j("Delete a single "),y=_("strong"),S=j($),C=j(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",P=T(),O=_("div"),F=_("div");for(let J=0;J<E.length;J+=1)E[J].c();Z=T(),ne=_("div");for(let J=0;J<te.length;J+=1)te[J].c();W=T(),Y=_("div"),Y.textContent="Path parameters",K=T(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
|
||||
<th>Type</th>
|
||||
<th width="60%">Description</th></tr></thead>
|
||||
<tbody><tr><td>id</td>
|
||||
<td><span class="label">String</span></td>
|
||||
<td>ID of the record to delete.</td></tr></tbody>`,re=T(),be=_("div"),be.textContent="Responses",ae=T(),G=_("div"),Ce=_("div");for(let J=0;J<de.length;J+=1)de[J].c();se=T(),x=_("div");for(let J=0;J<ve.length;J+=1)ve[J].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-danger"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(ne,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(Y,"class","section-title"),h(ee,"class","table-compact table-border m-b-lg"),h(be,"class","section-title"),h(Ce,"class","tabs-header compact left"),h(x,"class","tabs-content"),h(G,"class","tabs")},m(J,le){w(J,e,le),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Pe&&Pe.m(e,null),w(J,p,le),w(J,g,le),m(g,v),m(v,b),m(v,y),m(y,S),m(v,C),w(J,M,le),w(J,D,le),w(J,P,le),w(J,O,le),m(O,F);for(let pe=0;pe<E.length;pe+=1)E[pe].m(F,null);m(O,Z),m(O,ne);for(let pe=0;pe<te.length;pe+=1)te[pe].m(ne,null);w(J,W,le),w(J,Y,le),w(J,K,le),w(J,ee,le),w(J,re,le),w(J,be,le),w(J,ae,le),w(J,G,le),m(G,Ce);for(let pe=0;pe<de.length;pe+=1)de[pe].m(Ce,null);m(G,se),m(G,x);for(let pe=0;pe<ve.length;pe+=1)ve[pe].m(x,null);Le=!0},p(J,[le]){(!Le||le&1)&&a!==(a=J[0].name+"")&&_e(u,a),J[1]?Pe||(Pe=xd(),Pe.c(),Pe.m(e,null)):Pe&&(Pe.d(1),Pe=null),(!Le||le&1)&&$!==($=J[0].name+"")&&_e(S,$),le&24&&(ue=J[4],E=ut(E,le,ce,1,J,ue,N,F,ln,eh,null,Qd)),le&24&&(ye=J[4],Te(),te=ut(te,le,Be,1,J,ye,H,ne,Ft,th,null,Xd),De()),le&36&&(Ke=J[5],de=ut(de,le,Ue,1,J,Ke,fe,Ce,ln,nh,null,Gd)),le&36&&(Je=J[5],Te(),ve=ut(ve,le,et,1,J,Je,He,x,Ft,ih,null,Jd),De())},i(J){if(!Le){for(let le=0;le<ye.length;le+=1)A(te[le]);for(let le=0;le<Je.length;le+=1)A(ve[le]);Le=!0}},o(J){for(let le=0;le<te.length;le+=1)L(te[le]);for(let le=0;le<ve.length;le+=1)L(ve[le]);Le=!1},d(J){J&&k(e),Pe&&Pe.d(),J&&k(p),J&&k(g),J&&k(M),J&&k(D),J&&k(P),J&&k(O);for(let le=0;le<E.length;le+=1)E[le].d();for(let le=0;le<te.length;le+=1)te[le].d();J&&k(W),J&&k(Y),J&&k(K),J&&k(ee),J&&k(re),J&&k(be),J&&k(ae),J&&k(G);for(let le=0;le<de.length;le+=1)de[le].d();for(let le=0;le<ve.length;le+=1)ve[le].d()}}}function G3(n,e,t){let i,{collection:s=new On}=e,l=204,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:204,body:`
|
||||
null
|
||||
`}),r.push({code:400,body:`
|
||||
{
|
||||
"code": 400,
|
||||
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
|
||||
"data": {}
|
||||
}
|
||||
`}),i&&r.push({code:403,body:`
|
||||
{
|
||||
"code": 403,
|
||||
"message": "Only admins can access this action.",
|
||||
"data": {}
|
||||
}
|
||||
`}),r.push({code:404,body:`
|
||||
{
|
||||
"code": 404,
|
||||
"message": "The requested resource wasn't found.",
|
||||
"data": {}
|
||||
}
|
||||
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
client.Records.delete("${s==null?void 0:s.name}", "RECORD_ID")
|
||||
.then(function () {
|
||||
// success...
|
||||
}).catch(function (error) {
|
||||
// error...
|
||||
});
|
||||
`}])},[s,i,l,o,a,r,u,f]}class X3 extends Ae{constructor(e){super(),Ee(this,e,G3,J3,Oe,{collection:0})}}function sh(n,e,t){const i=n.slice();return i[4]=e[t],i}function lh(n,e,t){const i=n.slice();return i[4]=e[t],i}function oh(n,e){let t,i=e[4].lang+"",s,l,o,r;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=j(i),l=T(),h(t,"class","tab-item"),Q(t,"active",e[1]===e[4].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=X(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[4].lang+"")&&_e(s,i),f&6&&Q(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),o=!1,r()}}}function rh(n,e){let t,i,s,l;return i=new en({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),Q(t,"active",e[1]===e[4].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[4].code),i.$set(a),r&6&&Q(t,"active",e[1]===e[4].lang)},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 Q3(n){let e,t,i,s,l,o,r,a,u=[],f=new Map,c,d,p=[],g=new Map,v,b,y,$,S,C=n[2];const M=O=>O[4].lang;for(let O=0;O<C.length;O+=1){let F=lh(n,C,O),E=M(F);f.set(E,u[O]=oh(E,F))}let D=n[2];const P=O=>O[4].lang;for(let O=0;O<D.length;O+=1){let F=sh(n,D,O),E=P(F);g.set(E,p[O]=rh(E,F))}return $=new en({props:{content:JSON.stringify({action:"create",record:U.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
|
||||
<div class="content"><p>/api/realtime</p></div>`,t=T(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
|
||||
<p>Events are send for <strong>create</strong>, <strong>update</strong>
|
||||
and <strong>delete</strong> record operations (see "Event data format" section below).</p>
|
||||
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
|
||||
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
|
||||
<p>When you subscribe to a <strong>single record</strong>, the collection's
|
||||
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p>
|
||||
<p>When you subscribe to an <strong>entire collection</strong>, the collection's
|
||||
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
|
||||
the event message.</p></div></div>`,s=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),r=_("div"),a=_("div");for(let O=0;O<u.length;O+=1)u[O].c();c=T(),d=_("div");for(let O=0;O<p.length;O+=1)p[O].c();v=T(),b=_("div"),b.textContent="Event data format",y=T(),z($.$$.fragment),h(e,"class","alert"),h(i,"class","content m-b-base"),h(l,"class","section-title"),h(a,"class","tabs-header compact left"),h(d,"class","tabs-content"),h(r,"class","tabs m-b-base"),h(b,"class","section-title")},m(O,F){w(O,e,F),w(O,t,F),w(O,i,F),w(O,s,F),w(O,l,F),w(O,o,F),w(O,r,F),m(r,a);for(let E=0;E<u.length;E+=1)u[E].m(a,null);m(r,c),m(r,d);for(let E=0;E<p.length;E+=1)p[E].m(d,null);w(O,v,F),w(O,b,F),w(O,y,F),q($,O,F),S=!0},p(O,[F]){F&6&&(C=O[2],u=ut(u,F,M,1,O,C,f,a,ln,oh,null,lh)),F&6&&(D=O[2],Te(),p=ut(p,F,P,1,O,D,g,d,Ft,rh,null,sh),De());const E={};F&1&&(E.content=JSON.stringify({action:"create",record:U.dummyCollectionRecord(O[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),$.$set(E)},i(O){if(!S){for(let F=0;F<D.length;F+=1)A(p[F]);A($.$$.fragment,O),S=!0}},o(O){for(let F=0;F<p.length;F+=1)L(p[F]);L($.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(t),O&&k(i),O&&k(s),O&&k(l),O&&k(o),O&&k(r);for(let F=0;F<u.length;F+=1)u[F].d();for(let F=0;F<p.length;F+=1)p[F].d();O&&k(v),O&&k(b),O&&k(y),V($,O)}}}function x3(n,e,t){let{collection:i=new On}=e,s="JavaScript",l=[];const o=r=>t(1,s=r.lang);return n.$$set=r=>{"collection"in r&&t(0,i=r.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{lang:"JavaScript",code:`
|
||||
import PocketBase from 'pocketbase';
|
||||
|
||||
const client = new PocketBase("${ke.baseUrl}");
|
||||
|
||||
// (Optionally) authenticate
|
||||
client.Users.authViaEmail("test@example.com", "123456");
|
||||
|
||||
// Subscribe to changes in any record from the collection
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Subscribe to changes in a single record
|
||||
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
|
||||
console.log(e.record);
|
||||
});
|
||||
|
||||
// Unsubscribe
|
||||
client.Realtime.unsubscribe() // remove all subscriptions
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
|
||||
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
|
||||
`}])},[i,s,l,o]}class e4 extends Ae{constructor(e){super(),Ee(this,e,x3,Q3,Oe,{collection:0})}}function ah(n,e,t){const i=n.slice();return i[14]=e[t],i}function uh(n,e,t){const i=n.slice();return i[14]=e[t],i}function fh(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&z(t.$$.fragment),i=T(),h(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&q(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Te();const f=t;L(f.$$.fragment,1,0,()=>{V(f,1)}),De()}l?(t=new l(o(r)),z(t.$$.fragment),A(t.$$.fragment,1),q(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&L(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&V(t)}}}function ch(n,e){let t,i,s,l=e[4]===e[14].id&&fh(e);return{key:n,first:null,c(){t=lt(),l&&l.c(),i=lt(),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[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=fh(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Te(),L(l,1,1,()=>{l=null}),De())},i(o){s||(A(l),s=!0)},o(o){L(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function t4(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=ah(n,l,r),u=o(a);i.set(u,t[r]=ch(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Te(),t=ut(t,a,o,1,r,l,i,e,Ft,ch,null,ah),De())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)L(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function dh(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=j(s),o=T(),h(i,"class","txt"),h(t,"tabindex","0"),h(t,"class","tab-item"),Q(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[X(t,"click",u),X(t,"keydown",Bp(f))],r=!0)},p(c,d){e=c,d&48&&Q(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,ot(a)}}}function n4(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let p=uh(n,f,d),g=c(p);u.set(g,a[d]=dh(g,p))}return{c(){e=_("h4"),t=_("strong"),s=j(i),l=j(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();h(r,"class","tabs-header stretched")},m(d,p){w(d,e,p),m(e,t),m(t,s),m(e,l),w(d,o,p),w(d,r,p);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,p){p&8&&i!==(i=d[3].name+"")&&_e(s,i),p&114&&(f=d[5],a=ut(a,p,c,1,d,f,u,r,ln,dh,null,uh))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let p=0;p<a.length;p+=1)a[p].d()}}}function i4(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',h(e,"type","button"),h(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function s4(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[i4],header:[n4],default:[t4]},$$scope:{ctx:n}};return e=new yi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(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 l4(n,e,t){const i=[{id:"list",label:"List",component:v3},{id:"view",label:"View",component:w3},{id:"create",label:"Create",component:I3},{id:"update",label:"Update",component:Z3},{id:"delete",label:"Delete",component:X3},{id:"realtime",label:"Realtime",component:e4}];let s,l=new On,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,$){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u($))}const c=()=>a(),d=y=>u(y.id),p=(y,$)=>f($,y.id);function g(y){me[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){dt.call(this,n,y)}function b(y){dt.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,p,g,v,b]}class o4 extends Ae{constructor(e){super(),Ee(this,e,l4,s4,Oe,{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 r4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=ht(l,s[o]);return{c(){e=_("textarea"),ii(e,l),Q(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),$e(e,n[0]),t||(i=[X(e,"input",n[6]),X(e,"keydown",n[2])],t=!0)},p(o,[r]){ii(e,l=hn(s,[r&8&&o[3]])),r&1&&$e(e,o[0]),Q(e,"svelte-1x1pbts",!0)},i:oe,o:oe,d(o){o&&k(e),n[5](null),t=!1,ot(i)}}}function a4(n,e,t){const i=["value","maxHeight"];let s=Ut(e,i),{value:l=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight+2,o)+"px",r))},0)}function f(p){if((p==null?void 0:p.code)==="Enter"&&!(p!=null&&p.shiftKey)){p.preventDefault();const g=r.closest("form");g!=nu
Line truncated
|
||||
<span class="txt">Upload new file</span>`,h(t,"type","file"),h(t,"class","hidden"),t.multiple=n[5],h(s,"type","button"),h(s,"class","btn btn-secondary btn-sm btn-block"),h(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[18](t),m(e,i),m(e,s),l||(o=[X(t,"change",n[19]),X(s,"click",n[20])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[18](null),l=!1,ot(o)}}}function sC(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,p,g,v,b=n[4];const y=D=>D[28];for(let D=0;D<b.length;D+=1){let P=mh(n,b,D),O=y(P);d.set(O,c[D]=gh(O,P))}let $=n[0],S=[];for(let D=0;D<$.length;D+=1)S[D]=_h(ph(n,$,D));const C=D=>L(S[D],1,1,()=>{S[D]=null});let M=!n[9]&&bh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=j(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();p=T();for(let D=0;D<S.length;D+=1)S[D].c();g=T(),M&&M.c(),h(t,"class",i=U.getFieldTypeIcon(n[3].type)),h(l,"class","txt"),h(e,"for",a=n[24]),h(f,"class","files-list")},m(D,P){w(D,e,P),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,P),w(D,f,P);for(let O=0;O<c.length;O+=1)c[O].m(f,null);m(f,p);for(let O=0;O<S.length;O+=1)S[O].m(f,null);m(f,g),M&&M.m(f,null),n[21](f),v=!0},p(D,P){if((!v||P&8&&i!==(i=U.getFieldTypeIcon(D[3].type)))&&h(t,"class",i),(!v||P&8)&&o!==(o=D[3].name+"")&&_e(r,o),(!v||P&16777216&&a!==(a=D[24]))&&h(e,"for",a),P&3222&&(b=D[4],Te(),c=ut(c,P,y,1,D,b,d,f,Ft,gh,p,mh),De()),P&4097){$=D[0];let O;for(O=0;O<$.length;O+=1){const F=ph(D,$,O);S[O]?(S[O].p(F,P),A(S[O],1)):(S[O]=_h(F),S[O].c(),A(S[O],1),S[O].m(f,g))}for(Te(),O=$.length;O<S.length;O+=1)C(O);De()}D[9]?M&&(M.d(1),M=null):M?M.p(D,P):(M=bh(D),M.c(),M.m(f,null))},i(D){if(!v){for(let P=0;P<b.length;P+=1)A(c[P]);for(let P=0;P<$.length;P+=1)A(S[P]);v=!0}},o(D){for(let P=0;P<c.length;P+=1)L(c[P]);S=S.filter(Boolean);for(let P=0;P<S.length;P+=1)L(S[P]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let P=0;P<c.length;P+=1)c[P].d();Hn(S,D),M&&M.d(),n[21](null)}}}function lC(n){let e,t,i,s;e=new Fe({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[sC,({uniqueId:o})=>({24:o}),({uniqueId:o})=>o?16777216:0]},$$scope:{ctx:n}}});let l={};return i=new X4({props:l}),n[22](i),{c(){z(e.$$.fragment),t=T(),z(i.$$.fragment)},m(o,r){q(e,o,r),w(o,t,r),q(i,o,r),s=!0},p(o,[r]){const a={};r&8&&(a.class="form-field form-field-file "+(o[3].required?"required":"")),r&8&&(a.name=o[3].name),r&1090520063&&(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){V(e,o),o&&k(t),n[22](null),V(i,o)}}}function oC(n,e,t){let i,s,l,{record:o}=e,{value:r=null}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new _n}=e,c,d,p;function g(N){U.removeByValue(u,N),t(1,u)}function v(N){U.pushUnique(u,N),t(1,u)}function b(N){U.isEmpty(a[N])||a.splice(N,1),t(0,a)}function y(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const $=N=>U.hasImageExtension(N)?d==null?void 0:d.show(ke.Records.getFileUrl(o,N)):!1,S=N=>g(N),C=N=>v(N),M=N=>b(N);function D(N){me[N?"unshift":"push"](()=>{c=N,t(6,c)})}const P=()=>{for(let N of c.files)a.push(N);t(0,a),t(6,c.value=null,c)},O=()=>c==null?void 0:c.click();function F(N){me[N?"unshift":"push"](()=>{p=N,t(8,p)})}function E(N){me[N?"unshift":"push"](()=>{d=N,t(7,d)})}return n.$$set=N=>{"record"in N&&t(2,o=N.record),"value"in N&&t(13,r=N.value),"uploadedFiles"in N&&t(0,a=N.uploadedFiles),"deletedFileIndexes"in N&&t(1,u=N.deletedFileIndexes),"field"in N&&t(3,f=N.field)},n.$$.update=()=>{var N,Z;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=U.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=U.toArray(u))),n.$$.dirty&8&&t(5,i=((N=f.options)==null?void 0:N.maxSelect)>1),n.$$.dirty&8224&&(typeof r>"u"||r===null)&&t(13,r=i?[]:null),n.$$.dirty&8192&&t(4,s=U.toArray(r)),n.$$.dirty&27&&t(9,l=(s.length||a.length)&&((Z=f.options)==null?void 0:Z.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&y()},[a,u,o,f,s,i,c,d,p,l,g,v,b,r,$,S,C,M,D,P,O,F,E]}class rC extends Ae{constructor(e){super(),Ee(this,e,oC,lC,Oe,{record:2,value:13,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function vh(n){let e,t;return{c(){e=_("small"),t=j(n[1]),h(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&_e(t,i[1])},d(i){i&&k(e)}}}function aC(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&vh(n);return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=j(o),a=T(),c&&c.c(),h(e,"class","ri-information-line link-hint"),h(l,"class","block txt-ellipsis"),h(s,"class","content svelte-1gjwqyd")},m(d,p){w(d,e,p),w(d,i,p),w(d,s,p),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=xe(t=$t.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[p]){t&&En(t.update)&&p&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),p&1&&o!==(o=d[0].id+"")&&_e(r,o),d[1]!==""&&d[1]!==d[Line truncated
|
||||
`,h(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function EC(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new DC({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 AC(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new bC({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 PC(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new rC({props:u}),me.push(()=>Ie(e,"value",o)),me.push(()=>Ie(e,"uploadedFiles",r)),me.push(()=>Ie(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],Re(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],Re(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],Re(()=>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 LC(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new V4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 FC(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new R4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 IC(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new L4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 NC(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new O4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 RC(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new C4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 HC(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new k4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 jC(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new _4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>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 qC(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new h4({props:l}),me.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;
Line truncated
|
||||
<span class="txt">Delete</span>`,h(e,"tabindex","0"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function BC(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[9]&&Dh(n);return{c(){e=_("h4"),i=j(t),s=T(),o=j(l),r=j(" record"),a=T(),c&&c.c(),u=lt()},m(d,p){w(d,e,p),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,p),c&&c.m(d,p),w(d,u,p),f=!0},p(d,p){(!f||p[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&_e(i,t),(!f||p[0]&1)&&l!==(l=d[0].name+"")&&_e(o,l),!d[2].isNew&&d[9]?c?(c.p(d,p),p[0]&516&&A(c,1)):(c=Dh(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Te(),L(c,1,1,()=>{c=null}),De())},i(d){f||(A(c),f=!0)},o(d){L(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function UC(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=j(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[11]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=X(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&_e(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&Q(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function WC(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[UC],header:[BC],default:[VC]},$$scope:{ctx:n}};return e=new yi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|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[33](null),V(e,s)}}}function Oh(n){return JSON.stringify(n)}function YC(n,e,t){let i,s,l,o;const r=rn(),a="record_"+U.randomString(5);let{collection:u}=e,f,c=null,d=new ao,p=!1,g=!1,v={},b={},y="";function $(se){return C(se),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}function C(se){Li({}),c=se||{},t(2,d=se!=null&&se.clone?se.clone():new ao),t(3,v={}),t(4,b={}),t(15,y=Oh(d))}function M(){if(p||!s)return;t(7,p=!0);const se=P();let x;d.isNew?x=ke.Records.create(u==null?void 0:u.id,se):x=ke.Records.update(u==null?void 0:u.id,d.id,se),x.then(async ve=>{dn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",ve)}).catch(ve=>{ke.errorResponseHandler(ve)}).finally(()=>{t(7,p=!1)})}function D(){!(c!=null&&c.id)||gi("Do you really want to delete the selected record?",()=>ke.Records.delete(c["@collectionId"],c.id).then(()=>{S(),dn("Successfully deleted record."),r("delete",c)}).catch(se=>{ke.errorResponseHandler(se)}))}function P(){const se=(d==null?void 0:d.export())||{},x=new FormData,ve={};for(const He of(u==null?void 0:u.schema)||[])ve[He.name]=He;for(const He in se)!ve[He]||(typeof se[He]>"u"&&(se[He]=null),U.addValueToFormData(x,He,se[He]));for(const He in v){const Le=U.toArray(v[He]);for(const Pe of Le)x.append(He,Pe)}for(const He in b){const Le=U.toArray(b[He]);for(const Pe of Le)x.append(He+"."+Pe,"")}return x}const O=()=>S(),F=()=>D();function E(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function N(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function Z(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function ne(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function te(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function H(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function W(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function Y(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function K(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function ee(se,x){n.$$.not_equal(v[x.name],se)&&(v[x.name]=se,t(3,v))}function re(se,x){n.$$.not_equal(b[x.name],se)&&(b[x.name]=se,t(4,b))}function be(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}function ae(se,x){n.$$.not_equal(d[x.name],se)&&(d[x.name]=se,t(2,d))}const G=()=>s&&g?(gi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),S()}),!1):!0;function Ce(se){me[se?"unshift":"push"](()=>{f=se,t(6,f)})}function de(se){dt.call(this,n,se)}function fe(se){dt.call(this,n,se)}return n.$$set=se=>{"collection"in se&&t(0,u=se.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=U.hasNonEmptyProps(v)||U.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=Oh(d)),n.$$.dirty[0]&36&&t(10,l=d.isNew||s),n.$$.dirty[0]&1&&t(9,o=(u==null?void 0:u.name)!=="profiles")},[u,S,d,v,b,s,f,p,g,o,l,a,M,D,$,y,i,O,F,E,N,Z,ne,te,H,W,Y,K,ee,re,be,ae,G,Ce,de,fe]}class d_ extends Ae{constructor(e){super(),Ee(this,e,YC,WC,Oe,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){returLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Vh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function zh(n,e){let t,i,s;return i=new h_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=lt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),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 Bh(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,$,S,C,M,D,P,O,F,E,N,Z;function ne(){return e[25](e[35])}p=new Wo({props:{id:e[35].id}});let te=e[11];const H=K=>K[38].name;for(let K=0;K<te.length;K+=1){let ee=Rh(e,te,K),re=H(ee);b.set(re,v[K]=zh(re,ee))}S=new mi({props:{date:e[35].created}}),D=new mi({props:{date:e[35].updated}});function W(){return e[26](e[35])}function Y(...K){return e[27](e[35],...K)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),z(p.$$.fragment),g=T();for(let K=0;K<v.length;K+=1)v[K].c();y=T(),$=_("td"),z(S.$$.fragment),C=T(),M=_("td"),z(D.$$.fragment),P=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),h(l,"type","checkbox"),h(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],h(u,"for",f="checkbox_"+e[35].id),h(s,"class","form-field"),h(i,"class","bulk-select-col min-width"),h(d,"class","col-type-text col-field-id"),h($,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(K,ee){w(K,t,ee),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),q(p,d,null),m(t,g);for(let re=0;re<v.length;re+=1)v[re].m(t,null);m(t,y),m(t,$),q(S,$,null),m(t,C),m(t,M),q(D,M,null),m(t,P),m(t,O),m(t,F),E=!0,N||(Z=[X(l,"change",ne),X(s,"click",jn(e[19])),X(t,"click",W),X(t,"keydown",Y)],N=!0)},p(K,ee){e=K,(!E||ee[0]&8&&o!==(o="checkbox_"+e[35].id))&&h(l,"id",o),(!E||ee[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!E||ee[0]&8&&f!==(f="checkbox_"+e[35].id))&&h(u,"for",f);const re={};ee[0]&8&&(re.id=e[35].id),p.$set(re),ee[0]&2056&&(te=e[11],Te(),v=ut(v,ee,H,1,e,te,b,t,Ft,zh,y,Rh),De());const be={};ee[0]&8&&(be.date=e[35].created),S.$set(be);const ae={};ee[0]&8&&(ae.date=e[35].updated),D.$set(ae)},i(K){if(!E){A(p.$$.fragment,K);for(let ee=0;ee<te.length;ee+=1)A(v[ee]);A(S.$$.fragment,K),A(D.$$.fragment,K),E=!0}},o(K){L(p.$$.fragment,K);for(let ee=0;ee<v.length;ee+=1)L(v[ee]);L(S.$$.fragment,K),L(D.$$.fragment,K),E=!1},d(K){K&&k(t),V(p);for(let ee=0;ee<v.length;ee+=1)v[ee].d();V(S),V(D),N=!1,ot(Z)}}}function Uh(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=j("Showing "),s=j(i),l=j(" of "),o=j(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&_e(s,i),a[0]&16&&_e(o,r[4])},d(r){r&&k(e)}}}function Wh(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=j("Load more ("),o=j(l),r=j(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[8]),Q(t,"btn-disabled",n[8]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&_e(o,l),c[0]&256&&Q(t,"btn-loading",f[8]),c[0]&256&&Q(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Yh(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,p,g,v,b,y,$;return{c(){e=_("div"),t=_("div"),i=j("Selected "),s=_("strong"),l=j(n[6]),o=T(),a=j(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),p=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),Q(f,"btn-disabled",n[9]),h(d,"class","flex-fill"),h(g,"type","button"),h(g,"class","btn btn-sm btn-secondary btn-danger"),Q(g,"btn-loading",n[9]),Q(g,"btn-disabled",n[9]),h(e,"class","bulkbar")},m(S,C){w(S,e,C),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,p),m(e,g),b=!0,y||($=[X(f,"click",n[30]),X(g,"click",n[31])],y=!0)},p(S,C){(!b||C[0]&64)&&_e(l,S[6]),(!b||C[0]&64)&&r!==(r=S[6]===1?"record":"records")&&_e(a,r),C[0]&512&&Q(f,"btn-disabled",S[9]),C[0]&512&&Q(g,"btn-loading",S[9]),C[0]&512&&Q(g,"btn-disabled",S[9])},i(S){b||(S&&Tt(()=>{v||(v=ct(e,Gn,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(S){S&&(v||(v=ct(e,Gn,{duration:150,y:5},!1)),v.run(0)),b=!1},d(S){S&&k(e),S&&v&&v.end(),y=!1,ot($)}}}function pM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,$,S,C,M,D,P,O,F,E,N=[],Z=new Map,ne,te,H,W,Y,K,ee;function re(ce){n[21](ce)}let be={class:"col-type-text col-field-
Line truncated
|
||||
<span class="txt">API Preview</span>`,$=T(),S=_("button"),S.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New record</span>`,C=T(),z(M.$$.fragment),D=T(),z(P.$$.fragment),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(d,"type","button"),h(d,"class","btn btn-secondary btn-circle"),h(y,"type","button"),h(y,"class","btn btn-outline"),h(S,"type","button"),h(S,"class","btn btn-expanded"),h(b,"class","btns-group"),h(s,"class","page-header"),h(i,"class","page-wrapper")},m(W,Y){q(e,W,Y),w(W,t,Y),w(W,i,Y),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,f),m(s,c),m(s,d),m(s,p),q(g,s,null),m(s,v),m(s,b),m(b,y),m(b,$),m(b,S),m(i,C),q(M,i,null),m(i,D),q(P,i,null),E=!0,N||(Z=[xe($t.call(null,d,{text:"Edit collection",position:"right"})),X(d,"click",n[12]),X(y,"click",n[14]),X(S,"click",n[15])],N=!0)},p(W,Y){(!E||Y&4)&&u!==(u=W[2].name+"")&&_e(f,u);const K={};Y&1&&(K.value=W[0]),Y&4&&(K.autocompleteCollection=W[2]),M.$set(K);const ee={};Y&4&&(ee.collection=W[2]),!O&&Y&1&&(O=!0,ee.filter=W[0],Re(()=>O=!1)),!F&&Y&2&&(F=!0,ee.sort=W[1],Re(()=>F=!1)),P.$set(ee)},i(W){E||(A(e.$$.fragment,W),A(g.$$.fragment,W),A(M.$$.fragment,W),A(P.$$.fragment,W),E=!0)},o(W){L(e.$$.fragment,W),L(g.$$.fragment,W),L(M.$$.fragment,W),L(P.$$.fragment,W),E=!1},d(W){V(e,W),W&&k(t),W&&k(i),V(g),V(M),n[17](null),V(P),N=!1,ot(Z)}}}function bM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">Create new collection</span>`,h(t,"class","icon"),h(s,"class","m-b-10"),h(o,"type","button"),h(o,"class","btn btn-expanded-lg btn-lg"),h(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=X(o,"click",n[11]),r=!0)},p:oe,i:oe,o:oe,d(u){u&&k(e),r=!1,a()}}}function vM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function yM(n){let e,t,i,s,l,o,r,a,u;const f=[vM,bM,_M],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let p={};s=new za({props:p}),n[21](s);let g={};o=new o4({props:g}),n[22](o);let v={collection:n[2]};return a=new d_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,[y]){let $=e;e=d(b),e===$?c[e].p(b,y):(Te(),L(c[$],1,1,()=>{c[$]=null}),De(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const C={};o.$set(C);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){L(t),L(s.$$.fragment,b),L(o.$$.fragment,b),L(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),V(s,b),b&&k(l),n[22](null),V(o,b),b&&k(r),n[23](null),V(a,b)}}}function kM(n,e,t){var te;let i,s,l,o;cn(n,ni,H=>t(2,s=H)),cn(n,Ss,H=>t(10,l=H)),cn(n,Xr,H=>t(8,o=H));const r=U.getQueryParams((te=window.location)==null?void 0:te.href);let a,u,f,c,d=r.filter||"",p=r.sort||"-created",g=r.collectionId;U.setDocumentTitle("Collections"),Nw(g);const v=()=>a==null?void 0:a.show(),b=()=>a==null?void 0:a.show(s),y=()=>c==null?void 0:c.load(),$=()=>u==null?void 0:u.show(s),S=()=>f==null?void 0:f.show(),C=H=>t(0,d=H.detail);function M(H){me[H?"unshift":"push"](()=>{c=H,t(6,c)})}function D(H){d=H,t(0,d),t(2,s),t(9,g)}function P(H){p=H,t(1,p),t(2,s),t(9,g)}const O=H=>f==null?void 0:f.show(H==null?void 0:H.detail);function F(H){me[H?"unshift":"push"](()=>{a=H,t(3,a)})}function E(H){me[H?"unshift":"push"](()=>{u=H,t(4,u)})}function N(H){me[H?"unshift":"push"](()=>{f=H,t(5,f)})}const Z=()=>c==null?void 0:c.load(),ne=()=>c==null?void 0:c.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(H=>H.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&g!=s.id&&(t(9,g=s.id),t(1,p="-created"),t(0,d="")),n.$$.dirty&7&&(p||d||(s==null?void 0:s.id))&&U.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:d,sort:p})},[d,p,s,a,u,f,c,i,o,g,l,v,b,y,$,S,C,M,D,P,O,F,E,N,Z,ne]}class wM extends Ae{constructor(e){super(),Ee(this,e,kM,yM,Oe,{})}}function Kh(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[SM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(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 SM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",U.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","text"),h(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&h(e,"for",l),c[1]&1&&a!==(a=f[31])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Zh(n){let e,t,i,s;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',h(e,"class","form-field-addon txt-success")},m(l,o){w(l,e,o),i||(s=xe(t=$t.call(null,e,"Verified")),i=!0)},d(l){l&&k(e),i=!1,s()}}}function $M(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Zh();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),h(t,"class",U.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[31]),h(a,"type","email"),h(a,"autocomplete","off"),h(a,"id",u=n[31]),a.required=!0},m(p,g){w(p,e,g),m(e,t),m(e,i),m(e,s),w(p,o,g),d&&d.m(p,g),w(p,r,g),w(p,a,g),$e(a,n[2]),f||(c=X(a,"input",n[19]),f=!0)},p(p,g){g[1]&1&&l!==(l=p[31])&&h(e,"for",l),p[1].verified?d||(d=Zh(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=p[31])&&h(a,"id",u),g[0]&4&&a.value!==p[2]&&$e(a,p[2])},d(p){p&&k(e),p&&k(o),d&&d.d(p),p&&k(r),p&&k(a),f=!1,c()}}}function Jh(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[CM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&3&&(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 CM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=j("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[31]),h(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[20]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&h(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&o!==(o=u[31])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Gh(n){let e,t,i,s,l,o,r,a,u;return s=new Fe({props:{Line truncated
|
||||
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function AM(n){let e,t,i,s,l=!n[1].verified&&xh(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||||
<span class="txt">Delete</span>`,h(t,"type","button"),h(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=X(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=xh(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function PM(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&Qh(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=j(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[5],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],Q(l,"btn-loading",n[5])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?p&&(Te(),L(p,1,1,()=>{p=null}),De()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=Qh(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&_e(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&Q(l,"btn-loading",g[5])},i(g){f||(A(p),f=!0)},o(g){L(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function LM(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[PM],header:[EM],default:[OM]},$$scope:{ctx:n}};return e=new yi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(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[25](null),V(e,s)}}}function FM(n,e,t){let i;const s=rn(),l="user_"+U.randomString(5);let o,r=new uo,a=!1,u=!1,f="",c="",d="",p=!1,g=!0;function v(K){return y(K),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(K){Li({}),t(1,r=K!=null&&K.clone?K.clone():new uo),$()}function $(){t(3,p=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const K={email:f};(r.isNew||p)&&(K.password=c,K.passwordConfirm=d);let ee;r.isNew?ee=ke.Users.create(K):ee=ke.Users.update(r.id,K),ee.then(async re=>{g&&M(!1),t(6,u=!1),b(),dn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",re)}).catch(re=>{ke.errorResponseHandler(re)}).finally(()=>{t(5,a=!1)})}function C(){!(r!=null&&r.id)||gi("Do you really want to delete the selected user?",()=>ke.Users.delete(r.id).then(()=>{t(6,u=!1),b(),dn("Successfully deleted user."),s("delete",r)}).catch(K=>{ke.errorResponseHandler(K)}))}function M(K=!0){return ke.Users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),K&&dn(`Successfully sent verification email to ${r.email}.`)}).catch(ee=>{ke.errorResponseHandler(ee)})}const D=()=>M(),P=()=>C(),O=()=>b();function F(){f=this.value,t(2,f)}function E(){p=this.checked,t(3,p)}function N(){c=this.value,t(7,c)}function Z(){d=this.value,t(8,d)}function ne(){g=this.checked,t(9,g)}const te=()=>i&&u?(gi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function H(K){me[K?"unshift":"push"](()=>{o=K,t(4,o)})}function W(K){dt.call(this,n,K)}function Y(K){dt.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||p||f!==r.email)},[b,r,f,p,o,a,u,c,d,g,i,l,S,C,M,v,D,P,O,F,E,N,Z,ne,te,H,W,Y]}class IM extends Ae{constructor(e){super(),Ee(this,e,FM,LM,Oe,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function ep(n,e,t){const i=n.slice();return i[38]=e[t],i}function tp(n,e,t){const i=n.slice();return i[41]=e[t],i}function np(n,e,t){const i=n.slice();return i[41]=e[t],i}function NM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S,C,M,D,P,O,F=[],E=new Map,N,Z,ne,te,H,W,Y,K,ee,re,be=[],ae=new Map,G,Ce,de,fe,se;r=new jo({}),r.$on("refresh",n[16]),p=new Ho({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),p.$on("submit",n[18]);function x(pe){n[19](pe)}let ve={class:"col-type-text col-field-id",name:"id",$$slots:{default:[HM]},$$scope:{ctx:n}};n[4]!==void 0&&(ve.sort=n[4]),S=new xt({props:ve}),me.push(()=>Ie(S,"sort",x));function He(pe){n[20](pe)}let Le={class:"col-type-email col-field-email",name:"email",$$slots:{default:[jM]},$$scope:{ctx:n}};n[4]!==void 0&&(Le.sort=n[4]),D=new xt({props:Le}),me.push(()=>Ie(D,"sort",He));let Pe=n[12];const ue=pe=>pe[41].name;for(let pe=0;pe<Pe.length;pe+=1){let Ve=np(n,Pe,pe),Ge=ue(Ve);E.set(Ge,F[pe]=ip(Ge,Ve))}function ce(pe){n[21](pe)}let ye={class:"col-type-date col-field-created",name:"created",$$slots:{default:[qM]},$$scope:{ctx:n}};n[4]!==void 0&&(ye.sort=n[4]),Z=new xt({props:ye}),me.push(()=>Ie(Z,"sort",ce));function Be(pe){n[22](pe)}let Ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[VM]},$$scope:{ctx:n}};n[4]!==void 0&&(KLine truncated
|
||||
<span class="txt">New user</span>`,d=T(),z(p.$$.fragment),g=T(),v=_("div"),b=_("table"),y=_("thead"),$=_("tr"),z(S.$$.fragment),M=T(),z(D.$$.fragment),O=T();for(let pe=0;pe<F.length;pe+=1)F[pe].c();N=T(),z(Z.$$.fragment),te=T(),z(H.$$.fragment),Y=T(),K=_("th"),ee=T(),re=_("tbody");for(let pe=0;pe<be.length;pe+=1)be[pe].c();et&&et.c(),G=T(),J&&J.c(),Ce=T(),le&&le.c(),h(i,"class","breadcrumbs"),h(l,"type","button"),h(l,"class","btn btn-secondary btn-circle"),h(u,"class","flex-fill"),h(c,"type","button"),h(c,"class","btn btn-expanded"),h(t,"class","page-header"),h(K,"class","col-type-action min-width"),h(b,"class","table"),Q(b,"table-loading",n[10]),h(v,"class","table-wrapper"),h(e,"class","page-wrapper")},m(pe,Ve){w(pe,e,Ve),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),q(r,t,null),m(t,a),m(t,u),m(t,f),m(t,c),m(e,d),q(p,e,null),m(e,g),m(e,v),m(v,b),m(b,y),m(y,$),q(S,$,null),m($,M),q(D,$,null),m($,O);for(let Ge=0;Ge<F.length;Ge+=1)F[Ge].m($,null);m($,N),q(Z,$,null),m($,te),q(H,$,null),m($,Y),m($,K),m(b,ee),m(b,re);for(let Ge=0;Ge<be.length;Ge+=1)be[Ge].m(re,null);et&&et.m(re,null),m(e,G),J&&J.m(e,null),m(e,Ce),le&&le.m(e,null),de=!0,fe||(se=[xe($t.call(null,l,{text:"Edit profile collection",position:"right"})),X(l,"click",n[15]),X(c,"click",n[17])],fe=!0)},p(pe,Ve){const Ge={};Ve[0]&8&&(Ge.value=pe[3]),p.$set(Ge);const bt={};Ve[1]&32768&&(bt.$$scope={dirty:Ve,ctx:pe}),!C&&Ve[0]&16&&(C=!0,bt.sort=pe[4],Re(()=>C=!1)),S.$set(bt);const rt={};Ve[1]&32768&&(rt.$$scope={dirty:Ve,ctx:pe}),!P&&Ve[0]&16&&(P=!0,rt.sort=pe[4],Re(()=>P=!1)),D.$set(rt),Ve[0]&4096&&(Pe=pe[12],F=ut(F,Ve,ue,1,pe,Pe,E,$,ln,ip,N,np));const at={};Ve[1]&32768&&(at.$$scope={dirty:Ve,ctx:pe}),!ne&&Ve[0]&16&&(ne=!0,at.sort=pe[4],Re(()=>ne=!1)),Z.$set(at);const yt={};Ve[1]&32768&&(yt.$$scope={dirty:Ve,ctx:pe}),!W&&Ve[0]&16&&(W=!0,yt.sort=pe[4],Re(()=>W=!1)),H.$set(yt),Ve[0]&5450&&(Ue=pe[1],Te(),be=ut(be,Ve,Je,1,pe,Ue,ae,re,Ft,rp,null,ep),De(),!Ue.length&&et?et.p(pe,Ve):Ue.length?et&&(et.d(1),et=null):(et=sp(pe),et.c(),et.m(re,null))),Ve[0]&1024&&Q(b,"table-loading",pe[10]),pe[1].length?J?J.p(pe,Ve):(J=ap(pe),J.c(),J.m(e,Ce)):J&&(J.d(1),J=null),pe[1].length&&pe[13]?le?le.p(pe,Ve):(le=up(pe),le.c(),le.m(e,null)):le&&(le.d(1),le=null)},i(pe){if(!de){A(r.$$.fragment,pe),A(p.$$.fragment,pe),A(S.$$.fragment,pe),A(D.$$.fragment,pe),A(Z.$$.fragment,pe),A(H.$$.fragment,pe);for(let Ve=0;Ve<Ue.length;Ve+=1)A(be[Ve]);de=!0}},o(pe){L(r.$$.fragment,pe),L(p.$$.fragment,pe),L(S.$$.fragment,pe),L(D.$$.fragment,pe),L(Z.$$.fragment,pe),L(H.$$.fragment,pe);for(let Ve=0;Ve<be.length;Ve+=1)L(be[Ve]);de=!1},d(pe){pe&&k(e),V(r),V(p),V(S),V(D);for(let Ve=0;Ve<F.length;Ve+=1)F[Ve].d();V(Z),V(H);for(let Ve=0;Ve<be.length;Ve+=1)be[Ve].d();et&&et.d(),J&&J.d(),le&&le.d(),fe=!1,ot(se)}}}function RM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||||
<h1>Loading users...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function HM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",U.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function jM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",U.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ip(n,e){let t,i,s,l,o,r,a,u=e[41].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=j("profile."),f=j(u),h(s,"class",l=U.getFieldTypeIcon(e[41].type)),h(r,"class","txt"),h(i,"class","col-header-content"),h(t,"class",c="col-type-"+e[41].type+" col-field-"+e[41].name),h(t,"name",d=e[41].name),this.first=t},m(p,g){w(p,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(p,g){e=p,g[0]&4096&&l!==(l=U.getFieldTypeIcon(e[41].type))&&h(s,"class",l),g[0]&4096&&u!==(u=e[41].name+"")&&_e(f,u),g[0]&4096&&c!==(c="col-type-"+e[41].type+" col-field-"+e[41].name)&&h(t,"class",c),g[0]&4096&&d!==(d=e[41].name)&&h(t,"name",d)},d(p){p&&k(t)}}}function qM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",U.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function VM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",U.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function sp(n){let e;function t(l,o){return l[10]?BM:zM}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},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){s.d(l),l&&k(e)}}}function zM(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&lp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=lp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function BM(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function lp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[25]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function op(n,e){let t,i,s;return i=new h_({props:{field:e[41],record:e[38].profile||{}}}),{key:n,first:null,c(){t=lt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[41]),o[0]&2&&(r.record=e[38].profile||{}),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 rp(n,e){let t,i,s,l,o,r,a,u=e[38].email+"",f,c,d,p,g=e[38].verified?"Verified":"Unverified",v,b,y=[],$=new Map,S,C,M,D,P,O,F,E,N,Z,ne,te,H,W,Y;s=new Wo({props:{id:e[38].id}});let K=e[12];const ee=ae=>ae[41].name;for(let ae=0;ae<K.length;ae+=1){let G=tp(e,K,ae),Ce=ee(G);$.set(Ce,y[ae]=op(Ce,G))}M=new mi({props:{date:e[38].created}}),O=new mi({props:{date:e[38].updated}});function re(){return e[23](e[38])}function be(){return e[24](e[38])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),z(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=j(u),d=T(),p=_("span"),v=j(g),b=T();for(let ae=0;ae<y.length;ae+=1)y[ae].c();S=T(),C=_("td"),z(M.$$.fragment),D=T(),P=_("td"),z(O.$$.fragment),F=T(),E=_("td"),N=_("button"),N.innerHTML=`<i class="ri-user-settings-line"></i>
|
||||
<span class="txt">Edit user</span>`,Z=T(),ne=_("button"),ne.innerHTML=`<i class="ri-profile-line"></i>
|
||||
<span class="txt">Edit profile</span>`,te=T(),h(i,"class","col-type-text col-field-id"),h(a,"class","txt"),h(a,"title",c=e[38].email),h(p,"class","label"),Q(p,"label-success",e[38].verified),Q(p,"label-warning",!e[38].verified),h(r,"class","inline-flex"),h(o,"class","col-type-email col-field-email"),h(C,"class","col-type-date col-field-created"),h(P,"class","col-type-date col-field-updated"),h(N,"type","button"),h(N,"class","btn btn-sm btn-outline"),h(ne,"type","button"),h(ne,"class","btn btn-sm m-l-10"),h(E,"class","col-type-action min-width"),this.first=t},m(ae,G){w(ae,t,G),m(t,i),q(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,p),m(p,v),m(t,b);for(let Ce=0;Ce<y.length;Ce+=1)y[Ce].m(t,null);m(t,S),m(t,C),q(M,C,null),m(t,D),m(t,P),q(O,P,null),m(t,F),m(t,E),m(E,N),m(E,Z),m(E,ne),m(t,te),H=!0,W||(Y=[X(N,"click",jn(re)),X(ne,"click",jn(be))],W=!0)},p(ae,G){e=ae;const Ce={};G[0]&2&&(Ce.id=e[38].id),s.$set(Ce),(!H||G[0]&2)&&u!==(u=e[38].email+"")&&_e(f,u),(!H||G[0]&2&&c!==(c=e[38].email))&&h(a,"title",c),(!H||G[0]&2)&&g!==(g=e[38].verified?"Verified":"Unverified")&&_e(v,g),G[0]&2&&Q(p,"label-success",e[38].verified),G[0]&2&&Q(p,"label-warning",!e[38].verified),G[0]&4098&&(K=e[12],Te(),y=ut(y,G,ee,1,e,K,$,t,Ft,op,S,tp),De());const de={};G[0]&2&&(de.date=e[38].created),M.$set(de);const fe={};G[0]&2&&(fe.date=e[38].updated),O.$set(fe)},i(ae){if(!H){A(s.$$.fragment,ae);for(let G=0;G<K.length;G+=1)A(y[G]);A(M.$$.fragment,ae),A(O.$$.fragment,ae),H=!0}},o(ae){L(s.$$.fragment,ae);for(let G=0;G<y.length;G+=1)L(y[G]);L(M.$$.fragment,ae),L(O.$$.fragment,ae),H=!1},d(ae){ae&&k(t),V(s);for(let G=0;G<y.length;G+=1)y[G].d();V(M),V(O),W=!1,ot(Y)}}}function ap(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=j("Showing "),s=j(i),l=j(" of "),o=j(n[2]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&_e(s,i),a[0]&4&&_e(o,r[2])},d(r){r&&k(e)}}}function up(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=j("Load more ("),o=j(l),r=j(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),Q(t,"btn-loading",n[10]),Q(t,"btn-disabled",n[10]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=X(t,"click",n[26]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&_e(o,l),c[0]&1024&&Q(t,"btn-loading",f[10]),c[0]&1024&&Q(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function UM(n){let e,t,i,s,l,o,r,a,u;const f=[RM,NM],c=[];function d(b,y){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let p={};s=new IM({props:p}),n[27](s),s.$on("save",n[28]),s.$on("delete",n[29]);let g={};o=new za({props:g}),n[30](o),o.$on("save",n[31]);let v={collection:n[5]};return a=new d_({props:v}),n[32](a),a.$on("save",n[33]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,y){let $=e;e=d(b),e===$?c[e].p(b,y):(Te(),L(c[$],1,1,()=>{c[$]=null}),De(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const C={};o.$set(C);const M={};y[0]&32&&(M.collection=b[5]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){L(t),L(s.$$.fragment,b),L(o.$$.fragment,b),L(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[27](null),V(s,b),b&&k(l),n[30](null),V(o,b),b&&k(r),n[32](null),V(a,b)}}}function WM(n,e,t){var de;let i,s;const l=U.getQueryParams((de=window.location)==null?void 0:de.href),o=["id","userId","created","updated"];let r,a,u,f=[],c=1,d=0,p=!1,g=l.filter||"",v=l.sort||"-created",b=new On,y=!1;U.setDocumentTitle("Users"),M();async function $(fe=1){return t(10,p=!0),fe<=1&&S(),ke.Users.getList(fe,50,{sort:v||"-created",filter:g}).then(se=>{t(10,p=!1),t(1,f=f.concat(se.items)),t(9,c=se.page),t(2,d=se.totalItems)}).catch(se=>{se!=null&&se.isAbort||(t(10,p=!1),console.warn(se),S(),ke.errorResponseHandler(se,!1))})}function S(){t(1,f=[]),t(9,c=1),t(2,d=0)}function C(fe){const se=f.find(x=>x.id===(fe==null?void 0:fe.userId));se&&(se.profile=fe),t(1,f)}async function M(){t(11,y=!0);try{t(5,b=await ke.Collections.getOne("profiles"))}catch(fe){ke.errorResponseHandler(fe)}t(11,y=!1)}const D=()=>a==null?void 0:a.show(b),P=()=>$(),O=()=>r==null?void 0:r.show(),F=fe=>t(3,g=fe.detail);function E(fe){v=fe,t(4,v)}function N(fe){v=fe,t(4,v)}function Z(fe){v=fe,t(4,v)}function ne(fe){v=fe,t(4,v)}const te=fe=>r==null?void 0:r.show(fe),H=fe=>u==null?void 0:u.show(fe.profile),W=()=>t(3,g=""),Y=()=>$(c+1);function K(fe){me[fe?"unshift":"push"](()=>{r=fe,t(6,r)})}const ee=()=>$(),re=()=>$();function be(fe){me[fe?"unshift":"push"](()=>{a=fe,t(7,a)})}const ae=fe=>t(5,b=fe.detail);function G(fe){me[fe?"unshift":"push"](()=>{u=fe,t(8,u)})}const Ce=fe=>C(fe.detail);return n.$$.update=()=>{var fe;n.$$.dirty[0]&24&&v!==-1&&g!==-1&&(U.replaceClientQuerLine truncated
|
||||
<span class="txt">Application</span>`,o=T(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||||
<span class="txt">Mail settings</span>`,a=T(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||||
<span class="txt">Files storage</span>`,f=T(),c=_("div"),c.textContent="Authentication",d=T(),p=_("a"),p.innerHTML=`<i class="ri-lock-password-line"></i>
|
||||
<span class="txt">Auth providers</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-key-line"></i>
|
||||
<span class="txt">Token options</span>`,b=T(),y=_("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
|
||||
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(c,"class","sidebar-title"),h(p,"href","/settings/auth-providers"),h(p,"class","sidebar-list-item"),h(v,"href","/settings/tokens"),h(v,"class","sidebar-list-item"),h(y,"href","/settings/admins"),h(y,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,p),m(t,g),m(t,v),m(t,b),m(t,y),$||(S=[xe(xn.call(null,l,{path:"/settings"})),xe(wn.call(null,l)),xe(xn.call(null,r,{path:"/settings/mail/?.*"})),xe(wn.call(null,r)),xe(xn.call(null,u,{path:"/settings/storage/?.*"})),xe(wn.call(null,u)),xe(xn.call(null,p,{path:"/settings/auth-providers/?.*"})),xe(wn.call(null,p)),xe(xn.call(null,v,{path:"/settings/tokens/?.*"})),xe(wn.call(null,v)),xe(xn.call(null,y,{path:"/settings/admins/?.*"})),xe(wn.call(null,y))],$=!0)},p:oe,i:oe,o:oe,d(C){C&&k(e),$=!1,ot(S)}}}class Os extends Ae{constructor(e){super(),Ee(this,e,null,KM,Oe,{})}}function fp(n,e,t){const i=n.slice();return i[31]=e[t],i}function cp(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[ZM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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 ZM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",U.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","text"),h(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&h(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function dp(n){let e,t,i,s,l,o,r,a;function u(){return n[17](n[31])}function f(...c){return n[18](n[31],...c)}return{c(){e=_("figure"),t=_("img"),l=T(),Zn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||h(t,"src",i),h(t,"alt",s="Avatar "+n[31]),h(e,"tabindex","0"),h(e,"class",o="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(c,d){w(c,e,d),m(e,t),m(e,l),r||(a=[X(e,"click",u),X(e,"keydown",f)],r=!0)},p(c,d){n=c,d[0]&4&&o!==(o="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",o)},d(c){c&&k(e),r=!1,ot(a)}}}function JM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),r=_("input"),h(t,"class",U.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),$e(r,n[3]),u||(f=X(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&8&&r.value!==c[3]&&$e(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function hp(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[GM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(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 GM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=j("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[30]),h(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function pp(n){let e,t,i,s,l,o,r,a,u;return s=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[XM,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[QM,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742080|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&1073742336|c[1]&8&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),Tt(()=>{a||(a=ct(t,Xt,{duration:150},!0)),a.Line truncated
|
||||
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function nT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&mp(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=j(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=X(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?p&&(Te(),L(p,1,1,()=>{p=null}),De()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=mp(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&_e(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&Q(l,"btn-loading",g[6])},i(g){f||(A(p),f=!0)},o(g){L(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function iT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[nT],header:[eT],default:[xM]},$$scope:{ctx:n}};return e=new yi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|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 sT(n,e,t){let i;const s=rn(),l="admin_"+U.randomString(5);let o,r=new vs,a=!1,u=!1,f=0,c="",d="",p="",g=!1;function v(Y){return y(Y),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Y){Li({}),t(1,r=Y!=null&&Y.clone?Y.clone():new vs),$()}function $(){t(4,g=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,p="")}function S(){if(a||!i)return;t(6,a=!0);const Y={email:c,avatar:f};(r.isNew||g)&&(Y.password=d,Y.passwordConfirm=p);let K;r.isNew?K=ke.Admins.create(Y):K=ke.Admins.update(r.id,Y),K.then(async ee=>{var re;t(7,u=!1),b(),dn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ee),((re=ke.AuthStore.model)==null?void 0:re.id)===ee.id&&ke.AuthStore.save(ke.AuthStore.token,ee)}).catch(ee=>{ke.errorResponseHandler(ee)}).finally(()=>{t(6,a=!1)})}function C(){!(r!=null&&r.id)||gi("Do you really want to delete the selected admin?",()=>ke.Admins.delete(r.id).then(()=>{t(7,u=!1),b(),dn("Successfully deleted admin."),s("delete",r)}).catch(Y=>{ke.errorResponseHandler(Y)}))}const M=()=>C(),D=()=>b(),P=Y=>t(2,f=Y),O=(Y,K)=>{(K.code==="Enter"||K.code==="Space")&&(K.preventDefault(),t(2,f=Y))};function F(){c=this.value,t(3,c)}function E(){g=this.checked,t(4,g)}function N(){d=this.value,t(8,d)}function Z(){p=this.value,t(9,p)}const ne=()=>i&&u?(gi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function te(Y){me[Y?"unshift":"push"](()=>{o=Y,t(5,o)})}function H(Y){dt.call(this,n,Y)}function W(Y){dt.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,p,i,l,S,C,v,M,D,P,O,F,E,N,Z,ne,te,H,W]}class lT extends Ae{constructor(e){super(),Ee(this,e,sT,iT,Oe,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function gp(n,e,t){const i=n.slice();return i[22]=e[t],i}function oT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",U.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function rT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",U.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function aT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",U.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function uT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",U.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function _p(n){let e;function t(l,o){return l[5]?cT:fT}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},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){s.d(l),l&&k(e)}}}function fT(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&bp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-cLine truncated
|
||||
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function bp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=X(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function vp(n){let e;return{c(){e=_("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yp(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g=e[22].email+"",v,b,y,$,S,C,M,D,P,O,F,E,N,Z;u=new Wo({props:{id:e[22].id}});let ne=e[22].id===e[6].id&&vp();S=new mi({props:{date:e[22].created}}),D=new mi({props:{date:e[22].updated}});function te(){return e[14](e[22])}function H(...W){return e[15](e[22],...W)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),z(u.$$.fragment),f=T(),ne&&ne.c(),c=T(),d=_("td"),p=_("span"),v=j(g),y=T(),$=_("td"),z(S.$$.fragment),C=T(),M=_("td"),z(D.$$.fragment),P=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),Zn(l.src,o="/_/images/avatars/avatar"+(e[22].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(a,"class","col-type-text col-field-id"),h(p,"class","txt txt-ellipsis"),h(p,"title",b=e[22].email),h(d,"class","col-type-email col-field-email"),h($,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(W,Y){w(W,t,Y),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),q(u,a,null),m(a,f),ne&&ne.m(a,null),m(t,c),m(t,d),m(d,p),m(p,v),m(t,y),m(t,$),q(S,$,null),m(t,C),m(t,M),q(D,M,null),m(t,P),m(t,O),m(t,F),E=!0,N||(Z=[X(t,"click",te),X(t,"keydown",H)],N=!0)},p(W,Y){e=W,(!E||Y&16&&!Zn(l.src,o="/_/images/avatars/avatar"+(e[22].avatar||0)+".svg"))&&h(l,"src",o);const K={};Y&16&&(K.id=e[22].id),u.$set(K),e[22].id===e[6].id?ne||(ne=vp(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!E||Y&16)&&g!==(g=e[22].email+"")&&_e(v,g),(!E||Y&16&&b!==(b=e[22].email))&&h(p,"title",b);const ee={};Y&16&&(ee.date=e[22].created),S.$set(ee);const re={};Y&16&&(re.date=e[22].updated),D.$set(re)},i(W){E||(A(u.$$.fragment,W),A(S.$$.fragment,W),A(D.$$.fragment,W),E=!0)},o(W){L(u.$$.fragment,W),L(S.$$.fragment,W),L(D.$$.fragment,W),E=!1},d(W){W&&k(t),V(u),ne&&ne.d(),V(S),V(D),N=!1,ot(Z)}}}function kp(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=j("Showing "),s=j(i),l=j(" of "),r=j(o),h(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&_e(s,i),u&16&&o!==(o=a[4].length+"")&&_e(r,o)},d(a){a&&k(e)}}}function dT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S,C,M,D,P,O,F,E,N,Z,ne,te,H,W,Y,K,ee,re=[],be=new Map,ae,G,Ce,de,fe,se;e=new Os({}),r=new jo({}),r.$on("refresh",n[7]),p=new Ho({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),p.$on("submit",n[9]);function x(J){n[10](J)}let ve={class:"col-type-text",name:"id",$$slots:{default:[oT]},$$scope:{ctx:n}};n[2]!==void 0&&(ve.sort=n[2]),M=new xt({props:ve}),me.push(()=>Ie(M,"sort",x));function He(J){n[11](J)}let Le={class:"col-type-email col-field-email",name:"email",$$slots:{default:[rT]},$$scope:{ctx:n}};n[2]!==void 0&&(Le.sort=n[2]),O=new xt({props:Le}),me.push(()=>Ie(O,"sort",He));function Pe(J){n[12](J)}let ue={class:"col-type-date col-field-created",name:"created",$$slots:{default:[aT]},$$scope:{ctx:n}};n[2]!==void 0&&(ue.sort=n[2]),N=new xt({props:ue}),me.push(()=>Ie(N,"sort",Pe));function ce(J){n[13](J)}let ye={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[uT]},$$scope:{ctx:n}};n[2]!==void 0&&(ye.sort=n[2]),te=new xt({props:ye}),me.push(()=>Ie(te,"sort",ce));let Be=n[4];const Ke=J=>J[22].id;for(let J=0;J<Be.length;J+=1){let le=gp(n,Be,J),pe=Ke(le);be.set(pe,re[J]=yp(pe,le))}let Ue=null;Be.length||(Ue=_p(n));let Je=n[4].length&&kp(n),et={};return Ce=new lT({props:et}),n[17](Ce),Ce.$on("save",n[18]),Ce.$on("delete",n[19]),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),l.innerHTML=`<div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Admins</div>`,o=T(),z(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-add-line"></i>
|
||||
<span class="txt">New admin</span>`,d=T(),z(p.$$.fragment),g=T(),v=_("div"),b=_("table"),y=_("thead"),$=_("tr"),S=_("th"),C=T(),z(M.$$.fragment),P=T(),z(O.$$.fragment),E=T(),z(N.$$.fragment),ne=T(),z(te.$$.fragment),W=T(),Y=_("th"),K=T(),ee=_("tbody");for(let J=0;J<re.length;J+=1)re[J].c();Ue&&Ue.c(),ae=T(),Je&&Je.c(),G=T(),z(Ce.$$.fragment),h(l,"class","breadcrumbs"),h(u,"class","flex-fill"),h(c,"type","button"),h(c,"class","btn btn-expanded"),h(s,"class","page-header"),h(S,"class","min-width"),h(Y,"class","col-type-action min-width"),h(b,"class","table"),Q(b,"table-loading",n[5]),h(v,"class","table-wrapper"),h(i,"class","page-wrapper")},m(J,le){q(e,J,le),w(J,t,le),w(J,i,le),m(i,s),m(s,l),m(s,o),q(r,s,null),m(s,a),m(s,u),m(s,f),m(s,c),m(i,d),q(p,i,null),m(i,g),m(i,v),m(v,b),m(b,y),m(y,$),m($,S),m($,C),q(M,$,null),m($,P),q(O,$,null),m($,E),q(N,$,null),m($,ne),q(te,$,null),m($,W),m($,Y),m(b,K),m(b,ee);for(let pe=0;pe<re.length;pe+=1)re[pe].m(ee,null);Ue&&Ue.m(ee,null),m(i,ae),Je&&Je.m(i,null),w(J,G,le),q(Ce,J,le),de=!0,fe||(se=X(c,"click",n[8]),fe=!0)},p(J,[le]){const pe={};le&2&&(pe.value=J[1]),p.$set(pe);const Ve={};le&33554432&&(Ve.$$scope={dirty:le,ctx:J}),!D&&le&4&&(D=!0,Ve.sort=J[2],Re(()=>D=!1)),M.$set(Ve);const Ge={};le&33554432&&(Ge.$$scope={dirty:le,ctx:J}),!F&&le&4&&(F=!0,Ge.sort=J[2],Re(()=>F=!1)),O.$set(Ge);const bt={};le&33554432&&(bt.$$scope={dirty:le,ctx:J}),!Z&&le&4&&(Z=!0,bt.sort=J[2],Re(()=>Z=!1)),N.$set(bt);const rt={};le&33554432&&(rt.$$scope={dirty:le,ctx:J}),!H&&le&4&&(H=!0,rt.sort=J[2],Re(()=>H=!1)),te.$set(rt),le&122&&(Be=J[4],Te(),re=ut(re,le,Ke,1,J,Be,be,ee,Ft,yp,null,gp),De(),!Be.length&&Ue?Ue.p(J,le):Be.length?Ue&&(Ue.d(1),Ue=null):(Ue=_p(J),Ue.c(),Ue.m(ee,null))),le&32&&Q(b,"table-loading",J[5]),J[4].length?Je?Je.p(J,le):(Je=kp(J),Je.c(),Je.m(i,null)):Je&&(Je.d(1),Je=null);const at={};Ce.$set(at)},i(J){if(!de){A(e.$$.fragment,J),A(r.$$.fragment,J),A(p.$$.fragment,J),A(M.$$.fragment,J),A(O.$$.fragment,J),A(N.$$.fragment,J),A(te.$$.fragment,J);for(let le=0;le<Be.length;le+=1)A(re[le]);A(Ce.$$.fragment,J),de=!0}},o(J){L(e.$$.fragment,J),L(r.$$.fragment,J),L(p.$$.fragment,J),L(M.$$.fragment,J),L(O.$$.fragment,J),L(N.$$.fragment,J),L(te.$$.fragment,J);for(let le=0;le<re.length;le+=1)L(re[le]);L(Ce.$$.fragment,J),de=!1},d(J){V(e,J),J&&k(t),J&&k(i),V(r),V(p),V(M),V(O),V(N),V(te);for(let le=0;le<re.length;le+=1)re[le].d();Ue&&Ue.d(),Je&&Je.d(),J&&k(G),n[17](null),V(Ce,J),fe=!1,se()}}}function hT(n,e,t){var F;let i;cn(n,ga,E=>t(6,i=E));const s=U.getQueryParams((F=window.location)==null?void 0:F.href);let l,o=[],r=!1,a=s.filter||"",u=s.sort||"-created";U.setDocumentTitle("Admins");function f(){return t(5,r=!0),t(4,o=[]),ke.Admins.getFullList(100,{sort:u||"-created",filter:a}).then(E=>{t(4,o=E),t(5,r=!1)}).catch(E=>{E!=null&&E.isAbort||(t(5,r=!1),console.warn(E),c(),ke.errorResponseHandler(E,!1))})}function c(){t(4,o=[])}const d=()=>f(),p=()=>l==null?void 0:l.show(),g=E=>t(1,a=E.detail);function v(E){u=E,t(2,u)}function b(E){u=E,t(2,u)}function y(E){u=E,t(2,u)}function $(E){u=E,t(2,u)}const S=E=>l==null?void 0:l.show(E),C=(E,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),l==null||l.show(E))},M=()=>t(1,a="");function D(E){me[E?"unshift":"push"](()=>{l=E,t(3,l)})}const P=()=>f(),O=()=>f();return n.$$.update=()=>{n.$$.dirty&6&&u!==-1&&a!==-1&&(U.replaceClientQueryParams({filter:a,sort:u}),f())},[f,a,u,l,o,r,i,d,p,g,v,b,y,$,S,C,M,D,P,O]}class pT extends Ae{constructor(e){super(),Ee(this,e,hT,dT,Oe,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function mT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Email"),s=T(),l=_("input"),h(e,"for",i=n[7]),h(l,"type","email"),h(l,"id",o=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0]),l.focus(),r||(a=X(l,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&h(e,"for",i),f&128&&o!==(o=u[7])&&h(l,"id",o),f&1&&l.value!==u[0]&&$e(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function gT(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=j("Password"),s=T(),l=_("input"),r=T(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",h(e,"for",i=n[7]),h(l,"type","password"),h(l,"id",o=n[7]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(d,p){w(d,e,p),m(e,t),w(d,s,p),w(d,l,p),$e(l,n[1]),w(d,r,p),w(d,a,p),m(a,u),f||(c=[X(l,"input",n[5]),xe(wn.call(null,u))],f=!0)},p(d,p){p&128&&i!==(i=d[7])&&h(e,"for",i),p&128&&o!==(o=d[7])&&h(l,"id",o),p&2&&l.value!==d[1]&&$e(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,ot(c)}}}function _T(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[mT,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[gT,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign inLine truncated
|
||||
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),h(e,"class","block")},m(d,p){w(d,e,p),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),m(e,a),u=!0,f||(c=X(e,"submit",Wt(n[3])),f=!0)},p(d,p){const g={};p&385&&(g.$$scope={dirty:p,ctx:d}),s.$set(g);const v={};p&386&&(v.$$scope={dirty:p,ctx:d}),o.$set(v),p&4&&Q(a,"btn-disabled",d[2]),p&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 bT(n){let e,t;return e=new rg({props:{$$slots:{default:[_T]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(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 vT(n,e,t){var f;const i=U.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",o=!1;function r(){if(!o)return t(2,o=!0),ke.Admins.authViaEmail(s,l).then(()=>{$s("/")}).catch(()=>{ng("Invalid login credentials.")}).finally(()=>{t(2,o=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,o,r,a,u]}class yT extends Ae{constructor(e){super(),Ee(this,e,vT,bT,Oe,{})}}function kT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$;return i=new Fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[ST,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[$T,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[CT,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),p=_("button"),g=_("span"),g.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(c,"class","flex-fill"),h(g,"class","txt"),h(p,"type","submit"),h(p,"class","btn btn-expanded"),p.disabled=v=!n[3]||n[2],Q(p,"btn-loading",n[2]),h(f,"class","col-lg-12 flex"),h(e,"class","grid")},m(S,C){w(S,e,C),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,p),m(p,g),b=!0,y||($=X(p,"click",n[9]),y=!0)},p(S,C){const M={};C&12289&&(M.$$scope={dirty:C,ctx:S}),i.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),o.$set(D);const P={};C&12289&&(P.$$scope={dirty:C,ctx:S}),a.$set(P),(!b||C&12&&v!==(v=!S[3]||S[2]))&&(p.disabled=v),C&4&&Q(p,"btn-loading",S[2])},i(S){b||(A(i.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),b=!0)},o(S){L(i.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),b=!1},d(S){S&&k(e),V(i),V(o),V(a),y=!1,$()}}}function wT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function ST(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Application name"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","text"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.appName),r||(a=X(l,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&$e(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function $T(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Application url"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","text"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.appUrl),r||(a=X(l,"input",n[7]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&$e(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function CT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Logs max days retention"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].logs.maxDays),r||(a=X(l,"input",n[8]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].logs.maxDays&&$e(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function MT(n){let e,t,i,s,l,o,r,a,u,f,c,d;e=new Os({});const p=[wT,kT],g=[];function v(b,y){return b[1]?0:1}return a=v(n),u=g[a]=p[a](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Application</div></nav>`,l=T(),o=_("div"),r=_("form"),u.c(),h(s,"class","page-header"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(b,y){q(e,b,y),w(b,t,y),w(b,i,y),m(i,s),m(i,l),m(i,o),m(o,r),g[a].m(r,null),f=!0,c||(d=X(r,"submit",Wt(n[4])),c=!0)},p(b,[y]){let $=a;a=v(b),a===$?g[a].p(b,y):(Te(),L(g[$],1,1,()=>{g[$]=null}),De(),u=g[a],u?u.p(b,y):(u=g[a]=p[a](b),u.c()),A(u,1),u.m(r,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){L(e.$$.fragment,b),L(u),f=!1},d(b){V(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function TT(n,e,t){let i,s={},l=!1,o=!1,r="";U.setDocumentTitle("Application settings"),a();async function a(){t(1,l=!0);try{const v=await ke.Settings.getAll()||{};f(v)}catch(v){ke.errorResponseHandler(v)}t(1,l=!1)}async function u(){if(!(o||!i)){t(2,o=!0);try{const v=await ke.Settings.update(U.filterRedactedProps(s));f(v),dn("Successfully saved application settings.")}catch(v){ke.errorResponseHandler(v)}t(2,o=!1)}}function f(v={}){t(0,s={meta:(v==null?void 0:v.meta)||{},logs:(v==null?void 0:v.logs)||{}}),t(5,r=JSON.stringify(s))}function c(){s.meta.appName=this.value,t(0,s)}function d(){s.meta.appUrl=this.value,t(0,s)}function p(){s.logs.maxDays=Dt(this.value),t(0,s)}const g=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=r!=JSON.stringify(s))},[s,l,o,i,u,r,c,d,p,g]}class DT extends Ae{constructor(e){super(),Ee(this,e,TT,MT,Oe,{})}}function OT(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ht(l,s[o]);return{c(){e=_("input"),ii(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),$e(e,n[0]),t||(i=X(e,"input",n[8]),t=!0)},p(o,r){ii(e,l=hn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&$e(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function ET(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=ht(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=T(),s=_("input"),h(t,"type","button"),h(t,"class","btn btn-secondary btn-circle"),h(e,"class","form-field-addon"),ii(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[xe($t.call(null,t,{position:"left",text:"Set new value"})),X(t,"click",n[6])],l=!0)},p(u,f){ii(s,a=hn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,ot(o)}}}function AT(n){let e;function t(l,o){return l[3]?ET:OT}let i=t(n),s=i(n);return{c(){s.c(),e=lt()},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:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function PT(n,e,t){const i=["value","mask"];let s=Ut(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await _i(),r==null||r.focus()}const f=()=>u();function c(p){me[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=ht(ht({},e),si(p)),t(5,s=Ut(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Ba extends Ae{constructor(e){super(),Ee(this,e,PT,AT,Oe,{value:0,mask:1})}}function LT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S,C,M,D,P,O,F,E,N,Z,ne;i=new Fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[IT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[NT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[RT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),f=new Fe({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[HT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:{default:[jT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),$=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[qT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}});let te=n[0].smtp.enabled&&wp(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),z(f.$$.fragment),c=T(),z(d.$$.fragment),p=T(),g=_("hr"),v=T(),b=_("div"),b.innerHTML=`<p>By default PocketBase uses the OS <code>sendmail</code> command for sending emails.
|
||||
<br/>
|
||||
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||||
below.</strong></p>`,y=T(),z($.$$.fragment),S=T(),te&&te.c(),C=T(),M=_("div"),D=_("div"),P=T(),O=_("button"),F=_("span"),F.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid"),h(b,"class","content m-b-sm"),h(D,"class","flex-fill"),h(F,"class","txt"),h(O,"type","submit"),h(O,"class","btn btn-expanded"),O.disabled=E=!n[3]||n[2],Q(O,"btn-loading",n[2]),h(M,"class","flex")},m(H,W){w(H,e,W),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),q(f,e,null),m(e,c),q(d,e,null),w(H,p,W),w(H,g,W),w(H,v,W),w(H,b,W),w(H,y,W),q($,H,W),w(H,S,W),te&&te.m(H,W),w(H,C,W),w(H,M,W),m(M,D),m(M,P),m(M,O),m(O,F),N=!0,Z||(ne=X(O,"click",n[18]),Z=!0)},p(H,W){const Y={};W&12582913&&(Y.$$scope={dirty:W,ctx:H}),i.$set(Y);const K={};W&12582913&&(K.$$scope={dirty:W,ctx:H}),o.$set(K);const ee={};W&12582913&&(ee.$$scope={dirty:W,ctx:H}),a.$set(ee);const re={};W&12582913&&(re.$$scope={dirty:W,ctx:H}),f.$set(re);const be={};W&12582913&&(be.$$scope={dirty:W,ctx:H}),d.$set(be);const ae={};W&12582913&&(ae.$$scope={dirty:W,ctx:H}),$.$set(ae),H[0].smtp.enabled?te?(te.p(H,W),W&1&&A(te,1)):(te=wp(H),te.c(),A(te,1),te.m(C.parentNode,C)):te&&(Te(),L(te,1,1,()=>{te=null}),De()),(!N||W&12&&E!==(E=!H[3]||H[2]))&&(O.disabled=E),W&4&&Q(O,"btn-loading",H[2])},i(H){N||(A(i.$$.fragment,H),A(o.$$.fragment,H),A(a.$$.fragment,H),A(f.$$.fragment,H),A(d.$$.fragment,H),A($.$$.fragment,H),A(te),N=!0)},o(H){L(i.$$.fragment,H),L(o.$$.fragment,H),L(a.$$.fragment,H),L(f.$$.fragment,H),L(d.$$.fragment,H),L($.$$.fragment,H),L(te),N=!1},d(H){H&&k(e),V(i),V(o),V(a),V(f),V(d),H&&k(p),H&&k(g),H&&k(v),H&&k(b),H&&k(y),V($,H),H&&k(S),te&&te.d(H),H&&k(C),H&&k(M),Z=!1,ne()}}}function FT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function IT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Sender name"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.senderName),r||(a=X(l,"input",n[7]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&$e(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function NT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Sender address"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","email"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].meta.senderAddress),r||(a=X(l,"input",n[8]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&$e(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function RT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=j("User verification page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userVerificationUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[9]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userVerificationUrl&&$e(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function HT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=j("User reset password page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userResetPasswordUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[10]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&$e(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=j("User confirm email change page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
|
||||
parameters:
|
||||
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),$e(l,n[0].meta.userConfirmEmailChangeUrl),w(c,r,d),w(c,a,d),u||(f=X(l,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&$e(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function qT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=j("Use SMTP mail server"),h(e,"type","checkbox"),h(e,"id",t=n[22]),e.required=!0,h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[12]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function wp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S;return i=new Fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[VT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[zT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[BT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[UT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),v=new Fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[WT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),S=!0},p(C,M){const D={};M&12582913&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const P={};M&12582913&&(P.$$scope={dirty:M,ctx:C}),o.$set(P);const O={};M&12582913&&(O.$$scope={dirty:M,ctx:C}),u.$set(O);const F={};M&12582913&&(F.$$scope={dirty:M,ctx:C}),d.$set(F);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:C}),v.$set(E)},i(C){S||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(v.$$.fragment,C),C&&Tt(()=>{$||($=ct(e,Xt,{duration:150},!0)),$.run(1)}),S=!0)},o(C){L(i.$$.fragment,C),L(o.$$.fragment,C),L(u.$$.fragment,C),L(d.$$.fragment,C),L(v.$$.fragment,C),C&&($||($=ct(e,Xt,{duration:150},!1)),$.run(0)),S=!1},d(C){C&&k(e),V(i),V(o),V(u),V(d),V(v),C&&$&&$.end()}}}function VT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("SMTP server host"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.host),r||(a=X(l,"input",n[13]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.host&&$e(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function zT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Port"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","number"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.port),r||(a=X(l,"input",n[14]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].smtp.port&&$e(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function BT(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new ls({props:u}),me.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=j("TLS Encryption"),s=T(),z(l.$$.fragment),h(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4194304&&i!==(i=f[22]))&&h(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,Re(()=>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),f&&k(s),V(l,f)}}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Username"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].smtp.username),r||(a=X(l,"input",n[16]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.username&&$e(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function WT(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:Line truncated
|
||||
<div class="breadcrumb-item">Mail settings</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content txt-xl m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m($,S){q(e,$,S),w($,t,S),w($,i,S),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=X(r,"submit",Wt(n[19])),p=!0)},p($,[S]){let C=f;f=y($),f===C?b[f].p($,S):(Te(),L(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p($,S):(c=b[f]=v[f]($),c.c()),A(c,1),c.m(r,null))},i($){d||(A(e.$$.fragment,$),A(c),d=!0)},o($){L(e.$$.fragment,$),L(c),d=!1},d($){V(e,$),$&&k(t),$&&k(i),b[f].d(),p=!1,g()}}}function KT(n,e,t){let i;const s=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let l={},o=!1,r=!1,a="";U.setDocumentTitle("Mail settings"),u();async function u(){t(1,o=!0);try{const F=await ke.Settings.getAll()||{};c(F)}catch(F){ke.errorResponseHandler(F)}t(1,o=!1)}async function f(){if(!(r||!i)){t(2,r=!0);try{const F=await ke.Settings.update(U.filterRedactedProps(l));c(F),dn("Successfully saved mail settings.")}catch(F){ke.errorResponseHandler(F)}t(2,r=!1)}}function c(F={}){t(0,l={meta:(F==null?void 0:F.meta)||{},smtp:(F==null?void 0:F.smtp)||{}}),t(6,a=JSON.stringify(l))}function d(){l.meta.senderName=this.value,t(0,l)}function p(){l.meta.senderAddress=this.value,t(0,l)}function g(){l.meta.userVerificationUrl=this.value,t(0,l)}function v(){l.meta.userResetPasswordUrl=this.value,t(0,l)}function b(){l.meta.userConfirmEmailChangeUrl=this.value,t(0,l)}function y(){l.smtp.enabled=this.checked,t(0,l)}function $(){l.smtp.host=this.value,t(0,l)}function S(){l.smtp.port=Dt(this.value),t(0,l)}function C(F){n.$$.not_equal(l.smtp.tls,F)&&(l.smtp.tls=F,t(0,l))}function M(){l.smtp.username=this.value,t(0,l)}function D(F){n.$$.not_equal(l.smtp.password,F)&&(l.smtp.password=F,t(0,l))}const P=()=>f(),O=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,o,r,i,s,f,a,d,p,g,v,b,y,$,S,C,M,D,P,O]}class ZT extends Ae{constructor(e){super(),Ee(this,e,KT,YT,Oe,{})}}function JT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[XT,({uniqueId:b})=>({17:b}),({uniqueId:b})=>b?131072:0]},$$scope:{ctx:n}}});let g=n[3]!=n[0].enabled&&Sp(n),v=n[0].enabled&&$p(n);return{c(){z(e.$$.fragment),t=T(),g&&g.c(),i=T(),v&&v.c(),s=T(),l=_("div"),o=_("div"),r=T(),a=_("button"),u=_("span"),u.textContent="Save changes",h(o,"class","flex-fill"),h(u,"class","txt"),h(a,"type","submit"),h(a,"class","btn btn-expanded"),a.disabled=f=!n[4]||n[2],Q(a,"btn-loading",n[2]),h(l,"class","flex")},m(b,y){q(e,b,y),w(b,t,y),g&&g.m(b,y),w(b,i,y),v&&v.m(b,y),w(b,s,y),w(b,l,y),m(l,o),m(l,r),m(l,a),m(a,u),c=!0,d||(p=X(a,"click",n[13]),d=!0)},p(b,y){const $={};y&393217&&($.$$scope={dirty:y,ctx:b}),e.$set($),b[3]!=b[0].enabled?g?(g.p(b,y),y&9&&A(g,1)):(g=Sp(b),g.c(),A(g,1),g.m(i.parentNode,i)):g&&(Te(),L(g,1,1,()=>{g=null}),De()),b[0].enabled?v?(v.p(b,y),y&1&&A(v,1)):(v=$p(b),v.c(),A(v,1),v.m(s.parentNode,s)):v&&(Te(),L(v,1,1,()=>{v=null}),De()),(!c||y&20&&f!==(f=!b[4]||b[2]))&&(a.disabled=f),y&4&&Q(a,"btn-loading",b[2])},i(b){c||(A(e.$$.fragment,b),A(g),A(v),c=!0)},o(b){L(e.$$.fragment,b),L(g),L(v),c=!1},d(b){V(e,b),b&&k(t),g&&g.d(b),b&&k(i),v&&v.d(b),b&&k(s),b&&k(l),d=!1,p()}}}function GT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function XT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=j("Use S3 storage"),h(e,"type","checkbox"),h(e,"id",t=n[17]),e.required=!0,h(s,"for",o=n[17])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[7]),r=!0)},p(u,f){f&131072&&t!==(t=u[17])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&131072&&o!==(o=u[17])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Sp(n){let e,t,i,s,l,o,r,a=n[3]?"S3 storage":"local file system",u,f,c,d=n[0].enabled?"S3 storage":"local file system",p,g,v,b,y,$,S,C,M,D,P,O;return{c(){e=_("div"),t=_("div"),i=_("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=T(),l=_("div"),o=j(`If you have existing uploaded files, you'll have to migrate them manually from
|
||||
the
|
||||
`),r=_("strong"),u=j(a),f=j(`
|
||||
to the
|
||||
`),c=_("strong"),p=j(d),g=j(`.
|
||||
`),v=_("br"),b=j(`
|
||||
There are numerous command line tools that can help you, such as:
|
||||
`),y=_("a"),y.textContent=`rclone
|
||||
`,$=j(`,
|
||||
`),S=_("a"),S.textContent=`s5cmd
|
||||
`,C=j(", etc."),M=T(),D=_("div"),h(i,"class","icon"),h(y,"href","https://github.com/rclone/rclone"),h(y,"target","_blank"),h(y,"rel","noopener"),h(y,"class","txt-bold"),h(S,"href","https://github.com/peak/s5cmd"),h(S,"target","_blank"),h(S,"rel","noopener"),h(S,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(D,"class","clearfix m-t-base")},m(F,E){w(F,e,E),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,p),m(l,g),m(l,v),m(l,b),m(l,y),m(l,$),m(l,S),m(l,C),m(e,M),m(e,D),O=!0},p(F,E){(!O||E&8)&&a!==(a=F[3]?"S3 storage":"local file system")&&_e(u,a),(!O||E&1)&&d!==(d=F[0].enabled?"S3 storage":"local file system")&&_e(p,d)},i(F){O||(Tt(()=>{P||(P=ct(e,Xt,{duration:150},!0)),P.run(1)}),O=!0)},o(F){P||(P=ct(e,Xt,{duration:150},!1)),P.run(0),O=!1},d(F){F&&k(e),F&&P&&P.end()}}}function $p(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,$,S;return i=new Fe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[QT,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[xT,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[eD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[tD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),v=new Fe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[nD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-12"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),S=!0},p(C,M){const D={};M&393217&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const P={};M&393217&&(P.$$scope={dirty:M,ctx:C}),o.$set(P);const O={};M&393217&&(O.$$scope={dirty:M,ctx:C}),u.$set(O);const F={};M&393217&&(F.$$scope={dirty:M,ctx:C}),d.$set(F);const E={};M&393217&&(E.$$scope={dirty:M,ctx:C}),v.$set(E)},i(C){S||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(v.$$.fragment,C),C&&Tt(()=>{$||($=ct(e,Xt,{duration:150},!0)),$.run(1)}),S=!0)},o(C){L(i.$$.fragment,C),L(o.$$.fragment,C),L(u.$$.fragment,C),L(d.$$.fragment,C),L(v.$$.fragment,C),C&&($||($=ct(e,Xt,{duration:150},!1)),$.run(0)),S=!1},d(C){C&&k(e),V(i),V(o),V(u),V(d),V(v),C&&$&&$.end()}}}function QT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Endpoint"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].endpoint),r||(a=X(l,"input",n[8]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].endpoint&&$e(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function xT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Bucket"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].bucket),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].bucket&&$e(l,u[0].bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function eD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Region"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].region),r||(a=X(l,"input",n[10]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].region&&$e(l,u[0].region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function tD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Access key"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].accessKey),r||(a=X(l,"input",n[11]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].accessKey&&$e(l,u[0].accessKey)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nD(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[17],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new Ba({props:u}),me.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=j("Secret"),s=T(),z(l.$$.fragment),h(e,"for",i=n[17])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&131072&&i!==(i=f[17]))&&h(e,"for",i);const d={};c&13
Line truncated
|
||||
<div class="breadcrumb-item">Files storage</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
|
||||
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content txt-xl m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m($,S){q(e,$,S),w($,t,S),w($,i,S),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=X(r,"submit",Wt(n[14])),p=!0)},p($,[S]){let C=f;f=y($),f===C?b[f].p($,S):(Te(),L(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p($,S):(c=b[f]=v[f]($),c.c()),A(c,1),c.m(r,null))},i($){d||(A(e.$$.fragment,$),A(c),d=!0)},o($){L(e.$$.fragment,$),L(c),d=!1},d($){V(e,$),$&&k(t),$&&k(i),b[f].d(),p=!1,g()}}}function sD(n,e,t){let i,s={},l=!1,o=!1,r="",a=!1;U.setDocumentTitle("Files storage"),u();async function u(){t(1,l=!0);try{const C=await ke.Settings.getAll()||{};c(C)}catch(C){ke.errorResponseHandler(C)}t(1,l=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const C=await ke.Settings.update(U.filterRedactedProps({s3:s}));c(C),Li({}),dn("Successfully saved Files storage settings.")}catch(C){ke.errorResponseHandler(C)}t(2,o=!1)}}function c(C={}){t(0,s=(C==null?void 0:C.s3)||{}),t(3,a=s.enabled),t(6,r=JSON.stringify(s))}function d(){s.enabled=this.checked,t(0,s)}function p(){s.endpoint=this.value,t(0,s)}function g(){s.bucket=this.value,t(0,s)}function v(){s.region=this.value,t(0,s)}function b(){s.accessKey=this.value,t(0,s)}function y(C){n.$$.not_equal(s.secret,C)&&(s.secret=C,t(0,s))}const $=()=>f(),S=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=r!=JSON.stringify(s))},[s,l,o,a,i,f,r,d,p,g,v,b,y,$,S]}class lD extends Ae{constructor(e){super(),Ee(this,e,sD,iD,Oe,{})}}function oD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=j("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[16]),h(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Cp(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Fe({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[rD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field "+(U.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[aD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field "+(U.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[uD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-12 m-t-sm"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(e,"class","grid")},m(d,p){w(d,e,p),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),c=!0},p(d,p){const g={};p&196609&&(g.$$scope={dirty:p,ctx:d}),i.$set(g);const v={};p&1&&(v.class="form-field "+(U.isEmpty(d[0].onlyDomains)?"":"disabled")),p&196609&&(v.$$scope={dirty:p,ctx:d}),o.$set(v);const b={};p&1&&(b.class="form-field "+(U.isEmpty(d[0].exceptDomains)?"":"disabled")),p&196609&&(b.$$scope={dirty:p,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=ct(e,Xt,{duration:150},!0)),f.run(1)}),c=!0)},o(d){L(i.$$.fragment,d),L(o.$$.fragment,d),L(u.$$.fragment,d),d&&(f||(f=ct(e,Xt,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),V(i),V(o),V(u),d&&f&&f.end()}}}function rD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Minimum password length"),s=T(),l=_("input"),h(e,"for",i=n[16]),h(l,"type","number"),h(l,"id",o=n[16]),l.required=!0,h(l,"min","5"),h(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].minPasswordLength),r||(a=X(l,"input",n[9]),r=!0)},p(u,f){f&65536&&i!==(i=u[16])&&h(e,"for",i),f&65536&&o!==(o=u[16])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].minPasswordLength&&$e(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[10](b)}let v={id:n[16],disabled:!U.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new os({props:v}),me.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=xe($t.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(b,y){(!c||y&65536&&l!==(l=b[16]))&&h(e,"for",l);const $={};y&65536&&($.id=b[16]),y&1&&($.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,Re(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function uD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new os({props:v}),me.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]+".config.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=xe($t.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(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&h(e,"for",l);const $={};y&65536&&($.id=b[16]+".config.onlyDomains"),y&1&&($.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,Re(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){L(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function fD(n){let e,t,i,s;e=new Fe({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[oD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Cp(n);return{c(){z(e.$$.fragment),t=T(),l&&l.c(),i=lt()},m(o,r){q(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Cp(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Te(),L(l,1,1,()=>{l=null}),De())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function cD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dD(n){let e;return{c(){e=_("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mp(n){let e,t,i,s,l,o;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=xe(t=$t.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(r){s||(Tt(()=>{i||(i=ct(e,qn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){i||(i=ct(e,qn,{duration:150,start:.7},!1)),i.run(0),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function hD(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].enabled?dD:cD}let u=a(n),f=u(n),c=n[2]&&Mp();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
|
||||
<span class="txt">Email/Password</span>`,t=T(),f.c(),i=T(),s=_("div"),l=T(),c&&c.c(),o=lt(),h(e,"class","inline-flex"),h(s,"class","flex-fill")},m(d,p){w(d,e,p),w(d,t,p),f.m(d,p),w(d,i,p),w(d,s,p),w(d,l,p),c&&c.m(d,p),w(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?p&4&&A(c,1):(c=Mp(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Te(),L(c,1,1,()=>{c=null}),De())},i(d){r||(A(c),r=!0)},o(d){L(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function pD(n){let e,t;const i=[n[3]];let s={$$slots:{header:[hD],default:[fD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ht(s,i[l]);return e=new qa({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){z(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&8?hn(i,[li(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function mD(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Ut(e,s),o;cn(n,ns,C=>t(7,o=C));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function p(){r.minPasswordLength=Dt(this.value),t(0,r)}function g(C){n.$$.not_equal(r.exceptDomains,C)&&(r.exceptDomains=C,t(0,r))}function v(C){n.$$.not_equal(r.onlyDomains,C)&&(r.onlyDomains=C,t(0,r))}function b(C){me[C?"unshift":"push"](()=>{a=C,t(1,a)})}function y(C){dt.call(this,n,C)}function $(C){dt.call(this,n,C)}function S(C){dt.call(this,n,C)}return n.$$set=C=>{e=ht(ht({},e),si(C)),t(3,l=Ut(e,s)),"config"in C&&t(0,r=C.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!U.isEmpty(o==null?void 0:o.emailPassword))},[r,a,i,l,u,f,c,o,d,p,g,v,b,y,$,S]}class gD extends Ae{constructor(e){super(),Ee(this,e,mD,pD,Oe,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function _D(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=j("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[22]),h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=X(e,"change",n[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Tp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;l=new Fe({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[bD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[vD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Fe({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[yD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Dp(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),z(l.$$.fragment),o=T(),r=_("div"),z(a.$$.fragment),u=T(),f=_("div"),z(c.$$.fragment),d=T(),v&&v.c(),h(t,"class","col-12 spacing"),h(s,"class","col-lg-6"),h(r,"class","col-lg-6"),h(f,"class","col-lg-12"),h(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),q(l,s,null),m(e,o),m(e,r),q(a,r,null),m(e,u),m(e,f),q(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const $={};y&2&&($.name=b[1]+".clientId"),y&12582913&&($.$$scope={dirty:y,ctx:b}),l.$set($);const S={};y&2&&(S.name=b[1]+".clientSecret"),y&12582913&&(S.$$scope={dirty:y,ctx:b}),a.$set(S);const C={};y&2&&(C.name=b[1]+".allowRegistrations"),y&12582913&&(C.$$scope={dirty:y,ctx:b}),c.$set(C),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=Dp(b),v.c(),A(v,1),v.m(e,null)):v&&(Te(),L(v,1,1,()=>{v=null}),De())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{p||(p=ct(e,Xt,{duration:200},!0)),p.run(1)}),g=!0)},o(b){L(l.$$.fragment,b),L(a.$$.fragment,b),L(c.$$.fragment,b),L(v),b&&(p||(p=ct(e,Xt,{duration:200},!1)),p.run(0)),g=!1},d(b){b&&k(e),V(l),V(a),V(c),v&&v.d(),b&&p&&p.end()}}}function bD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=j("Client ID"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),$e(l,n[0].clientId),r||(a=X(l,"input",n[12]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].clientId&&$e(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function vD(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[22],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new Ba({props:u}),me.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=j("Client Secret"),s=T(),z(l.$$.fragment),h(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4194304&&i!==(i=f[22]))&&h(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!o&&c&Line truncated
|
||||
<div class="breadcrumb-item">Auth providers</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m($,S){q(e,$,S),w($,t,S),w($,i,S),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=X(r,"submit",Wt(n[5])),p=!0)},p($,[S]){let C=f;f=y($),f===C?b[f].p($,S):(Te(),L(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p($,S):(c=b[f]=v[f]($),c.c()),A(c,1),c.m(r,null))},i($){d||(A(e.$$.fragment,$),A(c),d=!0)},o($){L(e.$$.fragment,$),L(c),d=!1},d($){V(e,$),$&&k(t),$&&k(i),b[f].d(),p=!1,g()}}}function LD(n,e,t){let i,s,l={},o=!1,r=!1,a="";U.setDocumentTitle("Auth providers"),u();async function u(){t(2,o=!0);try{const S=await ke.Settings.getAll()||{};c(S)}catch(S){ke.errorResponseHandler(S)}t(2,o=!1)}async function f(){if(!(r||!i)){t(3,r=!0);try{const S=await ke.Settings.update(U.filterRedactedProps(l));c(S),Li({}),s==null||s.collapseSiblings(),dn("Successfully updated auth providers.")}catch(S){ke.errorResponseHandler(S)}t(3,r=!1)}}function c(S){S=S||{},t(0,l={}),t(0,l.emailAuth=Object.assign({enabled:!0},S.emailAuth),l);const C=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of C)t(0,l[M]=Object.assign({enabled:!1,allowRegistrations:!0},S[M]),l);t(6,a=JSON.stringify(l))}function d(S){me[S?"unshift":"push"](()=>{s=S,t(1,s)})}function p(S){n.$$.not_equal(l.emailAuth,S)&&(l.emailAuth=S,t(0,l))}function g(S){n.$$.not_equal(l.googleAuth,S)&&(l.googleAuth=S,t(0,l))}function v(S){n.$$.not_equal(l.facebookAuth,S)&&(l.facebookAuth=S,t(0,l))}function b(S){n.$$.not_equal(l.githubAuth,S)&&(l.githubAuth=S,t(0,l))}function y(S){n.$$.not_equal(l.gitlabAuth,S)&&(l.gitlabAuth=S,t(0,l))}const $=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(l))},[l,s,o,r,i,f,a,d,p,g,v,b,y,$]}class FD extends Ae{constructor(e){super(),Ee(this,e,LD,PD,Oe,{})}}function Ap(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function ID(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,p=n[4];const g=v=>v[12].key;for(let v=0;v<p.length;v+=1){let b=Ap(n,p,v),y=g(b);t.set(y,e[v]=Pp(y,b))}return{c(){for(let v=0;v<e.length;v+=1)e[v].c();i=T(),s=_("div"),l=_("div"),o=T(),r=_("button"),a=_("span"),a.textContent="Save changes",h(l,"class","flex-fill"),h(a,"class","txt"),h(r,"type","submit"),h(r,"class","btn btn-expanded"),r.disabled=u=!n[3]||n[2],Q(r,"btn-loading",n[2]),h(s,"class","flex")},m(v,b){for(let y=0;y<e.length;y+=1)e[y].m(v,b);w(v,i,b),w(v,s,b),m(s,l),m(s,o),m(s,r),m(r,a),f=!0,c||(d=X(r,"click",n[9]),c=!0)},p(v,b){b&32785&&(p=v[4],Te(),e=ut(e,b,g,1,v,p,t,i.parentNode,Ft,Pp,i,Ap),De()),(!f||b&12&&u!==(u=!v[3]||v[2]))&&(r.disabled=u),b&4&&Q(r,"btn-loading",v[2])},i(v){if(!f){for(let b=0;b<p.length;b+=1)A(e[b]);f=!0}},o(v){for(let b=0;b<e.length;b+=1)L(e[b]);f=!1},d(v){for(let b=0;b<e.length;b+=1)e[b].d(v);v&&k(i),v&&k(s),c=!1,d()}}}function ND(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function RD(n){let e,t=n[12].label+"",i,s,l,o,r,a,u,f,c,d,p;function g(){n[7].call(r,n[12])}function v(){return n[8](n[12])}return{c(){e=_("label"),i=j(t),s=j(" duration (in seconds)"),o=T(),r=_("input"),u=T(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",h(e,"for",l=n[15]),h(r,"type","number"),h(r,"id",a=n[15]),r.required=!0,h(c,"class","link-primary"),Q(c,"txt-success",n[0][n[12].key].secret),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,i),m(e,s),w(b,o,y),w(b,r,y),$e(r,n[0][n[12].key].duration),w(b,u,y),w(b,f,y),m(f,c),d||(p=[X(r,"input",g),X(c,"click",v)],d=!0)},p(b,y){n=b,y&32768&&l!==(l=n[15])&&h(e,"for",l),y&32768&&a!==(a=n[15])&&h(r,"id",a),y&17&&Dt(r.value)!==n[0][n[12].key].duration&&$e(r,n[0][n[12].key].duration),y&17&&Q(c,"txt-success",n[0][n[12].key].secret)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(u),b&&k(f),d=!1,ot(p)}}}function Pp(n,e){let t,i,s;return i=new Fe({props:{class:"form-field required",name:e[12].key+".duration",$$slots:{default:[RD,({uniqueId:l})=>({15:l}),({uniqueId:l})=>l?32768:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=lt(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&98305&&(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 HD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;e=new Os({});const v=[ND,ID],b=[];function y($,S){return $[1]?0:1}return f=y(n),c=b[f]=v[f](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||||
<div class="breadcrumb-item">Token options</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML="<p>Adjust common token options.</p>",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content m-b-sm txt-xl"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m($,S){q(e,$,S),w($,t,S),w($,i,S),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=X(r,"submit",Wt(n[5])),p=!0)},p($,[S]){let C=f;f=y($),f===C?b[f].p($,S):(Te(),L(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p($,S):(c=b[f]=v[f]($),c.c()),A(c,1),c.m(r,null))},i($){d||(A(e.$$.fragment,$),A(c),d=!0)},o($){L(e.$$.fragment,$),L(c),d=!1},d($){V(e,$),$&&k(t),$&&k(i),b[f].d(),p=!1,g()}}}function jD(n,e,t){let i;const s=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];let l={},o=!1,r=!1,a="";U.setDocumentTitle("Token options"),u();async function u(){t(1,o=!0);try{const v=await ke.Settings.getAll()||{};c(v)}catch(v){ke.errorResponseHandler(v)}t(1,o=!1)}async function f(){if(!(r||!i)){t(2,r=!0);try{const v=await ke.Settings.update(U.filterRedactedProps(l));c(v),dn("Successfully saved tokens options.")}catch(v){ke.errorResponseHandler(v)}t(2,r=!1)}}function c(v){var b;v=v||{},t(0,l={});for(const y of s)t(0,l[y.key]={duration:((b=v[y.key])==null?void 0:b.duration)||0},l);t(6,a=JSON.stringify(l))}function d(v){l[v.key].duration=Dt(this.value),t(0,l)}const p=v=>{l[v.key].secret?(delete l[v.key].secret,t(0,l)):t(0,l[v.key].secret=U.randomString(50),l)},g=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,o,r,i,s,f,a,d,p,g]}class qD extends Ae{constructor(e){super(),Ee(this,e,jD,HD,Oe,{})}}const un=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?$s("/"):!0}],VD={"/login":tn({component:yT,conditions:un.concat([n=>!ke.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":tn({asyncComponent:()=>Ki(()=>import("./PageAdminRequestPasswordReset.ab512dd9.js"),[]),conditions:un.concat([n=>!ke.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":tn({asyncComponent:()=>Ki(()=>import("./PageAdminConfirmPasswordReset.7911c400.js"),[]),conditions:un.concat([n=>!ke.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":tn({component:wM,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":tn({component:Lw,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users":tn({component:YM,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmPasswordReset.881a7415.js"),[]),conditions:un.concat([()=>(ke.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmVerification.da6bfb73.js"),[]),conditions:un.concat([()=>(ke.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmEmailChange.c607a941.js"),[]),conditions:un.concat([()=>(ke.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/settings":tn({component:DT,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":tn({component:pT,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":tn({component:ZT,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":tn({component:lD,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":tn({component:FD,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":tn({component:qD,conditions:un.concat([n=>ke.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"*":tn({component:rb,userData:{showAppSidebar:!1}})};function zD(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=p=>Math.sqrt(p)*120,easing:d=Ro}=i;return{delay:f,duration:En(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(p,g)=>{const v=g*a,b=g*u,y=p+g*e.width/t.width,$=p+g*e.height/t.height;return`transform: ${l} translate(${v}px, ${b}px) scale(${y}, ${$});`}}}function Lp(n,e,t){const i=n.slice();return i[2]=e[t],i}function BD(n){let e;return{c(){e=_("i"),h(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function UD(n){let e;return{c(){e=_("i"),h(e,"class","ri-chLine truncated
|
||||
<span class="txt">Manage admins</span>`,t=T(),i=_("hr"),s=T(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
|
||||
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"tabindex","0"),h(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=[xe(wn.call(null,e)),X(l,"click",n[4])],o=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,ot(r)}}}function tO(n){var c;let e,t,i,s,l,o,r,a,u,f=((c=n[1])==null?void 0:c.id)&&n[0]&&Ip(n);return s=new F_({props:{routes:VD}}),s.$on("routeLoading",n[2]),s.$on("conditionsFailed",n[3]),o=new ZD({}),a=new xD({}),{c(){e=_("div"),f&&f.c(),t=T(),i=_("div"),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment),h(i,"class","app-body"),h(e,"class","app-layout")},m(d,p){w(d,e,p),f&&f.m(e,null),m(e,t),m(e,i),q(s,i,null),w(d,l,p),q(o,d,p),w(d,r,p),q(a,d,p),u=!0},p(d,[p]){var g;((g=d[1])==null?void 0:g.id)&&d[0]?f?(f.p(d,p),p&3&&A(f,1)):(f=Ip(d),f.c(),A(f,1),f.m(e,t)):f&&(Te(),L(f,1,1,()=>{f=null}),De())},i(d){u||(A(f),A(s.$$.fragment,d),A(o.$$.fragment,d),A(a.$$.fragment,d),u=!0)},o(d){L(f),L(s.$$.fragment,d),L(o.$$.fragment,d),L(a.$$.fragment,d),u=!1},d(d){d&&k(e),f&&f.d(),V(s),d&&k(l),V(o,d),d&&k(r),V(a,d)}}}function nO(n,e,t){let i;cn(n,ga,u=>t(1,i=u));let s,l=!1;function o(u){var f,c,d,p;((f=u==null?void 0:u.detail)==null?void 0:f.location)!==s&&(t(0,l=!!((d=(c=u==null?void 0:u.detail)==null?void 0:c.userData)!=null&&d.showAppSidebar)),s=(p=u==null?void 0:u.detail)==null?void 0:p.location,U.setDocumentTitle(""),Li({}),o_())}function r(){$s("/")}function a(){ke.logout()}return[l,i,o,r,a]}class iO extends Ae{constructor(e){super(),Ee(this,e,nO,tO,Oe,{})}}new iO({target:document.getElementById("app")});export{ot as A,dn as B,U as C,$s as D,lt as E,rg as F,cn as G,Ss as H,rn as I,On as J,Bn as K,me as L,Ae as S,L as a,T as b,z as c,V as d,_ as e,h as f,w as g,m as h,Ee as i,xe as j,Te as k,wn as l,q as m,De as n,k as o,ke as p,Fe as q,Q as r,Oe as s,A as t,X as u,Wt as v,j as w,_e as x,oe as y,$e as z};
|
||||
@@ -1 +1 @@
|
||||
@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@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"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@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"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #adb3b8;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #edf0f3;--baseAlt2Color: #dee3e8;--baseAlt3Color: #a9b4bc;--baseAlt4Color: #7c868d;--infoColor: #3da9fc;--infoAltColor: #d8eefe;--successColor: #2cb67d;--successAltColor: #daf6ea;--dangerColor: #ef4565;--dangerAltColor: #fcdee4;--warningColor: #ff8e3c;--warningAltColor: #ffe7d6;--overlayColor: rgba(88, 95, 101, .3);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .05);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 24px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--baseRadius: 3px;--lgRadius: 12px;--btnRadius: 3px;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:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03"}.ri-4k-line:before{content:"\ea04"}.ri-a-b:befoLine truncated
|
||||
@font-face{font-family:remixicon;src:url(../fonts/remixicon/remixicon.woff2?v=1) format("woff2"),url(../fonts/remixicon/remixicon.woff?v=1) format("woff"),url(../fonts/remixicon/remixicon.ttf?v=1) format("truetype"),url(../fonts/remixicon/remixicon.svg?v=1#remixicon) format("svg");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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-regular.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-italic.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-600italic.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700.woff) format("woff")}@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"),url(../fonts/source-sans-pro/source-sans-pro-v18-latin_cyrillic-700italic.woff) format("woff")}@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"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-regular.woff) format("woff")}@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"),url(../fonts/jetbrains-mono/jetbrains-mono-v12-latin-600.woff) format("woff")}:root{--baseFontFamily: "Source Sans Pro", sans-serif, emoji;--monospaceFontFamily: "Ubuntu Mono", monospace, emoji;--iconFontFamily: "remixicon";--txtPrimaryColor: #16161a;--txtHintColor: #666f75;--txtDisabledColor: #adb3b8;--primaryColor: #16161a;--bodyColor: #f8f9fa;--baseColor: #ffffff;--baseAlt1Color: #edf0f3;--baseAlt2Color: #dee3e8;--baseAlt3Color: #a9b4bc;--baseAlt4Color: #7c868d;--infoColor: #3da9fc;--infoAltColor: #d8eefe;--successColor: #2cb67d;--successAltColor: #daf6ea;--dangerColor: #ef4565;--dangerAltColor: #fcdee4;--warningColor: #ff8e3c;--warningAltColor: #ffe7d6;--overlayColor: rgba(88, 95, 101, .3);--tooltipColor: rgba(0, 0, 0, .85);--shadowColor: rgba(0, 0, 0, .05);--baseFontSize: 14.5px;--xsFontSize: 12px;--smFontSize: 13px;--lgFontSize: 15px;--xlFontSize: 16px;--baseLineHeight: 22px;--smLineHeight: 16px;--lgLineHeight: 24px;--inputHeight: 34px;--btnHeight: 40px;--xsBtnHeight: 24px;--smBtnHeight: 30px;--lgBtnHeight: 54px;--baseSpacing: 30px;--xsSpacing: 15px;--smSpacing: 20px;--lgSpacing: 50px;--xlSpacing: 60px;--wrapperWidth: 850px;--smWrapperWidth: 420px;--lgWrapperWidth: 1200px;--appSidebarWidth: 75px;--pageSidebarWidth: 220px;--baseAnimationSpeed: .15s;--activeAnimationSpeed: 70ms;--baseRadius: 3px;--lgRadius: 12px;--btnRadius: 3px;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:"\ea01"}.ri-24-hours-line:before{content:"\ea02"}.ri-4k-fill:before{content:"\ea03"}.ri-4k-line:before{content:"\ea04"}.ri-a-b:befoLine truncated
|
||||
Vendored
+2
-2
@@ -20,8 +20,8 @@
|
||||
window.Prism = window.Prism || {};
|
||||
window.Prism.manual = true;
|
||||
</script>
|
||||
<script type="module" crossorigin src="/_/assets/index.c9783c65.js"></script>
|
||||
<link rel="stylesheet" href="/_/assets/index.d97a62dd.css">
|
||||
<script type="module" crossorigin src="/_/assets/index.cb8e511c.js"></script>
|
||||
<link rel="stylesheet" href="/_/assets/index.d4a95b8f.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Generated
+213
-391
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -19,16 +19,16 @@
|
||||
"@codemirror/search": "^6.0.0",
|
||||
"@codemirror/state": "^6.0.0",
|
||||
"@codemirror/view": "^6.0.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
|
||||
"@sveltejs/vite-plugin-svelte": "^1.0.1",
|
||||
"chart.js": "^3.7.1",
|
||||
"chartjs-adapter-luxon": "^1.1.0",
|
||||
"luxon": "^2.3.2",
|
||||
"pocketbase": "^0.1.2",
|
||||
"pocketbase": "^0.2.1",
|
||||
"prismjs": "^1.28.0",
|
||||
"sass": "^1.45.0",
|
||||
"svelte": "^3.44.0",
|
||||
"svelte-flatpickr": "^3.2.6",
|
||||
"svelte-spa-router": "^3.2.0",
|
||||
"vite": "^2.7.0"
|
||||
"vite": "^3.0.0"
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import { admin as loggedAdmin } from "@/stores/admin";
|
||||
import Searchbar from "@/components/base/Searchbar.svelte";
|
||||
import RefreshButton from "@/components/base/RefreshButton.svelte";
|
||||
import SortHeader from "@/components/base/SortHeader.svelte";
|
||||
import IdLabel from "@/components/base/IdLabel.svelte";
|
||||
import FormattedDate from "@/components/base/FormattedDate.svelte";
|
||||
@@ -31,6 +32,7 @@
|
||||
|
||||
export function loadAdmins() {
|
||||
isLoading = true;
|
||||
|
||||
admins = []; // reset
|
||||
|
||||
return ApiClient.Admins.getFullList(100, {
|
||||
@@ -42,7 +44,7 @@
|
||||
isLoading = false;
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err !== null) {
|
||||
if (!err?.isAbort) {
|
||||
isLoading = false;
|
||||
console.warn(err);
|
||||
clearList();
|
||||
@@ -65,6 +67,8 @@
|
||||
<div class="breadcrumb-item">Admins</div>
|
||||
</nav>
|
||||
|
||||
<RefreshButton on:refresh={() => loadAdmins()} />
|
||||
|
||||
<div class="flex-fill" />
|
||||
|
||||
<button type="button" class="btn btn-expanded" on:click={() => adminUpsertPanel?.show()}>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<script>
|
||||
import { onMount } from "svelte";
|
||||
|
||||
export let value = "";
|
||||
export let maxHeight = 200;
|
||||
|
||||
let inputElem;
|
||||
let updateTimeoutId;
|
||||
|
||||
$: if (inputElem && typeof value !== undefined) {
|
||||
$: if (typeof value !== undefined) {
|
||||
updateInputHeight();
|
||||
}
|
||||
|
||||
@@ -32,6 +34,12 @@
|
||||
form?.requestSubmit && form.requestSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
updateInputHeight();
|
||||
|
||||
return () => clearTimeout(updateTimeoutId);
|
||||
});
|
||||
</script>
|
||||
|
||||
<textarea bind:this={inputElem} bind:value on:keydown={handleKeydown} {...$$restProps} />
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<script>
|
||||
import { createEventDispatcher, onMount } from "svelte";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
let tooltipData = { text: "Refresh", position: "right" };
|
||||
export { tooltipData as tooltip };
|
||||
|
||||
let refreshTimeoutId = null;
|
||||
|
||||
function refresh() {
|
||||
dispatch("refresh");
|
||||
|
||||
// clear tooltip
|
||||
const oldTooltipData = tooltipData;
|
||||
tooltipData = null;
|
||||
|
||||
clearTimeout(refreshTimeoutId);
|
||||
refreshTimeoutId = setTimeout(() => {
|
||||
refreshTimeoutId = null;
|
||||
tooltipData = oldTooltipData;
|
||||
}, 200);
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
return () => clearTimeout(refreshTimeoutId);
|
||||
});
|
||||
</script>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-secondary btn-circle"
|
||||
class:refreshing={refreshTimeoutId}
|
||||
use:tooltip={tooltipData}
|
||||
on:click={refresh}
|
||||
>
|
||||
<i class="ri-refresh-line" />
|
||||
</button>
|
||||
|
||||
<style>
|
||||
@keyframes refresh {
|
||||
100% {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
.btn.refreshing i:before {
|
||||
animation: refresh 200ms linear;
|
||||
}
|
||||
</style>
|
||||
@@ -146,7 +146,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Param</th>
|
||||
<th width="60%">Type</th>
|
||||
<th>Type</th>
|
||||
<th width="50%">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<script>
|
||||
import { Request } from "pocketbase";
|
||||
import { LogRequest } from "pocketbase";
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import CodeBlock from "@/components/base/CodeBlock.svelte";
|
||||
import FormattedDate from "@/components/base/FormattedDate.svelte";
|
||||
import OverlayPanel from "@/components/base/OverlayPanel.svelte";
|
||||
|
||||
let logPanel;
|
||||
let item = new Request();
|
||||
let item = new LogRequest();
|
||||
|
||||
export function show(model) {
|
||||
item = model;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err !== null) {
|
||||
if (!err?.isAbort) {
|
||||
resetData();
|
||||
console.warn(err);
|
||||
ApiClient.errorResponseHandler(err, false);
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
dispatch("load", items);
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err !== null) {
|
||||
if (!err?.isAbort) {
|
||||
isLoading = false;
|
||||
console.warn(err);
|
||||
clearList();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<script>
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import Field from "@/components/base/Field.svelte";
|
||||
import Searchbar from "@/components/base/Searchbar.svelte";
|
||||
import RefreshButton from "@/components/base/RefreshButton.svelte";
|
||||
import LogsList from "@/components/logs/LogsList.svelte";
|
||||
import LogsChart from "@/components/logs/LogsChart.svelte";
|
||||
import LogViewPanel from "@/components/logs/LogViewPanel.svelte";
|
||||
@@ -34,14 +34,7 @@
|
||||
<div class="breadcrumb-item">Request logs</div>
|
||||
</nav>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-circle btn-secondary"
|
||||
use:tooltip={{ text: "Refresh", position: "right" }}
|
||||
on:click={refresh}
|
||||
>
|
||||
<i class="ri-refresh-line" />
|
||||
</button>
|
||||
<RefreshButton on:refresh={() => refresh()} />
|
||||
|
||||
<div class="flex-fill" />
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import Searchbar from "@/components/base/Searchbar.svelte";
|
||||
import RefreshButton from "@/components/base/RefreshButton.svelte";
|
||||
import CollectionsSidebar from "@/components/collections/CollectionsSidebar.svelte";
|
||||
import CollectionUpsertPanel from "@/components/collections/CollectionUpsertPanel.svelte";
|
||||
import CollectionDocsPanel from "@/components/collections/docs/CollectionDocsPanel.svelte";
|
||||
@@ -86,6 +87,8 @@
|
||||
<i class="ri-settings-4-line" />
|
||||
</button>
|
||||
|
||||
<RefreshButton on:refresh={() => recordsList?.load()} />
|
||||
|
||||
<div class="btns-group">
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -43,15 +43,15 @@
|
||||
|
||||
isLoading = true;
|
||||
|
||||
if (page <= 1) {
|
||||
clearList();
|
||||
}
|
||||
|
||||
return ApiClient.Records.getList(collection.id, page, 50, {
|
||||
sort: sort,
|
||||
filter: filter,
|
||||
})
|
||||
.then((result) => {
|
||||
if (page <= 1) {
|
||||
clearList();
|
||||
}
|
||||
|
||||
isLoading = false;
|
||||
records = records.concat(result.items);
|
||||
currentPage = result.page;
|
||||
@@ -60,7 +60,7 @@
|
||||
dispatch("load", records);
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err !== null) {
|
||||
if (!err?.isAbort) {
|
||||
isLoading = false;
|
||||
console.warn(err);
|
||||
clearList();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import CommonHelper from "@/utils/CommonHelper";
|
||||
import tooltip from "@/actions/tooltip";
|
||||
import Searchbar from "@/components/base/Searchbar.svelte";
|
||||
import RefreshButton from "@/components/base/RefreshButton.svelte";
|
||||
import SortHeader from "@/components/base/SortHeader.svelte";
|
||||
import IdLabel from "@/components/base/IdLabel.svelte";
|
||||
import FormattedDate from "@/components/base/FormattedDate.svelte";
|
||||
@@ -50,22 +51,22 @@
|
||||
export async function loadUsers(page = 1) {
|
||||
isLoadingUsers = true;
|
||||
|
||||
if (page <= 1) {
|
||||
clearList();
|
||||
}
|
||||
|
||||
return ApiClient.Users.getList(page, 50, {
|
||||
sort: sort || "-created",
|
||||
filter: filter,
|
||||
})
|
||||
.then((result) => {
|
||||
if (page <= 1) {
|
||||
clearList();
|
||||
}
|
||||
|
||||
isLoadingUsers = false;
|
||||
users = users.concat(result.items);
|
||||
currentPage = result.page;
|
||||
totalItems = result.totalItems;
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err !== null) {
|
||||
if (!err?.isAbort) {
|
||||
isLoadingUsers = false;
|
||||
console.warn(err);
|
||||
clearList();
|
||||
@@ -122,6 +123,8 @@
|
||||
<i class="ri-settings-4-line" />
|
||||
</button>
|
||||
|
||||
<RefreshButton on:refresh={() => loadUsers()} />
|
||||
|
||||
<div class="flex-fill" />
|
||||
|
||||
<button type="button" class="btn btn-expanded" on:click={() => userUpsertPanel?.show()}>
|
||||
|
||||
@@ -227,7 +227,16 @@ button {
|
||||
border-radius: 50%;
|
||||
padding: 0;
|
||||
i {
|
||||
$iconSize: 23px;
|
||||
font-size: 1.2857rem;
|
||||
text-align: center;
|
||||
width: $iconSize;
|
||||
height: $iconSize;
|
||||
line-height: $iconSize;
|
||||
&:before {
|
||||
margin: 0;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
&.btn-sm i,
|
||||
&.btn-xs i {
|
||||
|
||||
@@ -283,7 +283,6 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 30px;
|
||||
user-select: none;
|
||||
color: var(--txtDisabledColor);
|
||||
.breadcrumb-item {
|
||||
@extend h2;
|
||||
|
||||
@@ -27,12 +27,12 @@ PocketBase.prototype.logout = function(redirect = true) {
|
||||
* @param {String} defaultMsg Default toast notification message if the error doesn't have one.
|
||||
*/
|
||||
PocketBase.prototype.errorResponseHandler = function(err, notify = true, defaultMsg = '') {
|
||||
if (!err || !(err instanceof Error)) {
|
||||
if (!err || !(err instanceof Error) || err.isAbort) {
|
||||
return;
|
||||
}
|
||||
|
||||
const statusCode = (err?.response?.status << 0) || 400;
|
||||
const responseData = err?.response?.data || {};
|
||||
const statusCode = (err?.status << 0) || 400;
|
||||
const responseData = err?.data || {};
|
||||
|
||||
// add toast error notification
|
||||
if (
|
||||
|
||||
+5
-2
@@ -3,6 +3,9 @@ import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||
|
||||
// see https://vitejs.dev/config
|
||||
export default defineConfig({
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
||||
envPrefix: 'PB',
|
||||
base: process.env.NODE_ENV === 'production' ? '/_/' : './',
|
||||
build: {
|
||||
@@ -12,8 +15,8 @@ export default defineConfig({
|
||||
plugins: [
|
||||
svelte({
|
||||
experimental: {
|
||||
useVitePreprocess: true
|
||||
}
|
||||
useVitePreprocess: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
|
||||
Reference in new issue
Block a user